# /etc/xprofile # Some X session related scripts and functions. source /etc/shell-colors Create_Date_String () { datestring=`date +"%G-%m-%d %T"` } X_Session_Log_Number () { # Use this for the .xsession log. This is not used for the same purpose as # a similar routine in the /usr/bin/startx script. display=0 while [ -e "/tmp/.X${display}-lock" ]; do display=$(( $display + 1 )) done display=$(( $display - 1 )) } X_Session_Log_Name () { X_Session_Log_Number # redirect X session messages to a file in user's home directory if we can for logfile in "$HOME/.xsession-log-:$display" "${TMPDIR-/tmp}/xses-$USER" "/tmp/xses-$USER" do if ( cp /dev/null "$logfile" 2> /dev/null ) then chmod 600 "$logfile" exec > "$logfile" 2>&1 break fi done } Text_Break () { echo "--------------------------------------------------------" >> $STATUSFILE } Initialize_Status_Header () { Create_Date_String if [ ! -f $STATUSFILE ] ; then touch $STATUSFILE fi echo "# This file is generated automatically and is" > $STATUSFILE echo "# updated during an X session. This file may be" >> $STATUSFILE echo "# deleted at any time." >> $STATUSFILE echo "# File created: $datestring" >> $STATUSFILE Text_Break } Initialize_Status_Message () { Initialize_Status_Header Text_Break echo "Starting X from $1: $datestring" >> $STATUSFILE if [ "$1" = "startx" ] ; then echo -e "${BOLDGREEN}Starting the X graphical environment...${COLOR_RESET}" fi }