figs/.config/herbstluftwm/autostart
2021-04-16 05:36:00 -05:00

95 lines
2.9 KiB
Bash
Executable file

#!/usr/bin/env bash
hc() {
herbstclient "$@"
}
hc emit_hook reload
hc keyunbind --all
hc mouseunbind --all
hc unrule -F
Mod=Mod4
emacs_proc="ps -aux | grep 'emacs --bg-daemon' | sed '/grep --colour/d"
resizestep=0.05
screenshot="$HOME/bin/screenshot.sh"
tag_names=( {1..9} )
tag_keys=( {1..9} 0 )
term="sakura"
hc keybind $Mod-r reload
hc keybind $Mod-e close
hc keybind $Mod-Return spawn ${term}
hc keybind $Mod-d spawn dmenu_run
hc keybind $Mod-Print spawn ${screenshot}
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-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
hc keybind $Mod-u split bottom 0.5
hc keybind $Mod-o split right 0.5
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 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-Shift-r remove
hc keybind $Mod-s floating toggle
hc keybind $Mod-f fullscreen toggle
hc keybind $Mod-p pseudotile toggle
hc keybind $Mod-Shift-space attr clients.focus.floating toggle
hc keybind $Mod-space \
or , and . compare tags.focus.curframe_wcount = 2 \
. cycle_layout +1 vertical horizontal max vertical grid \
, cycle_layout +1
hc mousebind $Mod-Button1 move
hc mousebind $Mod-Button3 resize
hc keybind $Mod-Tab cycle_all +1
hc keybind $Mod-Shift-Tab cycle_all -1
hc keybind $Mod-c cycle
hc keybind $Mod-i jumpto urgent
hc pad 0 4 4 36 4
hc set window_gap 1
hc set frame_gap 1
hc set frame_bg_transparent 1
hc attr theme.floating.reset 1
hc attr theme.floating.border_width 3
hc attr theme.floating.outer_width 2
hc attr theme.floating.outer_color '#fefefe'
hc rule class=sakura tag=4
hc rule focus=on
hc rule windowtype~'_NET_WM_WINDOW_TYPE_(DIALOG|UTILITY|SPLASH)' floating=on
hc rule windowtype='_NET_WM_WINDOW_TYPE_DIALOG' focus=on
hc rule windowtype~'_NET_WM_WINDOW_TYPE_(NOTIFICATION|DOCK|DESKTOP)' manage=off
hc set tree_style '╾│ ├└╼─┐'
hc unlock
feh --bg-scale ~/bg/wall_2.jpg &
if [ ! $(pidof dunst) ]; then
dunst & dunstify -t '2500' 'dunst started!'
if [ ! $(emacs_proc) ]; then
emacs --bg-daemon & dunstify -t '3000' 'emacs daemon started!'
fi
fi