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