jacob-pro / solar-screen-brightness

Automatically adjust monitor / screen brightness at night using sunrise/sunset times
GNU Lesser General Public License v3.0
54 stars 4 forks source link

Add cli option for config path #25

Closed caesay closed 6 months ago

caesay commented 7 months ago

For those of us who don't want to use the installer, it would be nice if you could run the app portably, so either it could detect the config file sitting in the same directory, or you should be able to pass in the path to the config path on the command line. (great app by the way, thanks a lot!)

jacob-pro commented 6 months ago

This is now supported in the version 2.0 CLI. The CLI can be downloaded directly as part of the release without using the installer.

C:\Users\jacob\AppData\Local\solar-screen-brightness>ssb-cli.exe --help
Uitlity for automatically setting monitor brightness according to sunrise/sunset times.

Usage: ssb-cli.exe [OPTIONS]

Options:
  -d, --debug            Enable debug logging
  -o, --once             Update brightness once and exit
      --config <CONFIG>  Override the config file path
  -h, --help             Print help
  -V, --version          Print version

e.g.

C:\Users\jacob\AppData\Local\solar-screen-brightness>ssb-cli.exe --config config.json
00:01:51 [INFO] Starting Solar Screen Brightness (CLI), version: 2.0.0

If you don't specify a path it will default to %LOCALAPPDATA%\solar-screen-brightness\config.json