FunKey-OS/FunKey/board/funkey/rootfs-overlay/usr/local/lib/utils

38 lines
580 B
Plaintext
Raw Normal View History

2020-05-09 22:49:37 +01:00
#!/bin/sh
# Define log functions if they do not exist yet
type -t info >/dev/null 2>&1
if [ $? -ne 0 ]; then
info () {
echo "$SELF:" "$@" | tee /dev/kmsg
}
warn () {
echo "$SELF:" "$@" >&2 | tee /dev/kmsg
}
die () {
local return_code=$1
shift
warn "$@"
exit $return_code
}
die_notif () {
local return_code=$1
shift
warn "$@"
notif "$@"
exit $return_code
}
2020-05-09 22:49:37 +01:00
fi
notif () {
info "$@"
printf "$@" > /sys/class/graphics/fb0/notification
}
clear_notif () {
printf "clear" > /sys/class/graphics/fb0/notification
}