]> git.sev.monster Git - dotfiles.git/blob - base/.xinitrc
move to promptinit, cleanup zshrc, add up alias
[dotfiles.git] / base / .xinitrc
1 #!/bin/zsh
2 # using zsh to load .zshenv (eg. for PATH) but file is sh-compatible
3
4 sysmodmap=/usr/local/etc/X11/xinit/.Xmodmap
5 sysresources=/usr/local/etc/X11/xinit/.Xresources
6 usermodmap=~/.Xmodmap
7 userresources=~/.Xresources
8
9 if [ -f $sysresources ]; then
10         xrdb -merge $sysresources
11 fi
12 if [ -f $sysmodmap ]; then
13         xmodmap $sysmodmap
14 fi
15 if [ -f "$userresources" ]; then
16         xrdb -merge "$userresources"
17 fi
18 if [ -f "$usermodmap" ]; then
19         xmodmap "$usermodmap"
20 fi
21
22 # redshift, root image
23 redon &
24 "$HOME/.fehbg"
25
26 # Xorg settings
27 xset r rate 290 26 &
28 xset m 1/1 0 &
29 xset s off
30 xset dpms 0 0 600
31
32 find -L "${XDG_DATA_HOME:-~/share}/fonts" -type d -mindepth 1 -maxdepth 1 | while read -r x; do
33         xset +fp $x/
34 done
35 xset fp rehash
36
37 # root terminal
38 urxvt -name TermBg1 -override-redirect -geometry x5+0--1 \
39       -e tail -F /var/log/messages &
40 xdotool search --limit 1 --sync --classname TermBg1 windowsize --usehints 100% 6
41
42 # tray icons
43 #"$HOME/src/phwmon/phwmon.py" --mem --mem_percent --net --io --bg \#0000 &
44 volumeicon &
45
46 # daemons
47 dunst &
48 mpc-notify -d &
49 xautolock -time 10 -locker "$HOME/bin/lck" &
50 xbanish &
51 eval `ssh-agent`
52
53 if [ -z "$TERMINAL" -a \( -x /usr/bin/urxvtd -o -x /usr/local/bin/urxvtd \) ]; then
54         for i in 1 2; do
55                 # try to start client twice, once before checking for daemon
56                 # and another after trying to start it
57                 urxvtc -e exit 2>/dev/null
58                 if [ $? -eq 2 ]; then
59                         # daemon not started, attempt to start once
60                         if [ $i -eq 1 ]; then
61                                 urxvtd -q -o -f
62                         else
63                                 TERMINAL=urxvt
64                                 export TERMINAL
65                         fi
66                 else
67                         TERMINAL=urxvtc
68                         export TERMINAL
69                         break
70                 fi
71         done
72         unset i
73 fi
74
75 # try to wait for session to start
76 (sleep 0.1 && tint2) &
77 # x220t
78 # TODO: check hostname to load auxillary things
79 # TODO: reformat for linux
80 #(sleep 0.1 "$HOME/bin/acpi_ac" "0x0`sysctl -n hw.acpi.acline`") &
81
82 # load any global scripts
83 if [ -d /usr/local/etc/X11/xinit/xinitrc.d ]; then
84         for f in /usr/local/etc/X11/xinit/xinitrc.d/?*.sh; do
85                 [ -x "$f" ] && . "$f"
86         done
87         unset f
88 fi
89
90 # start session
91 if [ -z "$1" ]; then
92         session=i3
93 else
94         session=$1
95         shift
96 fi
97 exec $session "$@"
98
99 # cleanup
100 #TODO: trap this
101 ssh-agent -k
This page took 0.051083 seconds and 4 git commands to generate.