Dafang-Hacks / Main

138 stars 63 forks source link

Adding autonight code #29

Closed chisht closed 5 years ago

chisht commented 5 years ago

Moving to proper repo Cleaning up dead code Adding command-line options to specify commands to switch to day or night mode

chisht commented 5 years ago

About the new command-line to specify commands to switch to day or night mode.

Options, -g "command to run to switch to night mode" -y "command to run to switch to day mode" old option "-c" that sets the command to use for both day and night mode.

You can also get the similar help by running 'autonight -h"

Default -c value is /system/sdcard/scripts/nightmode.sh

Logic Logic to change day or night mode is,

if switching to night mode
       if -g is used then,
               execute command set in -g
       else
               execute command set in -c on
if switching to day mode
       if -y is used then,
               execute command set in -y
       else
               execute command set in -c off

Examples:

How to use: Add required command-line to /system/sdcard/config/autonight.conf

Warning: UI setting page for configure sw night mode is not aware of any of these options. If settings are saved from that UI, it will overwrite these options

jmtatsch commented 5 years ago

Thanks for taking the time to clean this up