eww: Add interactibles for vol, mic, and brightness

This commit is contained in:
stitchy 2024-11-29 10:03:29 +00:00
parent d249ab216f
commit a90cb37e69
Signed by: stitchy
SSH key fingerprint: SHA256:yz2SoxdnY67tfY5Jzb0f2v8f5W3o/IF359kbcquWip8

View file

@ -57,16 +57,22 @@
:char "󱐋")) :char "󱐋"))
(defwidget volume [] (defwidget volume []
(eventbox
:onclick "hyprctl dispatch exec 'pavucontrol -t 3'"
:onscroll "if [ {} == 'up' ]; then /etc/nixos/config/dunst/scripts/volumeNotify.sh 1%+; else /etc/nixos/config/dunst/scripts/volumeNotify.sh 1%-; fi"
(circle :prog {vol * 7/10} (circle :prog {vol * 7/10}
:sty "font-size: 12; margin-right: 2px;" :sty "font-size: 12; margin-right: 2px;"
:val {vol + 1 - 1} :val {vol + 1 - 1}
:char "")) :char "")))
(defwidget mic [] (defwidget mic []
(eventbox
:onclick "hyprctl dispatch exec 'pavucontrol -t 4'"
:onscroll "if [ {} == 'up' ]; then wpctl set-volume -l 1 @DEFAULT_SOURCE@ 1%+; else wpctl set-volume @DEFAULT_SOURCE@ 1%-; fi"
(circle :prog {micvol * 70} (circle :prog {micvol * 70}
:sty "margin-left: 1px;" :sty "margin-left: 1px;"
:val {micvol *100} :val {micvol *100}
:char "󰍬")) :char "󰍬")))
(defwidget brightness [] (defwidget brightness []
(eventbox (eventbox
@ -101,9 +107,11 @@
(power)))) (power))))
(defwidget cal [] (defwidget cal []
(box
:class "cal"
(eventbox (eventbox
:onhoverlost "eww close cal" :onhoverlost "eww close cal"
(calendar))) (calendar))))
;; Windows ;; Windows