#!/usr/bin/env bash #################### # Pre-config stuff # #################### pkill herbstclient pkill xfce4-panel pkill compton hc() { herbstclient "$@" } hc emit_hook reload nitrogen --restore hc keyunbind --all ############ # Keybinds # ############ Mod=Mod1 hc keybind $Mod-Shift-q spawn herbstclient quit hc keybind $Mod-Shift-r reload hc keybind $Mod-Shift-c close hc keybind $Mod-u split bottom 0.5 hc keybind $Mod-i split right 0.5 hc keybind $Mod-Control-space split explode hc keybind $Mod-p spawn dmenu_run -p "Run:" hc keybind $Mod-Shift-Return spawn termite -e ~/scripts/tmux/new-session.sh hc keybind Mod4-w spawn termite -e ~/scripts/weelaunch.sh hc keybind $Mod-F10 spawn /home/jake/scripts/nkjv/nkjv-menu.sh hc keybind $Mod-F11 spawn /home/jake/scripts/nkjv/nkjv-menu.sh md hc keybind $Mod-F12 spawn /home/jake/scripts/nkjv/nkjv-menu.sh marp hc keybind $Mod-F3 load "(split horizontal:0.625000:0 (clients max:0) (split vertical:0.500000:0 (clients max:0) (clients max:0)))" hc keybind $Mod-F4 load "(split vertical:0.500000:0 (split horizontal:0.500000:1 (clients max:0) (clients max:0)) (clients horizontal:0))" hc keybind $Mod-F5 cycle_value frame_gap 0 15 30 hc keybind $Mod-q chain . set_layout max . emit_hook focus_changed hc keybind $Mod-w chain . cycle_layout 1 vertical horizontal . emit_hook focus_changed hc keybind $Mod-e chain . set_layout grid . emit_hook focus_changed hc keybind $Mod-Left focus left hc keybind $Mod-Down focus down hc keybind $Mod-Up focus up hc keybind $Mod-Right focus right hc keybind $Mod-h focus left hc keybind $Mod-j focus down hc keybind $Mod-k focus up hc keybind $Mod-l focus right # Taken from https://herbstluftwm.org/faq.html # Allows windows to cross monitor boundaries hc keybind $Mod-Shift-h or / shift left / \ chain , lock , shift_to_monitor -l , focus_monitor -l , unlock hc keybind $Mod-Shift-j or / shift down / \ chain , lock , shift_to_monitor -d , focus_monitor -d , unlock hc keybind $Mod-Shift-k or / shift up / \ chain , lock , shift_to_monitor -u , focus_monitor -u , unlock hc keybind $Mod-Shift-l or / shift right / \ chain , lock , shift_to_monitor -r , focus_monitor -r , unlock resizestep=0.025 hc keybind $Mod-Control-h resize left +$resizestep hc keybind $Mod-Control-j resize down +$resizestep hc keybind $Mod-Control-k resize up +$resizestep hc keybind $Mod-Control-l resize right +$resizestep hc keybind $Mod-Control-Left resize left +$resizestep hc keybind $Mod-Control-Down resize down +$resizestep hc keybind $Mod-Control-Up resize up +$resizestep hc keybind $Mod-Control-Right resize right +$resizestep tag_names=( {1..4} ) tag_keys=( {1..4} 0 ) hc rename default "${tag_names[0]}" || true for i in ${!tag_names[@]} ; do hc add "${tag_names[$i]}" key="${tag_keys[$i]}" if ! [ -z "$key" ] ; then hc keybind "$Mod-$key" use_index "$i" hc keybind "$Mod-Shift-$key" move_index "$i" fi done hc keybind $Mod-period use_index +1 --skip-visible hc keybind $Mod-comma use_index -1 --skip-visible hc keybind $Mod-c remove hc keybind $Mod-t floating toggle hc keybind $Mod-m fullscreen toggle hc keybind $Mod-f pseudotile toggle hc mouseunbind --all hc mousebind $Mod-Button1 move hc mousebind $Mod-Button2 zoom hc mousebind $Mod-Button3 resize hc keybind $Mod-BackSpace cycle_monitor hc keybind $Mod-Tab cycle hc keybind $Mod-Shift-Tab cycle_all -1 ############ # Settings # ############ hc attr theme.tiling.reset 1 hc attr theme.floating.reset 1 # source ~/.config/herbstluftwm/themes/archlabs.sh source ~/.config/herbstluftwm/themes/minty.sh # source ~/.config/herbstluftwm/themes/futura.sh # source ~/.config/herbstluftwm/themes/papercolor.sh ######### # Rules # ######### hc unrule -F hc rule 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 ################## # Monitor Config # ################## # hc pad 0 26 0 0 0 # polybar hc pad 0 0 0 26 0 # polybar bottom # hc pad 0 0 40 0 0 # xfce4-panel hc unlock hc spawn /home/jake/.config/polybar/launch.sh hlwm & # hc spawn xfce4-panel & hc spawn /home/jake/.config/herbstluftwm/check_for_vga.sh & compton & ######### # Hooks # ######### herbstclient -i focus_changed | \ while read hook name winid do case $hook in focus_changed) \ tag=$(herbstclient list_monitors | grep "FOCUS" | cut -d' ' -f5 | sed "s/\"//g") hc set frame_border_active_color '#819a67' [[ -n $(herbstclient layout | grep "FOCUS" | grep "max") ]] && herbstclient compare tags.by-name.$tag.curframe_wcount gt 1 && hc set frame_border_active_color '#a95282' & esac done