-
Notifications
You must be signed in to change notification settings - Fork 0
/
.xsession
executable file
·50 lines (45 loc) · 1.22 KB
/
.xsession
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#!/bin/sh
# which on different platforms behaves differently
safe_which() {
local TMP
TMP=`which $1 2>/dev/null`
ret=$?
if [ $ret -eq 0 ]; then
# for Solaris:
if [ -z "${TMP/*no $1*}" ]; then
echo ""
return 1
fi
fi
# for OpenBSD:
if [ -z "${TMP/*Command not found.}" ]; then
echo ""
return 1
fi
echo $TMP
return $ret
}
quick_which() {
safe_which "$1" 1>/dev/null
return $?
}
# this doesn't work when .xsession is sourced because $0 is "wrong".
# we'll hardcode $HOME/dotfiles for now and hope it always works. it probably will.
#if [ $(uname -s) == 'Linux' ]; then
# dotfiles=$(dirname $(readlink -f $0))
#else
# dotfiles=$(dirname $(realpath $0))
#fi
dotfiles="${HOME}/dotfiles"
# load the custom xkbsymbols into the second group
if $(quick_which setxkbmap) && $(quick_which xkbcomp); then
setxkbmap -print | sed -e '/xkb_symbols/s/"[[:space:]]/+local:2&/' | xkbcomp -w0 -I"$dotfiles/xkb" - $DISPLAY
fi
xset r rate 250
xset -b
export TZ=America/New_York
export LANG=en_US.UTF-8
export GDK_SCALE=2
# FIXME: stop spawning this blindly in case it's already running
eval `ssh-agent`
[ -x "${HOME}/.fehbg" ] && ${HOME}/.fehbg