make cli not require a running daemon for all commands

xkb
sezanzeb 4 years ago committed by sezanzeb
parent 98953368a9
commit 03f2e34c8f

@ -87,6 +87,9 @@ def main(options, daemon):
if options.command not in [AUTOLOAD, START, STOP, HELLO, STOP_ALL]:
logger.error('Unknown command "%s"', options.command)
if daemon is None:
sys.exit(0)
if options.command == AUTOLOAD:
daemon.stop()
for device, preset in list(config.iterate_autoload_presets()):
@ -171,7 +174,4 @@ if __name__ == '__main__':
daemon = get_dbus_interface(fallback=False)
if daemon is None:
sys.exit(0)
main(options, daemon)

Loading…
Cancel
Save