Skip to content

Command line arguments | parameters

Sam edited this page Nov 8, 2021 · 19 revisions

Usage

The shell has an interactive mode which can be used by starting the executable without command line parameters. Calling the shell with arguments will execute the command immediately.

Syntax: AutoDarkModeShell.exe [--<command>] [(optional) timeout-value]

Documentation

All commands return a response, containing:

  • a StatusCode
  • a message (optional)
  • details (optional)

delimited by \nAdmApiDataRow=

Available Status Codes are:

  • Available
  • New
  • NoLocAccess
  • Err
  • Ok
  • Timeout
  • UnsupportedOperation
  • No
  • Disabled
  • InProgress
Parameter Description
--switch Invokes a theme switch based on time. Only returns an ApiResponse with StatusCode.Ok or a StatusCode.Timeout
--swap Basically useless currently, needs rework
--light Forces light theme and sets the GlobalState force flag. Only returns an ApiResponse with StatusCode.Ok or a StatusCode.Timeout
--dark Forces dark theme and sets the GlobalState force flag. Only returns an ApiResponse with StatusCode.Ok or a StatusCode.Timeout
--no-force Resets the GlobalState force theme flag. Only returns an ApiResponse with StatusCode.Ok or a StatusCode.Timeout
--check-for-update Checks for updates silently
ApiResponse with StatusCode.New if an update is available,
StatusCode.Ok if no update is available
StatusCode. Err if an error has occurred.
Message carries the current version string
Details carries a yaml serialized UpdateInfo object
--check-for-update-notify Checks for updates loudly (shows toast message)ApiResponse object as string with StatusCode.New if an update is available,
StatusCode.Ok if no update is available
StatusCode.Err if an error has occurred.
StatusCode.UnsupportedOperation if ADM has been installed in all users mode
StatusCode.Disabled if a manual update is required
Message carries the current version string
Details carries a yaml serialized UpdateInfo object
--check-for-downgrade-notify Functions and returns the same as --check-for-update-notify, but instead checks if a downgrade from beta to stable is available
--update Invokes an update. this requires that CheckForUpdate has been run beforehand
Returns an ApiResponse object as string with StatusCode.New if an update can be performed,
StatusCode.UnsupportedOperation if ADM has been installed in all users mode
StatusCode.Disabled if a manual update is required
Returns any other status code if the update was not possible.
--geolocator-is-updating Checks if the geolocator is currently updating
Returns an ApiResponse object as string withStatusCode.Ok if the locator is not updatingStatusCode.InProgress if the geolocator is currently updating
--add-autostart Add Auto Dark Mode to the autostart
--remove-autostart Removes Auto Dark Mode from the autostart
--validate-autostart Validates whether the autostart entries are set correctly
--exit Shuts down Auto Dark Mode
--restart Restarts the Auto Dark Mode service

| --detect-monitors | Redetects monitors for setting a wallpaper | | --clean-monitors | Removes monitors from the config file that are no longer being used by Windows | | --update-failed | Sends a notification to the user that the update process failed. This is only intended to be used by the updater | | --test-notifications | Sends a test notification, which one that is is whatever we feel like |

Clone this wiki locally