summaryrefslogtreecommitdiff
path: root/xinitrc
blob: d672077aaa1bc6e0260446f0cbebe0305c7a5275 (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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
#!/bin/sh
#
# anrxc's X.org init file on Arch GNU/Linux


# {{{ Log settings
errorlog="$HOME/.xsession-errors"

# Start with a clean log file every time
if ( cp /dev/null "$errorlog" 2> /dev/null ); then
     chmod 600 "$errorlog"
     exec > "$errorlog" 2>&1
     break
fi
# }}}


# {{{ Environment settings
#
# Somewhat nicer OpenOffice than with QT style
export OOO_FORCE_DESKTOP="gnome"

# Disable Pango in Gecko, performance wise
export MOZ_DISABLE_PANGO=1
# }}}


# {{{ 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
if [ -f $sysresources ]; then
    /usr/bin/xrdb -merge $sysresources
fi

if [ -f $sysmodmap ]; then
    /usr/bin/xmodmap $sysmodmap
fi

if [ -f $userresources ]; then
    /usr/bin/xrdb -merge $userresources
fi

if [ -f $usermodmap ]; then
    /usr/bin/xmodmap $usermodmap
fi
# }}}


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

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

# Touchpad control
#  - disable tapping/scrolling when typing
#/usr/bin/syndaemon -t -i 2 &

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

# Fix broken (HAL) key mappings
#  - Lock key
/usr/bin/sudo /usr/bin/setkeycodes e06e 152
#  - Presentation key
/usr/bin/sudo /usr/bin/setkeycodes e075 217
#  - Sync key
/usr/bin/sudo /usr/bin/setkeycodes e079 173
#  - Euro key
/usr/bin/sudo /usr/bin/setkeycodes e033 159
#  - Dollar key
/usr/bin/sudo /usr/bin/setkeycodes e034 151
# }}}


# {{{ Display settings
#
# Brightness level
#   - xbacklight can't be used with legacy control, so set level first
#/usr/bin/xbacklight -set 10

# Legacy control solves resetting brightness levels
#/usr/bin/xrandr --output LVDS1 --set BACKLIGHT_CONTROL legacy

# Ignore reported display size and force DPI
#/usr/bin/xrandr --dpi 96

# Force LVDS as the primary screen
#/usr/bin/xrandr --output LVDS1 --primary
# }}}


# {{{ Autostart settings
#
# Start the GnuPG agent and enable the OpenSSH agent emulation
eval "$(/usr/bin/killall gpg-agent; /usr/bin/gpg-agent --enable-ssh-support --daemon)"

# Play a startup sound
#/usr/bin/ogg123 -q $HOME/.fvwm/sounds/Startup.ogg &

# Set the wallpaper(s) for all screens
#   - awesome 3 calls nitrogen
#/usr/bin/nitrogen --restore &

# Preload KDE daemons
#/usr/bin/kdeinit4 &

# Systray if needed 
#   - awesome 3 has its own systray
#/usr/bin/stalonetray -bg '#1a1a1a' -geometry 124x24+1156+776 --sticky --window-layer top &
#/usr/bin/trayer --edge top --align right --widthtype pixel --heighttype pixel --height 16 \
# --width 70 --expand false --transparent true --alpha 0 --tint 0x3f3f3f &

# Start the GNU Emacs daemon
/usr/bin/emacs --daemon &

# Xwrits reminds you to take wrist breaks and avoid RSI
/usr/bin/xwrits typetime=40 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
/usr/bin/urxvt -e screen -l -UDRS term &
# }}}


# {{{ Window manager selection
case $1 in
  twm)
      exec twm
      ;;
  fvwm)
      exec fvwm2
      ;;
  kde)
      exec startkde
      ;;
  *)
      exec awesome
      ;;
esac
# }}}