diff options
author | Freya Murphy <freya@freyacat.org> | 2025-06-17 15:14:45 -0400 |
---|---|---|
committer | Freya Murphy <freya@freyacat.org> | 2025-06-17 15:14:45 -0400 |
commit | 1173df26fd78fdd59679645004847237ed7a0a54 (patch) | |
tree | b75e6bd3ee1a878b1a3e74d94fb9ea0bb94c14a7 /pkgs/astal/src/widget/bar/audio.lua | |
parent | add upowerd (diff) | |
download | dotfiles-nix-1173df26fd78fdd59679645004847237ed7a0a54.tar.gz dotfiles-nix-1173df26fd78fdd59679645004847237ed7a0a54.tar.bz2 dotfiles-nix-1173df26fd78fdd59679645004847237ed7a0a54.zip |
add astal package, update flake to support packages
Diffstat (limited to 'pkgs/astal/src/widget/bar/audio.lua')
-rw-r--r-- | pkgs/astal/src/widget/bar/audio.lua | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/pkgs/astal/src/widget/bar/audio.lua b/pkgs/astal/src/widget/bar/audio.lua new file mode 100644 index 0000000..c1934f9 --- /dev/null +++ b/pkgs/astal/src/widget/bar/audio.lua @@ -0,0 +1,20 @@ +local astal = require("astal") +local Widget = require("astal.gtk3.widget") +local Wp = astal.require("AstalWp") +local bind = astal.bind + +return function() + local speaker = Wp.get_default().audio.default_speaker + + return Widget.Box({ + class_name = "audio", + Widget.Icon({ + icon = bind(speaker, "volume-icon"), + }), + Widget.Label({ + label = bind(speaker, "volume"):as(function(p) + return tostring(math.floor(p * 100)) .. '%' + end) + }), + }) +end |