durcheinander

This commit is contained in:
koksnuss 2018-05-14 10:11:19 +02:00
parent 2077f89897
commit aa88b06bbc
4 changed files with 25 additions and 39 deletions

View File

@ -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) {

View File

@ -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")
}
'

View File

@ -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

View File

@ -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
}
}
'