3 # startx configuration file.
5 # Copyright (C) 2011-2013 Simon Ruderich
7 # This program is free software: you can redistribute it and/or modify
8 # it under the terms of the GNU General Public License as published by
9 # the Free Software Foundation, either version 3 of the License, or
10 # (at your option) any later version.
12 # This program is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 # GNU General Public License for more details.
17 # You should have received a copy of the GNU General Public License
18 # along with this program. If not, see <http://www.gnu.org/licenses/>.
21 # Some systems don't set the LANG environment variable when starting xinitrc,
22 # this causes problems for rxvt-unicode-256color which fails to display UTF-8
23 # characters correctly when LANG is missing and for notify.py which also needs
24 # LANG set (for Python's decode() function). Therefore set it here, might be
25 # overwritten by shell setup scripts.
30 # Start ssh-agent if we have private keys, thanks to
31 # http://code.haskell.org/XMonadContrib/scripts/xinitrc (read on 2011-06-19).
32 if test -x /usr/bin/ssh-agent && test -f "$HOME/.ssh/id_rsa"; then
33 # -s to force bourne shell output. This file is a bourne shell script even
34 # if the environment might suggest otherwise.
35 eval `/usr/bin/ssh-agent -s`
38 # Use a black background for the root window.
41 # Force English keyboard layout.
42 if test -x /usr/bin/setxkbmap; then
46 # Use my X11 key bindings.
47 xmodmap "$HOME/.xmodmaprc"
49 # Default to use a background image. Can be disabled in .xinitrc.local.
52 # Load settings for the local system.
53 if test -f "$HOME/.xinitrc.local"; then
54 . "$HOME/.xinitrc.local"
57 # Change the background if available.
58 if test -f "$HOME/.background" && test -n "$set_background"; then
59 if test -x /usr/bin/hsetroot; then
60 hsetroot -full "$HOME/.background"
61 elif test -x /usr/bin/feh; then
62 feh --bg-scale "$HOME/.background"
63 # Remove the unnecessary ~/.fehbg file created by `feh`. I don't want
64 # to restore the background, I just run `feh` on each startx run.
65 # --no-fehbg is only available in recent feh releases.
70 # Display timed reminders and recheck the file for changes every minute (-z1).
71 if test -x /usr/bin/remind && test -f "$HOME/.reminders"; then
72 remind -z1 -k'.shell/bin/notify.py %s &' "$HOME/.reminders" &
76 # XMonad doesn't start a shell on its own, start one when I login.
77 (urxvt || rxvt || xterm) &