Last active
June 18, 2020 04:42
-
-
Save SidharthArya/0a934fa45e8fe3c2a5cdd0a3e32ee25a to your computer and use it in GitHub Desktop.
Xmonad like Monitor for Bspwm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
MONITORS="$(bspc query -M --names)" | |
ARG1="$1" | |
FOCUSED_MONITOR="$(bspc query --names -M -m focused)" | |
for monitr in $MONITORS | |
do | |
FOCUSED="$(bspc query --names -D -d $monitr:focused)" | |
if [[ "$FOCUSED" == "$ARG1" ]]; | |
then | |
MONITOR="$monitr" | |
fi | |
done | |
if [[ "$MONITOR" == "" ]]; | |
then | |
bspc desktop "$ARG1" -m focused | |
bspc desktop "$ARG1" -f | |
else | |
FOCUSED_DESKTOP="$(bspc query --names -D -d focused)" | |
bspc desktop "$FOCUSED_DESKTOP" -m "$MONITOR" | |
bspc desktop "$ARG1" -m "$FOCUSED_MONITOR" | |
bspc desktop "$FOCUSED_DESKTOP" -f | |
bspc desktop "$ARG1" -f | |
fi | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
super + {1-9,0} | |
~/.config/sxhkd/scripts/desktop.sh {1-9,0} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment