]> git.sev.monster Git - dotfiles.git/blame - base/.xinitrc
fix for shells without OSTYPE
[dotfiles.git] / base / .xinitrc
CommitLineData
189288f7 1#!/bin/sh
2
3sysmodmap=/usr/local/etc/X11/xinit/.Xmodmap
4sysresources=/usr/local/etc/X11/xinit/.Xresources
5usermodmap="$HOME/.Xmodmap"
6userresources="$HOME/.Xresources"
7
8if [ -f $sysresources ]; then
9 xrdb -merge $sysresources
10fi
11if [ -f $sysmodmap ]; then
12 xmodmap $sysmodmap
13fi
14if [ -f "$userresources" ]; then
15 xrdb -merge "$userresources"
16fi
17if [ -f "$usermodmap" ]; then
18 xmodmap "$usermodmap"
19fi
20
7045a58b 21# redshift, root image
189288f7 22redon &
9fddba79 23"$HOME/.fehbg"
24
25# Xorg settings
26xset r rate 290 26 &
27xset m 1/1 0 &
7045a58b 28xset s off
29xset dpms 0 0 600
9fddba79 30
31# root terminal
6aa38e2c 32urxvt -name TermBg1 -override-redirect -geometry x5+0--1 \
9938f1e2 33 -e tail -F /var/log/messages &
6aa38e2c 34xdotool search --limit 1 --sync --classname TermBg1 windowsize -usehints 100% 6
9fddba79 35
36# tray icons
37#"$HOME/src/phwmon/phwmon.py" --mem --mem_percent --net --io --bg \#0000 &
38volumeicon &
39
40# daemons
189288f7 41dunst &
b75501d1 42mpc-notify -d &
189288f7 43xautolock -time 10 -locker "$HOME/bin/l" &
44xbanish &
39bd5e00 45eval `ssh-agent`
189288f7 46
47if [ -x /usr/local/bin/urxvtd ]; then
48 for i in 1 2; do
7045a58b 49 # try to start client twice, once before checking for daemon
50 # and another after trying to start it
39bd5e00 51 urxvtc -e exit
189288f7 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
64fi
65
9fddba79 66# try to wait for session to start
67(sleep 0.1 && tint2) &
f29cd560 68#x220t
7045a58b 69(sleep 0.1 && [ -x "$HOME/bin/acpi_ac" ] && \
70 "$HOME/bin/acpi_ac" "0x0`sysctl -n hw.acpi.acline`") &
9fddba79 71(sleep 1.5 && [ -x /usr/local/bin/conky ] && conky -c "$HOME/.conkyrc.d/dock") &
72
39bd5e00 73# load any global scripts
189288f7 74if [ -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
79fi
80
7045a58b 81# start session
189288f7 82if [ ! -n "$1" ]; then
83 session=i3
84else
85 session=$1
39bd5e00 86 shift
189288f7 87fi
39bd5e00 88exec $session "$@"
9fddba79 89
90# cleanup
7045a58b 91#TODO: trap this
9fddba79 92ssh-agent -k
This page took 0.055133 seconds and 4 git commands to generate.