Merge pull request #167 from dixiedream/master

Adding Pipewire watch recipe
This commit is contained in:
Emmanuel Lepage Vallée 2022-06-18 12:37:20 -07:00 committed by GitHub
commit 6409736fdd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 19 additions and 0 deletions

View File

@ -146,6 +146,25 @@ local mpris, mpris_timer = awful.widget.watch(
) )
``` ```
## pipewire
```lua
-- pactl based volume widget for pure pipewire setups
local volume = awful.widget.watch(
"pactl get-sink-volume @DEFAULT_SINK@ | cut -s -d/ -f2,4; pactl get-sink-mute @DEFAULT_SINK@",
5, -- timeout
function(widget, stdout)
local volume = "Volume: "
for v in stdout:gmatch("(%d+%%)") do volume = volume .. " " .. v end
if #volume == 8 then volume = "N/A" end
local mute = string.match(stdout, "Mute: (%S+)") or "N/A"
-- customize here
widget:set_markup(volume .. " " .. mute)
end
)
```
## upower ## upower
```lua ```lua