aboutsummaryrefslogtreecommitdiff
path: root/roles/home/desktop/eww/panels/volume.yuck
diff options
context:
space:
mode:
authorCaroline Larimore <caroline@larimo.re>2024-09-17 21:37:33 -0700
committerCaroline Larimore <caroline@larimo.re>2024-09-17 21:37:33 -0700
commit6bc6e37af5b21b0356d0e008f83eee5378fc8b43 (patch)
tree0fd4e2fdf9ddd1937b3a02de57d11e4ff1ade6fc /roles/home/desktop/eww/panels/volume.yuck
parent485dc4b641f6b07def1bfa28c7c3ab83e764f29e (diff)
home: desktop: update eww widgets
Diffstat (limited to 'roles/home/desktop/eww/panels/volume.yuck')
-rw-r--r--roles/home/desktop/eww/panels/volume.yuck40
1 files changed, 40 insertions, 0 deletions
diff --git a/roles/home/desktop/eww/panels/volume.yuck b/roles/home/desktop/eww/panels/volume.yuck
new file mode 100644
index 0000000..0c342c3
--- /dev/null
+++ b/roles/home/desktop/eww/panels/volume.yuck
@@ -0,0 +1,40 @@
+(defwidget volume []
+ (box :class "volume panel"
+ :orientation "v"
+ :space-evenly false
+
+ (label :markup "<b>Volume</b>")
+
+ (box
+ :orientation "h"
+ :vexpand true
+
+ (box
+ :orientation "v"
+ :space-evenly false
+ :vexpand true
+
+ (scale
+ :orientation "v"
+ :flipped true
+ :value {sink-volume}
+ :max 101
+ :onchange `pactl set-sink-volume @DEFAULT_SINK@ {}%`
+ :vexpand true
+ )
+
+ {sink-volume + "%"}
+ )
+ )
+ )
+)
+
+(defpoll sink-volume
+ :interval "0.2s"
+ `pactl get-sink-volume @DEFAULT_SINK@ | head -n1 | awk '{print substr($5, 1, length($5)-1)}'`
+)
+
+;(defpoll source-volume
+; :interval "0.2s"
+; `pactl get-source-volume @DEFAULT_SOURCE@ | head -n1 | awk '{print substr($5, 1, length($5)-1)}'`
+;)