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