mirror of
https://git.adityakumar.xyz/dwmbar.git
synced 2024-12-23 05:22:53 +00:00
20 lines
422 B
Bash
Executable file
20 lines
422 B
Bash
Executable file
#!/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
|