#!/bin/sh
cfgpath="${HOME}/.config"
sgestures-libinput-writer &
ln -sf $(stat -c %n ${cfgpath}/wallpaper/* | shuf -n 1) ${cfgpath}/bg.jpg
catch-gesture-hook.sh & 
catch-xlunch-hook.sh &

# two space indent for xlunch entries or xlunch segfaults
{
cat <<- EOF
  Audio;${cfgpath}/icons/audio.png;herbstclient emit_hook xlunch audio
  Video;${cfgpath}/icons/video.png;herbstclient emit_hook xlunch video
  Web;${cfgpath}/icons/www.png;herbstclient emit_hook xlunch www
  Terminal;${cfgpath}/icons/terminal.png;herbstclient emit_hook xlunch terminal
EOF
} | xlunch \
	--background ${cfgpath}/bg.jpg \
	--border auto \
	--columns 4 \
	--desktop \
	--dontquit \
	--font OpenSans-Regular/16 \
	--highlightcolor ffffff32 \
	--iconsize 100 \
	--noprompt \
	--rows 1 \
	--sideborder 25% \
	--textcolor ffffffff \
	--textpadding 10 &

exec herbstluftwm
