]>
Commit | Line | Data |
---|---|---|
189288f7 | 1 | #!/bin/sh |
2 | ||
3 | sysmodmap=/usr/local/etc/X11/xinit/.Xmodmap | |
4 | sysresources=/usr/local/etc/X11/xinit/.Xresources | |
5 | usermodmap="$HOME/.Xmodmap" | |
6 | userresources="$HOME/.Xresources" | |
7 | ||
8 | if [ -f $sysresources ]; then | |
9 | xrdb -merge $sysresources | |
10 | fi | |
11 | if [ -f $sysmodmap ]; then | |
12 | xmodmap $sysmodmap | |
13 | fi | |
14 | if [ -f "$userresources" ]; then | |
15 | xrdb -merge "$userresources" | |
16 | fi | |
17 | if [ -f "$usermodmap" ]; then | |
18 | xmodmap "$usermodmap" | |
19 | fi | |
20 | ||
39bd5e00 | 21 | # session-independent |
189288f7 | 22 | xset r rate 290 26 |
23 | xset m 1/1 0 | |
24 | redon & | |
25 | dunst & | |
189288f7 | 26 | xautolock -time 10 -locker "$HOME/bin/l" & |
27 | xbanish & | |
39bd5e00 | 28 | eval `ssh-agent` |
189288f7 | 29 | |
39bd5e00 | 30 | # run terminal daemon |
189288f7 | 31 | if [ -x /usr/local/bin/urxvtd ]; then |
32 | for i in 1 2; do | |
33 | # try to start client twice, once before checking for daemon and | |
34 | # another after trying to start it | |
39bd5e00 | 35 | urxvtc -e exit |
189288f7 | 36 | if [ $? -eq 2 ]; then |
37 | # daemon not started, attempt to start once | |
38 | if [ $i -eq 1 ]; then | |
39 | urxvtd -q -o -f | |
40 | fi | |
41 | else | |
42 | TERMINAL=/usr/local/bin/urxvtc | |
43 | export TERMINAL | |
44 | break | |
45 | fi | |
46 | done | |
47 | unset i | |
48 | fi | |
49 | ||
39bd5e00 | 50 | # load any global scripts |
189288f7 | 51 | if [ -d /usr/local/etc/X11/xinit/xinitrc.d ]; then |
52 | for f in /usr/local/etc/X11/xinit/xinitrc.d/?*.sh; do | |
53 | [ -x "$f" ] && . "$f" | |
54 | done | |
55 | unset f | |
56 | fi | |
57 | ||
39bd5e00 | 58 | tint2 & |
59 | # sleep for tint to start | |
60 | sleep 3 | |
61 | ||
62 | # try to wait for session to start | |
63 | (sleep 0.2 && [ -x "$HOME/bin/acpi_ac" ] && "$HOME/bin/acpi_ac" "0x0`sysctl -n hw.acpi.acline`") & | |
64 | (sleep 1 && "$HOME/.fehbg") & | |
65 | (sleep 1.5 && [ -x /usr/local/bin/conky ] && conky -c "$HOME/.conkyrc.d/dock") & | |
66 | ||
189288f7 | 67 | if [ ! -n "$1" ]; then |
68 | session=i3 | |
69 | else | |
70 | session=$1 | |
39bd5e00 | 71 | shift |
189288f7 | 72 | fi |
39bd5e00 | 73 | exec $session "$@" |