blob: 6e09da8fa5a42203d86a6f8f692f9af6d6ad4958 (
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/sh
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 'active port.*output' | cut -d"-" -f3 | sed "s/>//")
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
|