Skip to content

Command line arguments | parameters

Sam edited this page Mar 9, 2023 · 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.

The Shell executable resides in the same directory as AutoDarkModeApp.exe and AutoDarkModeService.exe.

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

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
  • Modified
Parameter Description
--switch Invokes a theme switch based on time. Only returns an ApiResponse with StatusCode.Ok or a StatusCode.Timeout
--swap Swaps the current theme and postpones automatic theme switching until the next interval
--light Requests Auto Dark Mode to switch to the light theme and pauses automatic switching once. Only returns an ApiResponse with StatusCode.Ok or a StatusCode.Timeout
--dark Requests Auto Dark Mode to switch to the dark theme and pauses automatic switching once. Only returns an ApiResponse with StatusCode.Ok or a StatusCode.Timeout
--force-light Forces light theme and sets the GlobalState force flag. Only returns an ApiResponse with StatusCode.Ok or a StatusCode.Timeout
--force-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
--delay-by X Delays the theme switch by a user set amount passed as additional parameter in minutes. Returns an ApiResponse with StatusCode.Ok, StatusCode.Err if a parameter is invalid or a StatusCode.Timeout
--toggle-skip-next Toggles skipping the next pending theme switch off or on.
Returns an APIResponse with StatusCode.Ok or a StatusCode.Timeout and a message with true or false to indicate whether skipping is enabled or disabled
--clear-postpone-queue Removes all user-clearable postpones from the queue and resumes theme switching. Only returns StatusCode.Ok or StatusCode.Timeout
--get-postpone-status Retrieves the current postpones as string-serialized data transfer object. Only returns StatusCode.Ok or 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