Quote:
Originally Posted by hatuluang
Yes, you are right the light level doesn't change between two stages, unfortunately.
|
I know I'm late to the party, but i found a solution to solve this issue: I've added a chain_always command after the dark mode toggle that runs a shell script:
Quote:
menu_item : reader : Toggle Dark Mode : nickel_setting : toggle : dark_mode
chain_always : cmd_spawn : quiet : exec /mnt/onboard/.adds/misc/DarkModeHelper.sh
|
And here's the script:
Quote:
#!/bin/sh
KOBO_CONF="/mnt/onboard/.kobo/Kobo/Kobo eReader.conf"
if grep '^DarkMode=true' "$KOBO_CONF"; then
ioctl /dev/ntx_io 241 -v 1
sed 's/^FrontLightLevel=.*/FrontLightLevel=1/g' <"$KOBO_CONF" >"$KOBO_CONF".tmp && mv "$KOBO_CONF".tmp "$KOBO_CONF"
elif grep '^DarkMode=false' "$KOBO_CONF"; then
ioctl /dev/ntx_io 241 -v 5
sed 's/^FrontLightLevel=.*/FrontLightLevel=5/g' <"$KOBO_CONF" >"$KOBO_CONF".tmp && mv "$KOBO_CONF".tmp "$KOBO_CONF"
fi
|
This way, every time you toggle Dark Mode, there is a check to determine whether dark mode has been turned on or off ; it then changes the level accordingly in ioctl AND in "Kobo eReader.conf", so that the level changes persist across reboots.