38 lines
580 B
Bash
Executable File
38 lines
580 B
Bash
Executable File
#!/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
|
|
}
|
|
fi
|
|
|
|
notif () {
|
|
info "$@"
|
|
printf "$@" > /sys/class/graphics/fb0/notification
|
|
}
|
|
|
|
clear_notif () {
|
|
printf "clear" > /sys/class/graphics/fb0/notification
|
|
}
|