dotfiles

configuration files for shell, text editor, graphical environment, etc.
git clone git://src.adamsgaard.dk/dotfiles # fast
git clone https://src.adamsgaard.dk/dotfiles.git # slow
Log | Files | Refs | README | LICENSE Back to index

.xsession (1165B)


      1 #!/bin/sh
      2 [ -f ~/.profile ] && . ~/.profile
      3 [ -f ~/.Xresources ] && xrdb ~/.Xresources
      4 
      5 if [ "$(hostname)" = "lmsc.home" ] && [ "$DISPLAY" = :0 ]; then
      6 	[ -f ~/.xprofile-hidpi ] && . ~/.xprofile-hidpi
      7 	[ -f ~/.Xresources-hidpi ] && xrdb -merge ~/.Xresources-hidpi
      8 fi
      9 
     10 xsetroot -solid "#000000"
     11 setxkbmap -option ctrl:nocaps 
     12 
     13 xset -b                # Disable beeps
     14 xset +dpms             # Energy Star features on
     15 xset dpms 300 600 900
     16 xset r rate 300 50     # key repeat rate ([delay in ms] [repeats per sec])
     17 
     18 if [ "$(uname)" = "OpenBSD" ]; then
     19 	xinput set-prop "/dev/wsmouse" "WS Pointer Wheel Emulation" 1
     20 	xinput set-prop "/dev/wsmouse" "WS Pointer Wheel Emulation Button" 2
     21 	xinput set-prop "/dev/wsmouse" "WS Pointer Wheel Emulation Axes" 6 7 4 5
     22 	xset m 2/1 0
     23 	xidle -timeout 600 &
     24 else
     25 	xset m 1/4 0
     26 	xautolock -time 20 -locker "slock" &
     27 fi
     28 
     29 if [ -z "$SSH_AGENT_PID" ]; then
     30 	if [ -x /usr/bin/ssh-agent ] && [ -f $HOME/.ssh/id_rsa ]; then
     31 		eval "$(ssh-agent -s)"
     32 		ssh-add < /dev/null
     33 	fi
     34 fi
     35 
     36 GPG_TTY=$(tty)
     37 export GPG_TTY
     38 
     39 dunst &
     40 spoon >/dev/null 2>&1 &
     41 
     42 dwm || xterm
     43 
     44 if [ "$SSH_AGENT_PID" ]; then
     45 	ssh-add -D </dev/null
     46 	eval "$(ssh-agent -s -k)"
     47 fi