summaryrefslogtreecommitdiff
path: root/config/PreSession
blob: 971bd3f2cd17ca5dacc0e33980ed9fc13de23ff3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/bin/sh
#
# Note that any setup should come before the sessreg command as
# that must be 'exec'ed for the pid to be correct (sessreg uses the parent
# pid)
#
# Note that output goes into the .xsession-errors file for easy debugging
#
PATH=/usr/bin/X11:/usr/X11R6/bin:/opt/X11R6/bin:$PATH

if command -v xsetroot > /dev/null 2>&1; then
	xsetroot -cursor_name left_ptr -solid "#363047"
fi

if command -v sessreg > /dev/null 2>&1; then
	# some output for easy debugging
	echo "$0: Registering your session with wtmp and utmp"
	echo "$0: running: sessreg -a -w /var/log/wtmp -u /var/run/utmp -x \"$X_SERVERS\" -h \"$REMOTE_HOST\" -l $DISPLAY $USER"

	exec sessreg -a -w /var/log/wtmp -u /var/run/utmp -x "$X_SERVERS" -h "$REMOTE_HOST" -l $DISPLAY $USER
	# this is not reached
fi

# some output for easy debugging
echo "$0: could not find the sessreg utility, cannot update wtmp and utmp"
exit 0