diff options
Diffstat (limited to '.config')
-rw-r--r-- | .config/waybar/config | 10 | ||||
-rwxr-xr-x | .config/waybar/scripts/layout.sh | 14 | ||||
-rw-r--r-- | .config/waybar/style.css | 9 |
3 files changed, 33 insertions, 0 deletions
diff --git a/.config/waybar/config b/.config/waybar/config index ad3478b..7853f33 100644 --- a/.config/waybar/config +++ b/.config/waybar/config @@ -8,6 +8,7 @@ "modules-left": [ "dwl/tags", + "custom/layout", "dwl/window", ], @@ -32,6 +33,15 @@ "max-length": 100, }, + "custom/layout": { + "format": "<span color='#202020' bgcolor='#d79921'> </span> {}", + "return-type": "json", + "exec": "~/.config/waybar/scripts/layout.sh", + "on-click": "~/.config/waybar/scripts/layout.sh toggle", + "interval" : 1, + "tooltip" : false + }, + "custom/scratchpad-indicator": { "format": "<span color='#202020' bgcolor='#8ec07c' > </span> {}", "return-type": "json", 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 diff --git a/.config/waybar/style.css b/.config/waybar/style.css index 923d175..3291419 100644 --- a/.config/waybar/style.css +++ b/.config/waybar/style.css @@ -39,6 +39,7 @@ window#waybar.hidden { #window, #idle_inhibitor, #language, +#custom-layout, #custom-scratchpad-indicator, #custom-brightness, #custom-memory, @@ -58,6 +59,7 @@ window#waybar.hidden { #window, #idle_inhibitor, #language, +#custom-layout, #custom-scratchpad-indicator, #custom-brightness, #custom-memory, @@ -162,6 +164,13 @@ window#waybar.empty #window { color: #d79921; } +/* ================================ */ +/* custom-layout */ +/* ================================ */ +#custom-layout { + color: #d79921; +} + /*================================= */ /* custom-scratchpad-indicator */ /*==================================*/ |