mirror of
https://github.com/donovanglover/nix-config.git
synced 2024-12-16 03:40:57 +01:00
yambar: Add pipewire script
This commit is contained in:
parent
08b5d9a72b
commit
7484827bb7
29
yambar/.config/yambar/pipewire.sh
Executable file
29
yambar/.config/yambar/pipewire.sh
Executable file
@ -0,0 +1,29 @@
|
||||
#!/bin/bash
|
||||
|
||||
declare pipewire
|
||||
|
||||
while true; do
|
||||
pw="$(wpctl get-volume @DEFAULT_AUDIO_SINK@ | choose 1)"
|
||||
muted="$(wpctl get-volume @DEFAULT_AUDIO_SINK@ | choose 2)"
|
||||
pw2="$(echo "$pw * 100 / 1" | bc)"
|
||||
if [[ "$muted" == "[MUTED]" ]]; then
|
||||
pipewire=" $pw2"
|
||||
else
|
||||
if [[ "$pw2" -gt 59 ]]; then
|
||||
pipewire=" $pw2"
|
||||
else
|
||||
if [[ "$pw2" -gt 0 ]]; then
|
||||
pipewire=" $pw2"
|
||||
else
|
||||
pipewire=" $pw2"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
printf -- '%s\n' "pipewire|string|${pipewire}%"
|
||||
printf -- '%s\n' ""
|
||||
|
||||
sleep 0.1
|
||||
done
|
||||
|
||||
unset pipewire
|
Loading…
Reference in New Issue
Block a user