I continue to think it's not difficult. You have simply to check if the device is in sleeping mode, and if it continues to be in that state for more than 1 day, you do shutdown, poweroff or every other command that Kobo ships. This will work if Kobo does not send STOP signal to all background tasks when it goes in sleep mode (I don't think so). It's basically something like this:
Code:
start_time=$(date +%s)
while true; do
sleep 3 # or whatever you want. 10? Write 10
# there should be a way to check if the device is in sleeping mode
device_is_sleeping=boh
if [ $device_is_sleeping -eq 0 ] ; then
start_time=$(date +%s)
else
current_time=$(date +%s)
elapsed_time = $(echo "$current_time - $start_time | bc)
if [ $elapsed_time -ge 86400 ] ; then
poweroff
fi
fi
done
I remember there's a way to check if Kobo is in sleeping mode. Probably `nickel` process is in stopped state, but also other third party programs stops nickel.
Alternatively, there's /etc/pm/sleep.d . If Kobo has this folder and it works, you can follow this
SO answer.