#!/bin/sh # Options # -------------------------------------------------- XNEST_GEOMETRY="-geometry 1024x768+0+0" if [ "$1" = "-h" ]; then echo "xnest [options] [display]" echo " -h : this help" echo " -2 : window twice as wide to leave a space for the notes" exit 0 fi if [ "$1" = "-2" ]; then XNEST_GEOMETRY="-geometry 2048x768+0+0" shift fi # Configuration # -------------------------------------------------- XNEST=/usr/bin/X11/Xnest # TWM is very light: WM="/usr/bin/twm -f $HOME/.twmrc.projection" #WM=fluxbox XTERM=/usr/bin/rxvt XTERM_FONT=-adobe-courier-medium-r-normal--*-100-*-*-m-*-iso8859-1 #GEOMETRY="-geometry 800x600+0+-10" # Selecting a display # -------------------------------------------------- # If $DISPLAY=:x.y then DISPLAY_NUMBER=x DISPLAY_NUMBER=`echo $DISPLAY | cut -d "." -f1 | cut -b 2-` if [ "x$1" = "x" ]; then NEW_DISPLAY=$[ $DISPLAY_NUMBER + 1 ] NEW_DISPLAY=":$NEW_DISPLAY" else NEW_DISPLAY=$1 fi # Setup xauth to allow you through and run Xnest # -------------------------------------------------- HOSTNAME=`hostname` XAUTH_KEY=$(xauth list | grep "$HOSTNAME" | grep ":$DISPLAY_NUMBER ") # Do not put '"' around $XAUTH_KEY for several consecutive spaces to # be reduced to only one: XAUTH_KEY=$(echo $XAUTH_KEY | cut -d " " -f 3) xauth add $NEW_DISPLAY MIT-MAGIC-COOKIE-1 $XAUTH_KEY echo "Starting Xnest on display $NEW_DISPLAY" # xnest does not set a WM_CLASS which makes impossible for the WM to set # specific properties... # -kb for french keyboard $XNEST $XNEST_GEOMETRY -kb -name xnest $NEW_DISPLAY & # Launch some clients # -------------------------------------------------- $WM -display $NEW_DISPLAY & DISPLAY=$NEW_DISPLAY fbsetbg $HOME/images/Debian_Wallpaper.png cd $HOME $XTERM -display $NEW_DISPLAY -geometry x7+5+5 -fn $XTERM_FONT & exit 0 # P.S. xrandr might also be interesting.