# /etc/xprofile # Some X session related scripts and functions. source /etc/functions-colors Create_Date_String () { datestring=`date +"%G-%m-%d %T"` } X_Error_Log_Number () { # Use this for the .xsession-error log. This has no effect on the environment # variable of the same name and is not used for the same purpose as a similar # routine in the /usr/X11R6/bin/startx script. display=0 while [ -e "/tmp/.X${display}-lock" ]; do display=$(( $display + 1 )) done display=$(( $display - 1 )) } X_Error_Log_Name () { X_Error_Log_Number # redirect X error messages to a file in user's home directory if we can for errfile in "$HOME/.xsession-errors-:$display" "${TMPDIR-/tmp}/xses-$USER" "/tmp/xses-$USER" do if ( cp /dev/null "$errfile" 2> /dev/null ) then chmod 600 "$errfile" exec > "$errfile" 2>&1 break fi done } Text_Break () { echo "--------------------------------------------------------" >> $STATUSFILE } Initialize_Status_Header () { Create_Date_String if [ ! -f $STATUSFILE ] ; then touch $STATUSFILE echo "# This file is generated automatically and is" >> $STATUSFILE echo "# updated during an X session. This file may be" >> $STATUSFILE echo "# deleted to conserve drive space." >> $STATUSFILE echo "# file created: $datestring" >> $STATUSFILE Text_Break fi } 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 }