dotfiles

My collection of dotfiles
git clone git://git.noxz.tech/dotfiles
Log | Files | Refs

xinitrc (1871B)


      1 #!/bin/sh
      2 
      3 # only support for dwm implemented
      4 [ "$1" != "dwm" ] && exit
      5 
      6 userresources="$XDG_CONFIG_HOME"/X11/xresources
      7 usermodmap="$XDG_CONFIG_HOME"/X11/xmodmap
      8 sysresources=/etc/X11/xinit/.Xresources
      9 sysmodmap=/etc/X11/xinit/.Xmodmap
     10 
     11 # merge in defaults and keymaps
     12 [ -f "$sysresources"    ] && xrdb -merge "$sysresources"
     13 [ -f "$sysmodmap"       ] && xmodmap "$sysmodmap"
     14 [ -f "$userresources"   ] && xrdb -merge "$userresources"
     15 [ -f "$usermodmap"      ] && xmodmap "$usermodmap"
     16 
     17 # Disable terminal console beep
     18 xset b off
     19 
     20 # Remap caps lock to escape and use US international keyboard
     21 setxkbmap                               \
     22 	-layout us                          \
     23 	-variant altgr-intl                 \
     24 	-option caps:escape
     25 
     26 # Enable and set alsa options
     27 amixer sset "Capture"               "70%"
     28 amixer sset "Digital"               "60%"
     29 amixer sset "Dock Mic Boost"        "50%"
     30 amixer sset "Internal Mic Boost"    "50%"
     31 
     32 # Disable screen saving
     33 xset s off -dpms
     34 
     35 # Start unclutter (hide cursor after 5 seconds of idle time)
     36 unclutter -idle 5 &
     37 
     38 # dwm specific executions (yeah, kinda redundant but future proof)
     39 case "$1" in
     40 dwm)
     41 	# setup monitor
     42 	"$HOME"/.local/bin/monitor setup
     43 
     44 	# set wallpaper
     45 	[ -f "$XDG_CONFIG_HOME/wallpaper.ff.gz" ] \
     46 		&& cp "$XDG_CONFIG_HOME/wallpaper.ff.gz" /tmp/wallpaper.ff.gz \
     47 		&& swall /tmp/wallpaper.ff.gz
     48 
     49 	# start daemons
     50 	[ ! $(pidof -x monitor-daemon)  ] && "$HOME"/.local/bin/monitor daemon &
     51 	[ ! $(pidof -x mpvd)            ] && "$HOME"/.local/bin/mpvd &
     52 
     53 	# start prerequisites
     54 	[ ! $(pidof -x listen-new-mail) ] && "$HOME/.local/bin/listen-new-mail" &
     55 	[ ! $(pidof -x listen-new-pkg) ] && "$HOME/.local/bin/listen-new-pkg" &
     56 	[ ! $(pidof -x ztatus) ] && sh -c 'sleep .5; /usr/local/bin/ztatus' &
     57 
     58 	# start sxhkd (Simple X hotkey daemon)
     59 	sxhkd &
     60 
     61 	# ...and finally, start dwm
     62 	"$HOME"/.local/bin/dwm-run
     63 	;;
     64 esac