[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: saving X session?



Ron Farrer wrote:

  >When I log out all my settings are lost; window manager (WindowMaker),
  >themes, etc. How can I make it so that these things 'stick' when I
  >logout and back in? I'm using slink and xdm to load X.
 
Typically, you will create a file in your home directory called .xsession
which contains the necessary commands.  All the commands should terminate
with &, so that they execute in the background, except for the last, which
is typically the window manager itself.  When this last command 
terminates, the session is over and xdm's login screen appears again.

.xsession should be hard- or soft-linked to .xinitrc, which is used if
you run startx rather than xdm.


Here is an example:

#!/bin/sh
# $XConsortium: xinitrc.cpp,v 1.4 91/08/22 11:41:34 rws Exp $

. /etc/environment

if [ -f $HOME/.bash_profile ]
then
	. $HOME/.bash_profile
fi
PATH=/usr/local/bin:/usr/local/bin/X11:/bin:/usr/bin:/usr/bin/X11:/usr/bin/mh:/usr/lib/games:/usr/uv/bin:$HOME/bin:.
MANPATH=/usr/local/man:/usr/X11R6/man:/usr/man:/usr/local/pgsql/man
XAUTHORITY=/home/olly/.Xauthority
PGPPATH=/home/olly/.pgp
PAGER=less
KDEDIR=/usr/local
LD_LIBRARY_PATH=/usr/local/lib
EDITOR=vi
userresources=$HOME/.Xresources
#usermodmap=$HOME/.Xmodmap
xmodmap $HOME/.xmodmap-`uname -n`
sysresources=/usr/X11R6/lib/X11/xinit/.Xresources
sysmodmap=/usr/X11R6/lib/X11/xinit/.Xmodmap

# merge in defaults and keymaps
set -a
. /etc/environment
export PATH MANPATH PGPPATH XAUTHORITY PAGER KDEDIR LD_LIBRARY_PATH EDITOR
export SmallEiffel EIFFEL_GTK GOBO EIFFEL4
export QTDIR=/usr/X11R6/lib

if [ -f $sysresources ]; then
    xrdb -merge $sysresources
fi

if [ -f $sysmodmap ]; then
    xmodmap $sysmodmap
fi

if [ -f $userresources ]; then
    xrdb -merge $userresources
fi

if [ -f $usermodmap ]; then
    xmodmap $usermodmap
fi

# set up the environment
export HOSTDISPLAY=linda:0.0

# Get the Backspace key to work properly
xmodmap -e "keycode 22 = BackSpace"

# start some nice programs
xfishtank -f 15 &
#xearth -rot 22.5 -pos "orbit 1.6 90" -wait 60 -ncolors 24 -gamma 1.6 &
xscreensaver -timeout 5 -cycle 5 -nice 20 -lock -lock-timeout 2 &
xterm -sb -sl 500 -ls -j -geometry 80x24+750+100 &
xterm -sb -sl 500 -ls -j -geometry 80x60+90+0 &
xpostit -geometry 70x80+1200+60 &
ical -iconic&
dctrl&
xconsole -file /dev/xconsole -exitOnFail -geometry 500x80+600+0 &
xset m 6 4
xsetroot -cursor_name mouse     
unclutter &
exec fvwm2 >~/fvwm.stdout 2>~/fvwm.stderr
#exec /usr/bin/gnome-session


-- 
      Vote against SPAM: http://www.politik-digital.de/spam/
                 ========================================
Oliver Elphick                                Oliver.Elphick@lfix.co.uk
Isle of Wight                              http://www.lfix.co.uk/oliver
               PGP key from public servers; key ID 32B8FAA1
                 ========================================
     "Lo, children are an heritage of the LORD; and the  
      fruit of the womb is his reward."        Psalms 127:3 



Reply to: