Rev 1 | Go to most recent revision | Blame | Last modification | View Log | Download | RSS feed
#!/bin/bash
#
# Prepares for automatically login to icewm
# runs at the end of /etc/init.d/runlast
# (at the moment only for Mini LiveCD)
#
# Urs Beyerle, PSI
#
### definitions
# dir of mounted live system: /$MOUNTDIR/live
MOUNTDIR=livecd
# source functions
. /$MOUNTDIR/live/liblinuxlive
# PSI setup?
PSI=$( cmdline_parameter psi )
# no local user?
NOLOCAL=$( cmdline_parameter nolocal )
# set local user name
if [ $PSI ]; then
LOCALUSER=l_psi
else
LOCALUSER=sluser
fi
### create .xinitrc for LOCALUSER and root
XINITRC=/root/.xinitrc
echo "[ -x ~/autostart ] && ~/autostart" > $XINITRC
echo "[ ! -x ~/autostart ] && xterm -geometry 100x30+100+100 &" >> $XINITRC
echo "exec icewm-session" >> $XINITRC
chmod 755 $XINITRC
[ ! $NOLOCAL ] && cp -a $XINITRC /home/$LOCALUSER/
[ ! $NOLOCAL ] && chown $LOCALUSER /home/$LOCALUSER/.xinitrc
### link .xsession to .xinitrc
ln -sf .xinitrc /root/.xsession
[ ! $NOLOCAL ] && ln -sf .xinitrc /home/$LOCALUSER/.xsession
### run startx (over .bashrc) at autotlogin of LOCALUSER
# autologin is done by /etc/inittab
[ ! $NOLOCAL ] && echo 'if [ "$( tty )" = "/dev/tty6" ]; then startx; fi' >> /home/$LOCALUSER/.bashrc