Rename sxmo_setpineled.sh to sxmo_setled.sh, add bq-paella support

Signed-off-by: Stacy Harper <contact@stacyharper.net>
master
Maxim Karasev 3 years ago committed by Stacy Harper
parent 7f39de55f0
commit 1e20a2223b
No known key found for this signature in database
GPG Key ID: 5BAC92328B7C5D65
  1. 4
      scripts/core/sxmo_blinkled.sh
  2. 2
      scripts/core/sxmo_flashtoggle.sh
  3. 29
      scripts/core/sxmo_setled.sh
  4. 23
      scripts/core/sxmo_setpineled.sh
  5. 4
      scripts/notifications/sxmo_notificationmonitor.sh

@ -6,12 +6,12 @@
PIDS="" PIDS=""
for i in "$@"; do for i in "$@"; do
sxmo_setpineled.sh "$i" 150 & sxmo_setled.sh "$i" 150 &
PIDS="$PIDS $!" PIDS="$PIDS $!"
done done
echo "$PIDS" | grep -E '[^ ]+' | xargs wait echo "$PIDS" | grep -E '[^ ]+' | xargs wait
for i in "$@"; do for i in "$@"; do
sxmo_setpineled.sh "$i" 0 sxmo_setled.sh "$i" 0
done done

@ -1,5 +1,5 @@
#!/usr/bin/env sh #!/usr/bin/env sh
sxmo_setpineled.sh white "$( sxmo_setled.sh white "$(
grep -qE '^0$' /sys/class/leds/white:flash/brightness && grep -qE '^0$' /sys/class/leds/white:flash/brightness &&
echo 255 || echo 0 echo 255 || echo 0
)" )"

@ -0,0 +1,29 @@
#!/bin/sh
usage () {
printf "usage: %s [red|green|blue|white] [0-255]\n" "$0"
exit 1
}
[ $# -lt 2 ] && usage
case "$(cut -d, -f2 < /sys/firmware/devicetree/base/compatible)" in
l8910qcom) # bq-paella
color="white"; type="kbd_backlight";;
*) # assume pinephone/pinetab
case $1 in
red|green|blue) color="$1"; type="indicator" ;;
white) color="$1"; type="flash" ;;
*) usage ;;
esac
;;
esac
if [ "$2" -lt 0 ] || [ "$2" -gt 255 ]
then
usage
fi
brightness="$2"
printf "%s\n" "$brightness" > "/sys/class/leds/$color:$type/brightness"

@ -1,23 +0,0 @@
#!/bin/sh
usage () {
printf "usage: %s [red|green|blue|white] [0-255]\n" "$0"
exit 1
}
[ $# -lt 2 ] && usage
case $1 in
red|green|blue) color="$1"; type="indicator" ;;
white) color="$1"; type="flash" ;;
*) usage ;;
esac
if [ "$2" -lt 0 ] || [ "$2" -gt 255 ]
then
usage
fi
brightness="$2"
printf "%s\n" "$brightness" > "/sys/class/leds/$color:$type/brightness"

@ -43,10 +43,10 @@ recreateexistingnotifs() {
} }
syncled() { syncled() {
sxmo_setpineled.sh green 0 sxmo_setled.sh green 0
if [ "$(find "$NOTIFDIR"/ -type f | wc -l)" -gt 0 ]; then if [ "$(find "$NOTIFDIR"/ -type f | wc -l)" -gt 0 ]; then
sleep 0.1 sleep 0.1
sxmo_setpineled.sh green 1 sxmo_setled.sh green 1
fi fi
} }

Loading…
Cancel
Save