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