somesing
This commit is contained in:
parent
3e703d3a8b
commit
7b368aba19
@ -1,9 +1,10 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
case ${BLOCK_INSTANCE} in
|
case ${BLOCK_INSTANCE} in
|
||||||
mic) GET="Capture";;
|
mic) DEV="Capture";;
|
||||||
*) GET="Master";;
|
*) DEV="Master";;
|
||||||
esac
|
esac
|
||||||
amixer get $GET | gawk '
|
[[ ${BLOCK_BUTTON} == 1 ]] && amixer set $DEV toggle &> /dev/null
|
||||||
|
amixer get $DEV | gawk '
|
||||||
match($0, /\[([0-9]+)\%\] \[(on|off)\]/, matches) {
|
match($0, /\[([0-9]+)\%\] \[(on|off)\]/, matches) {
|
||||||
audio=matches[1]
|
audio=matches[1]
|
||||||
}
|
}
|
||||||
@ -13,8 +14,8 @@ amixer get $GET | gawk '
|
|||||||
print("off \n")
|
print("off \n")
|
||||||
exit 33
|
exit 33
|
||||||
}
|
}
|
||||||
printf("%d%", audio)
|
printf("%d% \n", audio)
|
||||||
printf("%d", audio)
|
printf("%d\n", audio)
|
||||||
if (audio < 75) {
|
if (audio < 75) {
|
||||||
print("#04B431\n")
|
print("#04B431\n")
|
||||||
} else if (audio < 80) {
|
} else if (audio < 80) {
|
||||||
|
@ -1,7 +1,13 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
[[ ${BLOCK_INSTANCE} == '' ]] && BATTERY=0 || BATTERY=${BLOCK_INSTANCE}
|
[[ ${BLOCK_INSTANCE} == '' ]] && BAT=0 || BAT=${BLOCK_INSTANCE}
|
||||||
cat /sys/class/power_supply/BAT${BATTERY}/uevent | gawk -F '=' '
|
DIR="/sys/class/power_supply/BAT"
|
||||||
|
if [ ! -f "${DIR}${BAT}/uevent" ]; then
|
||||||
|
echo " not found "
|
||||||
|
echo "n/a"
|
||||||
|
exit 33
|
||||||
|
fi
|
||||||
|
cat /sys/class/power_supply/BAT${BAT}/uevent | gawk -F '=' '
|
||||||
/POWER_SUPPLY_STATUS=/ {
|
/POWER_SUPPLY_STATUS=/ {
|
||||||
status=$2
|
status=$2
|
||||||
}
|
}
|
||||||
@ -20,8 +26,8 @@ cat /sys/class/power_supply/BAT${BATTERY}/uevent | gawk -F '=' '
|
|||||||
} else {
|
} else {
|
||||||
status=""
|
status=""
|
||||||
}
|
}
|
||||||
printf("%s%d%", status, charge)
|
printf("%s%d%\n", status, charge)
|
||||||
print("\n")
|
printf("%s%d\n", status, charge)
|
||||||
if (charge > 25) {
|
if (charge > 25) {
|
||||||
print("#04B431\n")
|
print("#04B431\n")
|
||||||
} else if (charge > 20) {
|
} else if (charge > 20) {
|
||||||
|
Reference in New Issue
Block a user