aboutsummaryrefslogtreecommitdiff
path: root/modules/volume
blob: 484a6d7e197b426033cb03aa5b58f054f245d0ad (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/bin/bash

# Prints out the volume percentage

VOLUME_ON_ICON=''
VOLUME_MUTED_ICON=''

get_volume(){
        #curStatus=$(pactl get-sink-mute @DEFAULT_SINK@)
        volume=$(awk -F"[][]" '/Left:/ { print $2 }' <(amixer sget Master))

        if [ "${curStatus}" = '0%' ]
        then
            echo "$VOLUME_MUTED_ICON  $volume"
        else
            echo "$VOLUME_ON_ICON  $volume"
        fi
}

get_volume