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