Skip to content

Instantly share code, notes, and snippets.

Created July 6, 2023 18:54
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
Herbstluft :)
if [ "$*" = "headphones" ]
pacmd set-default-sink "alsa_output.usb-Corsa_ir_Components_Inc._Corsair_ST100_Headset_Outpu_t_v0.6-00.analog-stereo"
notify-send "Headphone Output"
elif [ "$*" = "speaker" ]
pacmd set-default-sink "$(pacmd list | rg HiFi | rg alsa | rg p__sink | head -n1 | awk '{ print $2 }')"
notify-send "Speaker Output"
elif [ "$*" = "play-pause" ]
emacsclient -e "(emms-pause)"
playerctl play-pause
elif [ "$*" = "volume-up" ]
amixer -D pulse sset Master 5%+
elif [ "$*" = "volume-down" ]
amixer -D pulse sset Master 5%-
elif [ "$*" = "toggle-mute" ]
amixer -D pulse sset Master toggle-mute
notify-send "Please supply an argument!"
#!/usr/bin/env bash
hc() {
herbstclient "$@"
hc spawn feh --bg-scale /home/ccf/.config/wallpaper.png
hc spawn emacs --daemon
hc spawn /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 # Launch gnome polkit (Apps might break if this isnt here)
hc spawn setxkbmap -option compose:menu # Set the menu button to be the compose key (ñ)
hc spawn picom --experimental-backends
# EWW (Elkowar's Wacky Widgets)
hc spawn eww daemon
hc spawn eww open sidebar
hc spawn killall trayer
hc spawn trayer --edge left --monitor primary --width 8 --align right --distancefrom bottom,left --distance 182,9 --tint 0x292929 --transparent true --alpha 0 --padding 5
# Keybinds
source /home/ccf/.config/herbstluftwm/keybinds
# Scratch
hc rule class='scratch' floating=on
hc rule class='Dragon-drop' floating=on
# default tag thing but with 6 only
tag_names=( {1..6} )
tag_keys=( {1..6} 0 )
hc rename default "${tag_names[0]}" || true
for i in "${!tag_names[@]}" ; do
hc add "${tag_names[$i]}"
if [ -n "$key" ] ; then
hc keybind "$Mod-$key" use_index "$i"
hc keybind "$Mod-Shift-$key" move_index "$i"
# Default Layout
hc set_attr settings.default_frame_layout grid
# Special Tags ( teamspeak & YouTube )
# hc add teamspeak
# hc add youtube
# School (Tag 2)
# herbstclient load 2 '(split horizontal:0.75:0.25 (clients max:0) (clients max:4))' #comment out when summer
# Theme
## Border
hc attr theme.border_width 3
hc attr theme.outer_width 3
hc attr '#ffdd33'
hc attr theme.normal.outer_color '#181818'
## Title
hc attr theme.title_height 24
hc attr theme.title_when always
hc attr '#181818'
hc attr theme.normal.color '#181818'
hc attr theme.title_color '#e4e4ef'
hc attr theme.title_align center
hc attr theme.title_font 'Jetbrains Mono:pixelsize=14'
hc attr theme.title_depth 6
## Frame Settings
hc set frame_bg_transparent on
hc set frame_padding 0
hc set frame_border_width 0
## Window Settings
hc set window_gap 12
hc set frame_gap 0
hc set update_dragged_clients 1
hc rule focus=on
hc rule floatplacement=center
hc detect_monitors
# unlock
hc unlock
#!/usr/bin/env bash
hc keyunbind --all # Remove prior keybinds
# Emotes
hc keybind $Mod-Shift-s spawn , "shrug"
# Window Management
hc keybind $Mod-q close
hc set swap_monitors_to_get_tag 0
## Focus
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-BackSpace cycle_monitor +1
hc keybind $Mod-Delete cycle_monitor -1
hc keybind $Mod-Tab cycle_all +1
hc keybind $Mod-Shift-Tab cycle_all -1
hc keybind $Mod-i jumpto urgent
## Window Movement
hc keybind $Mod-Shift-Left shift left
hc keybind $Mod-Shift-Down shift down
hc keybind $Mod-Shift-Up shift up
hc keybind $Mod-Shift-Right shift right
## Frame Splitting
hc keybind $Mod-u split bottom 0.5
hc keybind $Mod-o split right 0.5
## Window Resizing
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
hc keybind $Mod-Control-space split explode # let the current frame explode into subframes
## Layouting
hc keybind $Mod-r remove
hc keybind $Mod-s floating toggle
hc keybind F11 fullscreen toggle
hc keybind $Mod-Shift-f set_attr clients.focus.floating toggle
hc keybind $Mod-Shift-d set_attr clients.focus.decorated toggle
hc keybind $Mod-z set_attr clients.focus.minimized true
hc keybind $Mod-Control-m jumpto last-minimized
hc keybind $Mod-p pseudotile toggle
hc keybind $Mod-space cycle_layout +1 # Cycle States Forwards
hc keybind $Mod-Shift-space cycle_layout -1 # Cycle States Backwards
# WM Reload / Quit
hc keybind $Mod-Shift-q quit
hc keybind $Mod-Shift-r reload
# System Utils
hc keybind $Mod-l spawn betterlockscreen -l dimblur
hc keybind $Mod-Shift-h spawn /home/ccf/.local/bin/,clear-clip
hc keybind $Mod-Shift-o spawn /home/ccf/.config/herbstluftwm/
# shellcheck disable=SC2016,SC2140
hc keybind Print spawn scrot -f -l style=solid,width=2,color="#ffdd33",mode="classic" -s '/home/ccf/Pictures/scrot/%Y-%m-%d_$wx$h.png' -e 'optipng $f' -e 'xclip -sel clip -t image/png -i $f'
hc keybind $Mod-Print spawn scrot -a 1920,0,1920,1080 '/home/ccf/Pictures/scrot/%Y-%m-%d_FULLSCREEN.png' -e 'optipng $f' -e 'xclip -sel clip -t image/png -i $f'
hc keybind $Mod-Shift-c spawn /home/ccf/.local/bin/,
hc keybind $Mod-Shift-p spawn /home/ccf/.config/picom/
## Audio
hc keybind $Mod-Shift-Control-h spawn /home/ccf/.config/herbstluftwm/ "headphones"
hc keybind $Mod-Shift-Control-s spawn /home/ccf/.config/herbstluftwm/ "speaker"
hc keybind XF86AudioPlay spawn /home/ccf/.config/herbstluftwm/ "play-pause"
hc keybind XF86AudioRaiseVolume spawn /home/ccf/.config/herbstluftwm/ "volume-up"
hc keybind XF86AudioLowerVolume spawn /home/ccf/.config/herbstluftwm/ "volume-down"
hc keybind XF86AudioMute spawn /home/ccf/.config/herbstluftwm/ "toggle-mute"
## Rofi
hc keybind $Mod-d spawn rofi -show drun
hc keybind $Mod-w spawn rofi -show window
hc keybind $Mod-f spawn rofi -show filebrowser
hc keybind $Mod-c spawn rofi -show calc -no-show-match -no-sort -terse
# Programs
hc keybind $Mod-Return spawn /home/ccf/.cargo/bin/alacritty
hc keybind $Mod-Shift-Return spawn /home/ccf/.cargo/bin/alacritty --class='scratch,scratch' -t "*alacritty-scratch*"
hc keybind $Mod-b spawn firefox
hc keybind $Mod-e spawn emacsclient -c
# Mousebinds
hc mouseunbind --all
hc mousebind $Mod-Button1 move
hc mousebind $Mod-Button2 zoom
hc mousebind $Mod-Button3 resize
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment