View Single Post
Old 09-15-2023, 10:38 AM   #1116
hatuluang
Teluk Biru
hatuluang ought to be getting tired of karma fortunes by now.hatuluang ought to be getting tired of karma fortunes by now.hatuluang ought to be getting tired of karma fortunes by now.hatuluang ought to be getting tired of karma fortunes by now.hatuluang ought to be getting tired of karma fortunes by now.hatuluang ought to be getting tired of karma fortunes by now.hatuluang ought to be getting tired of karma fortunes by now.hatuluang ought to be getting tired of karma fortunes by now.hatuluang ought to be getting tired of karma fortunes by now.hatuluang ought to be getting tired of karma fortunes by now.hatuluang ought to be getting tired of karma fortunes by now.
 
hatuluang's Avatar
 
Posts: 156
Karma: 348662
Join Date: Jan 2023
Device: Kobo Clara 2E
Quote:
Originally Posted by John F View Post
This is what I did to toggle dark mode and set a light level:

Code:
   menu_item :reader   :Dark Mode On       :nickel_setting     :enable :dark_mode
                         chain_always :cmd_spawn : ioctl /dev/ntx_io 241 -v 10
   menu_item :reader   :Dark Mode Off       :nickel_setting    :disable :dark_mode
                         chain_always :cmd_spawn : ioctl /dev/ntx_io 241 -v 30
and it works.
Hi, I tried to change a bit with toggle options to only have one command as below:

Code:
menu_item :reader   :Dark Mode on/off     :nickel_setting :toggle :dark_mode
     chain_success :cmd_spawn : ioctl /dev/ntx_io 241 -v 10
     chain_success :skip :2
     chain_failure :dbg_toast :Dark Mode switch!
     chain_always :cmd_spawn : ioctl /dev/ntx_io 241 -v 30
It works, hope that the syntax is correct.

Note:
- the slider indicator didn't move according to the level of brightness setup.

Last edited by hatuluang; 09-15-2023 at 11:03 AM.
hatuluang is offline   Reply With Quote