add audio support, add labels
This commit is contained in:
25
audio
25
audio
@ -1,5 +1,22 @@
|
||||
#!/bin/bash
|
||||
sl=$(amixer get Master | tail -n 1)
|
||||
status=$(echo "${sl}" | grep -wo "on")
|
||||
volume=$(echo "${sl}" | awk -F ' ' '{print $5}' | tr -d '[]%')
|
||||
echo ${volume}
|
||||
amixer get Master | gawk '
|
||||
match($0, /\[([0-9]+)\%\]/, matches) {
|
||||
audio=matches[1]
|
||||
}
|
||||
END {
|
||||
printf("%d%", audio)
|
||||
print("\n")
|
||||
if (audio < 75) {
|
||||
print("#04B431\n")
|
||||
} else if (audio < 80) {
|
||||
print("#A8FF00\n")
|
||||
} else if (audio < 85) {
|
||||
print("#FFF600\n")
|
||||
} else if (audio < 90) {
|
||||
print("#FFAE00\n")
|
||||
} else if (audio < 95) {
|
||||
print("#FF0000\n")
|
||||
} else {
|
||||
exit 33
|
||||
}
|
||||
}'
|
||||
|
Reference in New Issue
Block a user