aboutsummaryrefslogtreecommitdiff
path: root/.config/waybar/scripts/layout.sh
diff options
context:
space:
mode:
authorJustine Smithies <justine@smithies.me.uk>2026-06-13 13:05:51 +0100
committerJustine Smithies <justine@smithies.me.uk>2026-06-13 13:05:51 +0100
commitcbe745e93e530f5e1ef3b95c9724ad70b9c95a9f (patch)
tree7555b797ea1affcdc9ffd47c7b5cb9136305851e /.config/waybar/scripts/layout.sh
parent2be648b5e7921aca0b4b6ea5a64ed1dad6c96fe9 (diff)
Updated to use new MangoWM IPC mmsg
Diffstat (limited to '.config/waybar/scripts/layout.sh')
-rwxr-xr-x.config/waybar/scripts/layout.sh6
1 files changed, 3 insertions, 3 deletions
diff --git a/.config/waybar/scripts/layout.sh b/.config/waybar/scripts/layout.sh
index f7c7691..eef873a 100755
--- a/.config/waybar/scripts/layout.sh
+++ b/.config/waybar/scripts/layout.sh
@@ -1,14 +1,14 @@
#!/bin/sh
# Get focused output
-output="$(mmsg -g | grep "selmon 1" | awk '{print$1}')"
+output="$(mmsg get all-monitors | jq -r '.monitors[] | select(.active == true) | .name')"
case $1 in
toggle)
- mmsg -d switch_layout
+ mmsg dispatch switch_layout
;;
*)
- text=$(mmsg -g | grep " layout" | sort -t: -k2,2nr -r | awk '{ print $3 }' FS=' ')
+ text=$(mmsg get all-monitors | jq -r '.monitors[] | .layout_symbol')
echo "{\"text\":\""$text"\", \"tooltip\":\""$tooltip"\"}"
;;
esac