summaryrefslogtreecommitdiff
path: root/xinitrc
blob: 25e91d03b59fca90f69416f467874ae9124f8c74 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
#!/bin/sh
#
# anrxc's X.org init file on Arch GNU/Linux


# {{{ Environment settings
errorlog="${HOME}/.xerrors"
gnupglog="${HOME}/.gnupg/gpg-agent.info"

# Export KDE styles to QT
export QT_PLUGIN_PATH="${HOME}/.kde4/lib/kde4/plugins/:/usr/lib/kde4/plugins/"
# }}}


# {{{ Log settings
#
# Always start X11 with a clean log file
if (cp /dev/null "${errorlog}"); then
  chmod 600 "${errorlog}"
  exec >"${errorlog}" 2>&1
  break
fi
# }}}


# {{{ Display settings
#
# Ignore reported display size and force DPI
#xrandr --dpi 96

# Force LVDS as the primary screen
#xrandr --output LVDS1 --primary

# Brightness level
xbacklight -set 00
# }}}


# {{{ Resource and keymap settings
usermodmap="${HOME}/.Xmodmap"
userresources="${HOME}/.Xresources"
sysmodmap="/etc/X11/xinit/.Xmodmap"
sysresources="/etc/X11/xinit/.Xresources"

# Merge system and user resources and keymaps
[[ -r "${sysresources}" ]]  && xrdb -merge "${sysresources}"
[[ -r "${sysmodmap}" ]]     && xmodmap "${sysmodmap}"
[[ -r "${userresources}" ]] && xrdb -merge "${userresources}"
[[ -r "${usermodmap}" ]]    && xmodmap "${usermodmap}"
# }}}


# {{{ Input settings
# 
# Keyboard control, repeat delay and repeat rate
xset r rate 200 30

# Pointer control, acceleration and threshold
#xset m 30/10 4

# Pointer appearance
#   - xcb does not support Xcursor yet
xsetroot -cursor_name left_ptr

# Disable the touchpad while typing
#syndaemon -k -i 2 -d &
# }}}


# {{{ Autostart settings
#
# Start the GnuPG agent but don't enable OpenSSH agent emulation
if (pgrep -u "${USER}" gpg-agent); then
  eval `cat ${gnupglog}`
  eval `cut -d= -f1 ${gnupglog} | xargs echo export`
else
  #eval `gpg-agent --enable-ssh-support --daemon`
  eval  `gpg-agent --daemon`
fi

# Start the SSH-Agent to replace broken GnuPG agent
if (pgrep -u "${USER}" ssh-agent); then
  eval `cat ${HOME}/.keychain/${HOSTNAME}-sh`
else
  eval `ssh-agent`
  (sleep 15 && keychain -q --timeout 480 --agents ssh id_rsa_sysphere id_rsa_heroin)&
fi

# Start the GNU Emacs daemon
#[[ ! -r "/tmp/emacs${UID}/server" ]] && emacs --daemon &
#   - disable the socket logic, Gtk+ bug crashes emacs, leaves the socket
#   - http://bugzilla.gnome.org/show_bug.cgi?id=85715
emacs --daemon &

# Xwrits reminds you to take wrist breaks and avoid RSI
xwrits typetime=45 clock breakclock top ready-picture="${HOME}/.xwrits/ready.gif" \
  rest-picture="${HOME}/.xwrits/rest.gif" warning-picture="${HOME}/.xwrits/warning.gif" &

# Open a terminal emulator on the first tag
#   - resume the old screen session or start a new one
urxvt -e screen -l -UDRS term &

# Play a startup sound
ogg123 -q "${HOME}/.local/share/gajim/sounds/voices/voice-system-activated.ogg" &
# }}}


# {{{ Window manager selection
case "$WM" in
  failsafe|twm)
    exec twm
    ;;
  fvwm)
    exec fvwm2
    ;;
  kde)
    exec startkde
    ;;
  debug)
    exec valgrind -v "$1"
    ;;
  *)
    exec awesome
    ;;
esac
# }}}