Move eww scripts
This commit is contained in:
26
eww/eww-pulse-listener
Executable file
26
eww/eww-pulse-listener
Executable file
@ -0,0 +1,26 @@
|
||||
#!/usr/bin/env zsh
|
||||
|
||||
function print-volume {
|
||||
let volume="$(pamixer --get-volume)"
|
||||
local icon
|
||||
if [[ "$(pamixer --get-mute)" = "true" ]]; then
|
||||
icon=''
|
||||
elif ((${volume} > 50)); then
|
||||
icon=''
|
||||
elif ((${volume} >= 0)); then
|
||||
icon=''
|
||||
else
|
||||
icon='?'
|
||||
fi
|
||||
printf '%s%3d%%\n' "${icon}" "${volume}"
|
||||
}
|
||||
|
||||
print-volume
|
||||
pactl subscribe | \
|
||||
while read line; do
|
||||
case "${line}" in
|
||||
"Event 'change' on sink"*)
|
||||
print-volume
|
||||
;;
|
||||
esac
|
||||
done
|
Reference in New Issue
Block a user