diff options
author | Justine Smithies <justine@smithies.me.uk> | 2025-06-18 19:52:52 +0100 |
---|---|---|
committer | Justine Smithies <justine@smithies.me.uk> | 2025-06-18 19:52:52 +0100 |
commit | 1f9f2fdf8c9f96ca260e44184807ece53ca26d45 (patch) | |
tree | 4d5d6e68f3521a40617261552c4d6eeb0dcdd9f2 /.config/waybar/scripts | |
parent | 2cb73260f70b083cdcf0c7f2c297044e5a405139 (diff) |
Diffstat (limited to '.config/waybar/scripts')
-rwxr-xr-x | .config/waybar/scripts/layout.sh | 14 |
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..997d837 --- /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 | awk '{ print $3 }' FS=' ') + echo "{\"text\":\""$text"\", \"tooltip\":\""$tooltip"\"}" + ;; +esac |