Skip to content

Instantly share code, notes, and snippets.

@danielcbaldwin
Created September 22, 2016 19:27
Show Gist options
  • Star 13 You must be signed in to star a gist
  • Fork 5 You must be signed in to fork a gist
  • Save danielcbaldwin/3b146824f12355e5bac7e4102ab483c7 to your computer and use it in GitHub Desktop.
Save danielcbaldwin/3b146824f12355e5bac7e4102ab483c7 to your computer and use it in GitHub Desktop.
bspc subscribe monitor | while read -r line; do
case $line in
monitor_add*|monitor_geometry*)
if [ "$(bspc query -M | wc -l)" -eq "3" ]; then
bspc monitor $(bspc query -M | sed -n 1p) -d 00 03
bspc monitor $(bspc query -M | sed -n 2p) -d 01 04
bspc monitor $(bspc query -M | sed -n 3p) -d 02 05
elif [ "$(bspc query -M | wc -l)" -eq "2" ]; then
bspc monitor $(bspc query -M | sed -n 1p) -d 00 02 04
bspc monitor $(bspc query -M | sed -n 2p) -d 01 03 05
else
bspc monitor -d 00 01 02 03 04 05
fi
;;
*)
;;
esac
done &
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment