]> ruderich.org/simon Gitweb - config/dotfiles.git/blob - xinitrc
*: License under GPL v3+.
[config/dotfiles.git] / xinitrc
1 #!/bin/sh
2
3 # startx configuration file.
4
5 # Copyright (C) 2011-2012  Simon Ruderich
6 #
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.
11 #
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.
16 #
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/>.
19
20
21 # Start ssh-agent if we have private keys, thanks to
22 # http://code.haskell.org/XMonadContrib/scripts/xinitrc (read on 2011-06-19).
23 if [ -x /usr/bin/ssh-agent -a -f "$HOME/.ssh/id_rsa" ]; then
24     # -s to force bourne shell output. This file is a bourne shell script even
25     # if the environment might suggest otherwise.
26     eval `/usr/bin/ssh-agent -s`
27 fi
28
29 # Use a black background for the root window.
30 xsetroot -solid black
31
32 # Force English keyboard layout.
33 if [ -x /usr/bin/setxkbmap ]; then
34     setxkbmap us
35 fi
36
37 # Use my X11 key bindings.
38 xmodmap ~/.xmodmaprc
39
40 # Change the background if available.
41 if [ -f ~/.background ]; then
42     # But not on slow machines in the university.
43     HOSTNAME=`hostname`
44     if [ "x`echo $HOSTNAME | grep faui0sr`" = x ]; then
45         if [ -x /usr/bin/hsetroot ]; then
46             hsetroot -full ~/.background
47         elif [ -x /usr/bin/feh ]; then
48             feh --bg-scale ~/.background
49         fi
50     fi
51 fi
52
53 # Display reminders.
54 if [ -x /usr/bin/remind -a -f ~/.reminders ]; then
55     remind -z1 -k'.shell/bin/notify.py %s &' ~/.reminders &
56 fi
57
58 # Start XMonad.
59 xmonad
60
61 # vim: ft=sh