13 lines
355 B
Fish
Executable file
13 lines
355 B
Fish
Executable file
#!/usr/bin/env fish
|
|
|
|
set volume (string match -r '[0-9]+.[0-9]+' (wpctl get-volume @DEFAULT_AUDIO_SINK@))
|
|
|
|
set volume (math --scale 0 --scale-mode round "$volume * 100")
|
|
|
|
if string match '*[MUTED]' (wpctl get-volume @DEFAULT_AUDIO_SINK@)
|
|
set text "muted"
|
|
else
|
|
set text "$volume%"
|
|
end
|
|
|
|
notify-send -c 'status' -h int:value:$volume "Volume" "$text"
|