blob: 45f4a66109151eacbbcc5e4e5b21190571fc3097 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
#!/bin/bash
function print_mute {
echo -n "M "
}
function print_unmute {
echo -n "U "
}
if type pamixer &>/dev/null
then
if pamixer --get-mute &> /dev/null
then
print_mute
else
print_unmute
fi
echo -n $(pacmd info | grep 'Default sink' | grep -o '[^.]*$')
echo " [$(pamixer --get-volume)%]"
elif type amixer &>/dev/null
then
if [[ "$(amixer sget Master | grep '\[on\]')" == "" ]]
then
print_mute
else
print_unmute
fi
echo -n "Volume: "
echo "[$(amixer sget Master | grep Mono: | sed -e 's/[ \t]*Mono: Playback [0-9]* \[\([0-9]*%\)\].*/\1/')]"
else
echo "please install either pamixer or amixer"
fi
|