aboutsummaryrefslogtreecommitdiff
path: root/.config/waybar/scripts/layout.sh
diff options
context:
space:
mode:
authorJustine Smithies <justine@smithies.me.uk>2026-04-15 11:34:34 +0100
committerJustine Smithies <justine@smithies.me.uk>2026-04-15 11:34:34 +0100
commit5c242d4edf60a88dd630d9eb6824b7c091eb840c (patch)
treedc68270cfaed7eef2fa45b0559733d4fac6f4ab3 /.config/waybar/scripts/layout.sh
parentf778140e1b85f42ace17b3f51d6dac4c8ce09ff6 (diff)
Initial commit for running mango ( Wayland ) on OpenBSD
Diffstat (limited to '.config/waybar/scripts/layout.sh')
-rwxr-xr-x.config/waybar/scripts/layout.sh14
1 files changed, 14 insertions, 0 deletions
diff --git a/.config/waybar/scripts/layout.sh b/.config/waybar/scripts/layout.sh
new file mode 100755
index 0000000..f7c7691
--- /dev/null
+++ b/.config/waybar/scripts/layout.sh
@@ -0,0 +1,14 @@
+#!/bin/sh
+
+# Get focused output
+output="$(mmsg -g | grep "selmon 1" | awk '{print$1}')"
+
+case $1 in
+ toggle)
+ mmsg -d switch_layout
+ ;;
+ *)
+ text=$(mmsg -g | grep " layout" | sort -t: -k2,2nr -r | awk '{ print $3 }' FS=' ')
+ echo "{\"text\":\""$text"\", \"tooltip\":\""$tooltip"\"}"
+ ;;
+esac