mirror of
https://git.adityakumar.xyz/dwmbar.git
synced 2024-11-22 02:22:53 +00:00
Update volume module to work with any default sink
This commit is contained in:
parent
d68a1e3372
commit
0e8e7ab63d
1 changed files with 2 additions and 3 deletions
|
@ -6,9 +6,8 @@ VOLUME_ON_ICON=''
|
||||||
VOLUME_MUTED_ICON=''
|
VOLUME_MUTED_ICON=''
|
||||||
|
|
||||||
get_volume(){
|
get_volume(){
|
||||||
active_sink=$(pactl list short sinks | sed -e 's,^\([0-9][0-9]*\)[^0-9].*,\1,' | head -n 1)
|
curStatus=$(pactl get-sink-mute @DEFAULT_SINK@)
|
||||||
curStatus=$(pactl get-sink-mute $active_sink)
|
volume=$(pactl get-sink-volume @DEFAULT_SINK@ | tail -n 2 | sed -e 's,.* \([0-9][0-9]*\)%.*,\1,' | head -n 1)
|
||||||
volume=$(pactl get-sink-volume $active_sink | tail -n 2 | sed -e 's,.* \([0-9][0-9]*\)%.*,\1,' | head -n 1)
|
|
||||||
|
|
||||||
if [ "${curStatus}" = 'Mute: yes' ]
|
if [ "${curStatus}" = 'Mute: yes' ]
|
||||||
then
|
then
|
||||||
|
|
Loading…
Reference in a new issue