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