dotfiles

Clean dotfiles
git clone git://git.dimitrijedobrota.com/dotfiles.git
Log | Files | Refs

xinitrc (1140B)


      1 #!/bin/sh
      2 
      3 userresources=$XDG_CONFIG_HOME/X11/Xresources
      4 usermodmap=$XDG_CONFIG_HOME/X11/Xmodmap
      5 sysresources=/etc/X11/xinit/.Xresources
      6 sysmodmap=/etc/X11/xinit/.Xmodmap
      7 
      8 # merge in defaults and keymaps
      9 
     10 if [ -f $sysresources ]; then
     11     xrdb -merge $sysresources
     12 fi
     13 
     14 if [ -f $sysmodmap ]; then
     15     xmodmap $sysmodmap
     16 fi
     17 
     18 if [ -f "$userresources" ]; then
     19     xrdb -merge "$userresources"
     20 fi
     21 
     22 if [ -f "$usermodmap" ]; then
     23     xmodmap "$usermodmap"
     24 fi
     25 
     26 # start some nice programs
     27 
     28 if [ -d /etc/X11/xinit/xinitrc.d ] ; then
     29  for f in /etc/X11/xinit/xinitrc.d/?*.sh ; do
     30   [ -x "$f" ] && . "$f"
     31  done
     32  unset f
     33 fi
     34 
     35 if command -v xsetwacom 2>&1 >/dev/null; then
     36   penid=$(xsetwacom list devices | grep STYLUS | cut -f2 | cut -d' ' -f2)
     37   xsetwacom --set $penid Rotate half
     38   xsetwacom --set $penid Button 2 pan
     39   xsetwacom --set 10 MapToOutput DisplayPort-0
     40 fi
     41 
     42 if command -v slstatus &> /dev/null; then
     43     slstatus 2>&1 >/dev/null &
     44 else
     45     echo "Warning: slstatus does not exist!"
     46 fi
     47 
     48 if command -v dwm &> /dev/null; then
     49     while true; do
     50         dwm && continue || break
     51     done
     52 else
     53     echo "Error: dwm does not exist!"
     54     exit 1
     55 fi