#!/usr/bin/env sh setup_monitors () { if [ "$(bspc query -M | wc -l)" -eq "2" ]; then bspc monitor ^1 -d 1 2 3 4 5 bspc monitor ^2 -d 1 2 3 4 5 else bspc monitor ^1 -d 1 2 3 4 5 fi } bspc config border_width 3 bspc config window_gap 0 bspc config -m ^1 top_padding 28 bspc config split_ratio 0.55 bspc config focus_follows_pointer true bspc config focused_border_color '#ffffff' # bspc config pointer_follows_focus true bspc config automatic_scheme spiral bspc config initial_polarity first_child bspc config pointer_follows_monitor true bspc config remove_disabled_monitors true bspc config remove_unplugged_monitors true bspc config borderless_monocle true bspc config gapless_monocle true bspc config external_rules_command "$HOME/.config/bspwm/external-rules.sh" bspc rule -a Gimp state=floating follow=on bspc rule -a mplayer2 state=floating bspc rule -a '*:pop-up' state=floating sticky=on bspc rule -a Kupfer.py focus=on bspc rule -a Screenkey manage=off setup_monitors ps -C bspc -o cmd,user,pid | grep "${USER:0:7}" | awk '/bspc subscribe report/ {print $(NF)}' | xargs kill bspc subscribe report > "$STATUS_BAR_FIFO" & # ps -C bspc -o cmd,pid | awk '/bspc subscribe/ {print $(NF)}' | xargs kill # bspc subscribe node_{remove,add} | while read _; do sh $HOME/.config/bspwm/stack-layout.sh; done # bash -c 'bspc subscribe node_{add,remove} | while read _; do sh $HOME/.config/bspwm/equalize.sh; done' ps -C bspc -o cmd,user,pid | grep "${USER:0:7}" | awk '/bspc subscribe monitor/ {print $(NF)}' | xargs kill bspc subscribe monitor | while read -r line; do case $line in monitor_add*|monitor_geometry*) setup_monitors;; *) ;; esac done & # ps -C bspc -o cmd,user,pid | grep "${USER:0:7}" | awk '/bspc subscribe node_add/ {print $(NF)}' | xargs kill # bspc subscribe node_add | while read -r line; do # nodes="$(bspc query -N -n '.leaf.!floating.!hidden' -d .focused | wc -l)" # if (( nodes > 3 )); then # smallest="$(bspc query -N -n '@/2/2/2/brother' -d .focused)" # bspc node "$smallest" -g hidden # fi # done & # ps -C bspc -o cmd,user,pid | grep "${USER:0:7}" | awk '/bspc subscribe node_remove/ {print $(NF)}' | xargs kill # bspc subscribe node_remove | while read -r line; do # nodes="$(bspc query -N -n '.leaf.!floating.!hidden' -d .focused | wc -l)" # if (( nodes < 3 )); then # hidden_node=`bspc query -N -n 'any.leaf.hidden' -d .focused` # bspc node $hidden_node -g hidden=off # fi # done & if [ -d $XDG_DATA_HOME/autoload.d ]; then for f in $XDG_DATA_HOME/autoload.d/*; do [ -x "$f" ] && . "$f" done unset f fi