durcheinander
This commit is contained in:
parent
2077f89897
commit
aa88b06bbc
@ -1,16 +1,20 @@
|
||||
#!/bin/bash
|
||||
amixer get Master | gawk '
|
||||
match($0, /\[([0-9]+)\%\] \[(on|off)\]/, matches) {
|
||||
case ${BLOCK_INSTANCE} in
|
||||
mic) GET="Capture";;
|
||||
*) GET="Master";;
|
||||
esac
|
||||
amixer get $GET | gawk '
|
||||
match($0, /\[([0-9]+)\%\] \[(on|off)\]/, matches) {
|
||||
audio=matches[1]
|
||||
}
|
||||
END {
|
||||
if (matches[2]=="off") {
|
||||
printf("mute\n")
|
||||
printf("\n")
|
||||
printf("off \n")
|
||||
print("\n")
|
||||
exit 33
|
||||
}
|
||||
printf("%d%", audio)
|
||||
print("\n")
|
||||
printf("%d", audio)
|
||||
if (audio < 75) {
|
||||
print("#04B431\n")
|
||||
} else if (audio < 80) {
|
||||
|
@ -4,9 +4,16 @@ if [[ -d "${DIR}acpi_video0" ]]; then
|
||||
DIR="${DIR}acpi_video0"
|
||||
elif [[ -d "${DIR}intel_backlight" ]]; then
|
||||
DIR="${DIR}intel_backlight"
|
||||
else
|
||||
echo "not found "
|
||||
exit 33
|
||||
fi
|
||||
cat "${DIR}/brightness" "${DIR}/max_brightness" | gawk '
|
||||
NR==1 { cbr=$1 }
|
||||
NR==2 { mbr=$1 }
|
||||
END { printf("%d%", cbr/mbr*100) }
|
||||
END {
|
||||
printf("%d%\n", cbr/mbr*100)
|
||||
printf("%d\n", cbr/mbr*100)
|
||||
print("\n")
|
||||
}
|
||||
'
|
||||
|
@ -1,5 +1,9 @@
|
||||
#!/bin/bash
|
||||
full=$(date '+%A, %_d.%_m. %_H:%M:%S')
|
||||
short=$(date '+%_H:%M')
|
||||
echo $full
|
||||
echo $short
|
||||
SHORT=$(date '+%_H:%M')
|
||||
FULL=$(date '+%A, %_d.%_m. %_H:%M:%S')
|
||||
case ${BLOCK_INSTANCE} in
|
||||
short) LONG=false ;;
|
||||
*) LONG=true ;;
|
||||
esac
|
||||
[[ ${BLOCK_BUTTON} == 1 ]] && LONG=true
|
||||
[[ "$LONG" == "true" ]] && echo $FULL || echo $SHORT
|
||||
|
29
modules/mic
29
modules/mic
@ -1,29 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
amixer get Capture | gawk '
|
||||
match($0, /\[([0-9]+)\%\] \[(on|off)\]/, matches) {
|
||||
mic=matches[1]
|
||||
}
|
||||
END {
|
||||
if (matches[2]=="off") {
|
||||
printf("mute\n")
|
||||
printf("\n")
|
||||
exit 33
|
||||
}
|
||||
printf("%d%", mic)
|
||||
print("\n")
|
||||
if (mic < 75) {
|
||||
print("#04B431\n")
|
||||
} else if (mic < 80) {
|
||||
print("#A8FF00\n")
|
||||
} else if (mic < 85) {
|
||||
print("#FFF600\n")
|
||||
} else if (mic < 90) {
|
||||
print("#FFAE00\n")
|
||||
} else if (mic < 95) {
|
||||
print("#FF0000\n")
|
||||
} else {
|
||||
exit 33
|
||||
}
|
||||
}
|
||||
'
|
Reference in New Issue
Block a user