Validate hotkeys and support Super alias
This commit is contained in:
parent
2cbc1a98b9
commit
3bc473262d
6 changed files with 138 additions and 34 deletions
14
src/aman.py
14
src/aman.py
|
|
@ -400,11 +400,15 @@ def main():
|
|||
signal.signal(signal.SIGINT, handle_signal)
|
||||
signal.signal(signal.SIGTERM, handle_signal)
|
||||
|
||||
desktop.start_hotkey_listener(
|
||||
cfg.daemon.hotkey,
|
||||
lambda: logging.info("hotkey pressed (dry-run)") if args.dry_run else daemon.toggle(),
|
||||
)
|
||||
desktop.start_cancel_listener(lambda: daemon.cancel_recording())
|
||||
try:
|
||||
desktop.start_hotkey_listener(
|
||||
cfg.daemon.hotkey,
|
||||
lambda: logging.info("hotkey pressed (dry-run)") if args.dry_run else daemon.toggle(),
|
||||
)
|
||||
desktop.start_cancel_listener(lambda: daemon.cancel_recording())
|
||||
except Exception as exc:
|
||||
logging.error("hotkey setup failed: %s", exc)
|
||||
raise SystemExit(1)
|
||||
logging.info("ready")
|
||||
try:
|
||||
desktop.run_tray(daemon.get_state, lambda: shutdown("quit requested"))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue