move modules to ./modules
This commit is contained in:
27
modules/audio
Executable file
27
modules/audio
Executable file
@ -0,0 +1,27 @@
|
||||
#!/bin/bash
|
||||
amixer get Master | gawk '
|
||||
match($0, /\[([0-9]+)\%\] \[(on|off)\]/, matches) {
|
||||
audio=matches[1]
|
||||
}
|
||||
END {
|
||||
if (matches[2]=="off") {
|
||||
printf("mute\n")
|
||||
printf("\n")
|
||||
exit 33
|
||||
}
|
||||
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