Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save josephsdavid/9a5d4310f088a1214b7a93800f7cb670 to your computer and use it in GitHub Desktop.
Save josephsdavid/9a5d4310f088a1214b7a93800f7cb670 to your computer and use it in GitHub Desktop.
autostart for hlwm
#!/usr/bin/env bash
###############################################################################
# _ _ _ _ __ _ #
# | |__ ___ _ __| |__ ___| |_| |_ _ / _| |_ _ _ _ __ ___ #
# | '_ \ / _ \ '__| '_ \/ __| __| | | | | |_| __| \ /\ / | '_ ` _ \ #
# | | | | __/ | | |_) \__ \ |_| | |_| | _| |_ \ V V /| | | | | | #
# |_| |_|\___|_| |_.__/|___/\__|_|\__,_|_| \__| \_/\_/ |_| |_| |_| #
# #
###############################################################################
# Initialise {{{
#------------------------------------------------------------------------------
hc() {
herbstclient "$@"
}
hc emit_hook reload
# Clear dmenu cache, needed for nixos
rm ~/.cache/dmenu_run
hc lock
#Keybindings
hc keyunbind --all
. ~/.config/herbstluftwm/keybinds
#theming
. ~/.config/herbstluftwm/theme
# rules
hc unrule -F
#hc rule class=XTerm tag=3 # move all xterms to tag 3
hc rule focus=on # normally focus new clients
# give focus to most common terminals
#hc rule class~'(.*[Rr]xvt.*|.*[Tt]erm|Konsole)' focus=on
hc rule windowtype~'_NET_WM_WINDOW_TYPE_(DIALOG|UTILITY|SPLASH)' pseudotile=on
hc rule windowtype='_NET_WM_WINDOW_TYPE_DIALOG' focus=on
hc rule windowtype~'_NET_WM_WINDOW_TYPE_(NOTIFICATION|DOCK|DESKTOP)' manage=off
hc unlock
hc detect_monitors
# panel
# find the panel
nmon=$(herbstclient list_monitors | wc -l)
if [ $nmon = "1" ]; then
panel=~/.config/herbstluftwm/lemonpanel.sh
else
panel=~/.config/herbstluftwm/dzenpanel.sh
fi
[ -x "$panel" ] || panel=/etc/xdg/herbstluftwm/panel.sh
for monitor in $(herbstclient list_monitors | cut -d: -f1) ; do
# start it on each monitor
# monitor=0
"$panel" $monitor &
done
xset s off -dpms
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment