#!/bin/sh ### BEGIN INIT INFO # Provides: xconfig kdmrc # Required-Start: $local_fs $remote_fs # Required-Stop: $local_fs $remote_fs # X-Start-Before: kdm # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: switches x configuration ### END INIT INFO # # description: switches xconfig and kdmrc # . /lib/lsb/init-functions CMDLINE=`cat /proc/cmdline` XCONFIG="" for CMD in $CMDLINE do case $CMD in xconfig=monitor) XCONFIG=monitor ;; xconfig=beamer) XCONFIG=beamer ;; user=a) USER=a ;; user=b) USER=b ;; esac done case "$1" in start) if [ -f /etc/X11/xorg.conf-$XCONFIG ]; then rm /etc/X11/xorg.conf ln -s /etc/X11/xorg.conf-$XCONFIG /etc/X11/xorg.conf log_success_msg "Switched xconfig $XCONFIG" else log_warning_msg "Could not switch xconfig: $XCONFIG was missing" fi KDMRC=/etc/kde4/kdm/kdmrc if [ -f $KDMRC-$USER ]; then rm $KDMRC ln -s $KDMRC-$USER $KDMRC log_success_msg "Switched kdmrc $USER" else log_warning_msg "Could not switch kdmrc: $USER was missing" fi esac