updated volumes

This commit is contained in:
Nickiel12 2023-10-30 18:12:43 -07:00
parent 34172f0ecb
commit 2d426949d9
4 changed files with 50 additions and 24 deletions

View file

@ -73,17 +73,20 @@
(defvar volume-visible false)
(defwidget _volume [volume]
(box
:hexpand false
:class {volume > 100 ? "alert" : "regular"}
(revealer-on-hover
:toggle volume-visible
:togglename "volume-visible"
(label :text {volume <= 0 ? "󰝟 " :
volume < 33 ? "󰕿 " :
volume < 66 ? "󰖀 " :
volume < 99 ? "󰕾 " : "󱄡 "})
(label :text "${volume}%"))))
(eventbox
:onscroll "./scripts/volume {} ${EWW_EXECUTABLE}"
:onclick "./scripts/volume toggle ${EWW_EXECUTABLE}"
(box
:hexpand false
:class {volume > 100 ? "alert" : "regular"}
(revealer-on-hover
:toggle volume-visible
:togglename "volume-visible"
(label :text {volume <= 0 ? "󰝟 " :
volume < 33 ? "󰕿 " :
volume < 66 ? "󰖀 " :
volume < 99 ? "󰕾 " : "󱄡 "})
(label :text "${volume}%")))))
(defvar battery-visible false)
@ -144,19 +147,9 @@
{music != "" ? "🎵${music}" : ""}))
(defpoll volume :interval "1s"
"pw-volume status | jq '.percentage'")
{"pw-volume status | jq '.percentage // 0'" ?: 500})
(defpoll time :interval "10s"
"date '+%H:%M %b %d, %Y'")
(defwindow bar
:monitor 1
:exclusive true
:windowtype "dock"
:geometry (geometry :x "0%"
:y "0%"
:width "90%"
:height "10px"
:anchor "top center")
:reserve (struts :side "top" :distance "4%")
(bar))
(include "windows.yuck")

View file

@ -0,0 +1,12 @@
#!/bin/sh
case $1 in
"*") command="";;
"up") command="change +2%";;
"down") command="change -1.5%";;
"toggle") command="mute toggle";;
esac
[ -n "$command" ] && pw-volume $command
$2 update volume=$(pw-volume status | jq '.percentage // 0')

View file

@ -0,0 +1,12 @@
(defwindow bar
:monitor 1
:exclusive true
:windowtype "dock"
:geometry (geometry :x "0%"
:y "0%"
:width "90%"
:height "10px"
:anchor "top center")
:reserve (struts :side "top" :distance "4%")
(bar))

View file

@ -1,4 +1,4 @@
{lib, ...}:
{lib, pkgs, ...}:
let
workspaces =
@ -20,7 +20,16 @@ in
"$mod ALT, mouse:272, resizewindow"
];
# binde, will repeat when held
#https://wiki.hyprland.org/Configuring/Binds/#bind-flags
binde = [
",XF86AudioRaiseVolume, exec, pw-volume change +1%; ${pkgs.eww}/bin/eww update volume=$(pw-volume status | jq '.percentage // 10')"
",XF86AudioLowerVolume, exec, pw-volume change -1%; ${pkgs.eww}/bin/eww update volume=$(pw-volume status | jq '.percentage // 10')"
];
bind = [
",XF86AudioMute, exec, pw-volume mute toggle"
"$mod, RETURN, exec, kitty"
"$mod, r, exec, rofi -show run window"
"$mod, q, killactive"