diff options
Diffstat (limited to 'modules/image')
| -rw-r--r-- | modules/image/idle_inhibitor.jsonc | 15 | ||||
| -rw-r--r-- | modules/image/language.jsonc | 18 | ||||
| -rw-r--r-- | modules/image/volume.jsonc | 44 |
3 files changed, 77 insertions, 0 deletions
diff --git a/modules/image/idle_inhibitor.jsonc b/modules/image/idle_inhibitor.jsonc new file mode 100644 index 0000000..e026be8 --- /dev/null +++ b/modules/image/idle_inhibitor.jsonc @@ -0,0 +1,15 @@ +// Presentation mode. +// +// waybar's own idle_inhibitor module draws its state with format-icons, which +// is text, so this is an `image` module driving the same inhibitor through +// hyprland. The state lives in a file because the icon has to be resolved by +// a separate process from the one that toggles it. +{ + "image#idle": { + "exec": "$HOME/bin/wb-idle status", + "size": 22, + "interval": 5, + "signal": 9, + "on-click": "$HOME/bin/wb-idle toggle" + } +} diff --git a/modules/image/language.jsonc b/modules/image/language.jsonc new file mode 100644 index 0000000..48343b7 --- /dev/null +++ b/modules/image/language.jsonc @@ -0,0 +1,18 @@ +// Keyboard layout, drawn as a flag. +// +// This is an `image` module rather than hyprland/language, because that module +// styles as #language and nothing else: it has no per-language CSS class, so a +// flag cannot be picked by a selector, and its format-<lang> takes text rather +// than a path. wb-lang reads the layout from hyprctl and prints the flag. +// +// The two flags are shipped by this repo: the icon theme has 13 and neither +// Italian nor British is among them. +{ + "image#lang": { + "exec": "$HOME/bin/wb-lang", + "size": 20, + "interval": 2, + "signal": 10, + "tooltip": true + } +} diff --git a/modules/image/volume.jsonc b/modules/image/volume.jsonc new file mode 100644 index 0000000..1788643 --- /dev/null +++ b/modules/image/volume.jsonc @@ -0,0 +1,44 @@ +// Volume, as a drawer: the output icon is always visible and the microphone +// slides out on hover, the same shape as the current bar's wireplumber group. +// +// These are `image` modules rather than wireplumber ones because wireplumber +// draws its state with format-icons, which is text. `image` runs a command and +// reads a path, so wb-icon resolves the state to a themed icon instead. The +// cost is that the percentage is in the tooltip rather than on the bar, which +// is the trade an icons-only bar makes. +// +// signal 8 is raised by volume.sh after every change, so the icon updates on +// the keypress rather than up to two seconds later. +{ + "group/volume": { + "orientation": "horizontal", + "modules": [ + "image#volume", + "image#mic" + ], + "drawer": { + "transition-left-to-right": false + } + }, + + "image#volume": { + "exec": "$HOME/bin/wb-icon volume", + "size": 22, + "interval": 2, + "signal": 8, + "on-click": "$HOME/.config/waybar/scripts/volume.sh output mute", + "on-click-right": "pavucontrol-qt", + "on-scroll-up": "$HOME/.config/waybar/scripts/volume.sh output raise", + "on-scroll-down": "$HOME/.config/waybar/scripts/volume.sh output lower" + }, + + "image#mic": { + "exec": "$HOME/bin/wb-icon mic", + "size": 22, + "interval": 2, + "signal": 8, + "on-click": "$HOME/.config/waybar/scripts/volume.sh input mute", + "on-scroll-up": "$HOME/.config/waybar/scripts/volume.sh input raise", + "on-scroll-down": "$HOME/.config/waybar/scripts/volume.sh input lower" + } +} |
