aboutsummaryrefslogtreecommitdiffstats
path: root/modules/image/volume.jsonc
diff options
context:
space:
mode:
Diffstat (limited to 'modules/image/volume.jsonc')
-rw-r--r--modules/image/volume.jsonc44
1 files changed, 44 insertions, 0 deletions
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"
+ }
+}