]>
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 | ||
7045a58b | 21 | # redshift, root image |
189288f7 | 22 | redon & |
9fddba79 | 23 | "$HOME/.fehbg" |
24 | ||
25 | # Xorg settings | |
26 | xset r rate 290 26 & | |
27 | xset m 1/1 0 & | |
7045a58b | 28 | xset s off |
29 | xset dpms 0 0 600 | |
9fddba79 | 30 | |
31 | # root terminal | |
b3d0247b | 32 | urxvt -name URxvtBG -override-redirect -geometry x5+0-0 \ |
9938f1e2 | 33 | -e tail -F /var/log/messages & |
b3d0247b | 34 | xdotool search --limit 1 --sync --classname URxvtBG windowsize -usehints 100% 6 |
9fddba79 | 35 | |
36 | # tray icons | |
37 | #"$HOME/src/phwmon/phwmon.py" --mem --mem_percent --net --io --bg \#0000 & | |
38 | volumeicon & | |
39 | ||
40 | # daemons | |
189288f7 | 41 | dunst & |
189288f7 | 42 | xautolock -time 10 -locker "$HOME/bin/l" & |
43 | xbanish & | |
39bd5e00 | 44 | eval `ssh-agent` |
189288f7 | 45 | |
46 | if [ -x /usr/local/bin/urxvtd ]; then | |
47 | for i in 1 2; do | |
7045a58b | 48 | # try to start client twice, once before checking for daemon |
49 | # and another after trying to start it | |
39bd5e00 | 50 | urxvtc -e exit |
189288f7 | 51 | if [ $? -eq 2 ]; then |
52 | # daemon not started, attempt to start once | |
53 | if [ $i -eq 1 ]; then | |
54 | urxvtd -q -o -f | |
55 | fi | |
56 | else | |
57 | TERMINAL=/usr/local/bin/urxvtc | |
58 | export TERMINAL | |
59 | break | |
60 | fi | |
61 | done | |
62 | unset i | |
63 | fi | |
64 | ||
9fddba79 | 65 | # try to wait for session to start |
66 | (sleep 0.1 && tint2) & | |
7045a58b | 67 | (sleep 0.1 && [ -x "$HOME/bin/acpi_ac" ] && \ |
68 | "$HOME/bin/acpi_ac" "0x0`sysctl -n hw.acpi.acline`") & | |
9fddba79 | 69 | (sleep 1.5 && [ -x /usr/local/bin/conky ] && conky -c "$HOME/.conkyrc.d/dock") & |
70 | ||
39bd5e00 | 71 | # load any global scripts |
189288f7 | 72 | if [ -d /usr/local/etc/X11/xinit/xinitrc.d ]; then |
73 | for f in /usr/local/etc/X11/xinit/xinitrc.d/?*.sh; do | |
74 | [ -x "$f" ] && . "$f" | |
75 | done | |
76 | unset f | |
77 | fi | |
78 | ||
7045a58b | 79 | # start session |
189288f7 | 80 | if [ ! -n "$1" ]; then |
81 | session=i3 | |
82 | else | |
83 | session=$1 | |
39bd5e00 | 84 | shift |
189288f7 | 85 | fi |
39bd5e00 | 86 | exec $session "$@" |
9fddba79 | 87 | |
88 | # cleanup | |
7045a58b | 89 | #TODO: trap this |
9fddba79 | 90 | ssh-agent -k |