3 echo "Starting new session"
5 DATE=$(date "+%Y%m%d_%H%M%S")
6 # track xsession errors
7 mv ~/.xsession-errors ~/.xsession-errors_${DATE};
8 ln -sf ~/.xsession-errors_${DATE} ~/.xsession-errors-current;
9 # delete old xsession error files
10 find ~/ -maxdepth 1 -mindepth 1 -type f \
11 -iname '.xsession-errors*' -ctime +30 -delete;
13 if locale -a |grep -qi en_US.utf8; then
23 export TMPDIR=$(echo ~/tmp)
26 # No clue why this has changed from Alt_R to Down, but we really want Down.
27 if ! xmodmap -pk|grep -qe '116.*Down'; then
28 xmodmap -e 'keycode 116 = Super_L'
29 xmodmap -e 'keycode 115 = Multi_key'
31 xmodmap -e 'clear mod4'
32 xmodmap -e 'add mod4 = Super_L Super_R'
34 if [ -e ~/.Xresources_$HOSTNAME ]; then
35 xrdb -merge < ~/.Xresources_$HOSTNAME;
38 if [ -e ~/.xsession_$HOSTNAME ]; then
39 . ~/.xsession_$HOSTNAME
42 # make a backup of the .Xauthority
43 if [ -e ~/.Xauthority ]; then
44 cp -f .Xauthority .Xauthority.bak
47 if [ -x /usr/bin/xscreensaver -a -e ~/.xscreensaver ]; then
48 ( XENVIRONMENT=~/.xscreensaver /usr/bin/xscreensaver >/dev/null 2>&1 &)
49 elif [ -x /usr/bin/xautolock ]; then
50 (/usr/bin/xautolock -notifier true -bell 0 >/de/vnull 2>&1 &)
53 if which redshift >/dev/null 2>&1 &&
54 [ -e .location ]; then
56 (redshift -l $LOCATION >/dev/null 2>&1 &)
59 if which mopidy >/dev/null 2>&1 && [ -e ~/.config/mopidy/mopidy.conf ]; then
60 (mopidy > /dev/null 2>&1 & );
61 elif which mpd >/dev/null 2>&1 && [ -e ~/.mpdconf ]; then
62 (mpd >/dev/null 2>&1 &);
63 MPD_HOST=$(awk '/^bind_to_address/{print $2}' ~/.mpdconf|sed "s|~|$HOME|; s/^\"//; s/\"$//; ");
67 if [ -x /sbin/iw ] && which nm-applet >/dev/null 2>&1 && /sbin/iw list|grep -q '^Wiphy'; then
68 ( nm-applet > /dev/null 2>&1 & );
71 if [ -x /usr/bin/i3 ]; then
72 if [ -x ~/.config/i3/build_config.sh ]; then
73 ~/.config/i3/build_config.sh;
76 elif [ -x /usr/bin/awesome ]; then
77 exec /usr/bin/awesome;
78 elif [ -x /usr/bin/ion3 ]; then
80 elif [ -x /usr/bin/openbox ]; then
81 exec /usr/bin/openbox;
82 elif [ -x /usr/bin/rxvt ]; then
84 elif [ -x /usr/bin/rxvt-unicode ]; then
85 exec /usr/bin/rxvt-unicode;
86 elif [ -x /usr/bin/xterm ]; then