mirror of
https://github.com/yusufipk/dikte.git
synced 2026-09-11 19:06:11 +00:00
Merge master into the Windows port
Three of the four collisions were the same one: master moved the directory rule into paths.py while this branch was adding a Windows case to the copy in config.py and the second copy in ggml.py. The case moves to paths.py with the rest of it, and the directories test moves to tests/test_paths.py where master put its neighbours. The fourth is MeetingRecorder, which now starts a process per capture device. Windows keeps its two lines there: no console window for either process, and a stop that terminates rather than sending a signal the platform does not have.
This commit is contained in:
@@ -711,16 +711,27 @@ def cmd_test_key(opts):
|
||||
def cmd_shortcut(opts):
|
||||
conf = cfg.Config()
|
||||
if opts.shortcut == "status":
|
||||
# The running instance is asked first. On KDE and GNOME this process
|
||||
# could read the registry itself and get the same answer; on macOS
|
||||
# there is no registry, the combination is held by that process and by
|
||||
# nothing else, and asking here would report every shortcut as missing
|
||||
# while they all work.
|
||||
live = ipc.send("status") or {}
|
||||
registered = live.get("shortcuts") or {}
|
||||
rows = {}
|
||||
for name, spec in hotkey.SHORTCUTS.items():
|
||||
rows[name] = {"registered": hotkey.shortcut_status(spec.desktop_id),
|
||||
"configured": conf[spec.setting]}
|
||||
rows[name] = {
|
||||
"registered": registered.get(
|
||||
name, hotkey.shortcut_status(spec.desktop_id)),
|
||||
"configured": conf[spec.setting],
|
||||
}
|
||||
listener = live.get("listener", conf["evdev_hotkey"])
|
||||
lines = [f"{name:8} {row['registered'] or '(not installed)':16} "
|
||||
f"setting: {row['configured'] or '(none)'}"
|
||||
for name, row in rows.items()]
|
||||
lines.append(f"built-in listener: {'on' if conf['evdev_hotkey'] else 'off'}")
|
||||
lines.append(f"built-in listener: {'on' if listener else 'off'}")
|
||||
return out(opts, {"ok": True, "shortcuts": rows,
|
||||
"listener": conf["evdev_hotkey"]}, "\n".join(lines))
|
||||
"listener": listener}, "\n".join(lines))
|
||||
|
||||
spec = hotkey.SHORTCUTS[opts.which]
|
||||
if opts.shortcut == "remove":
|
||||
@@ -728,7 +739,8 @@ def cmd_shortcut(opts):
|
||||
return out(opts, {"ok": True, "removed": opts.which},
|
||||
f"Removed the {opts.which} shortcut.")
|
||||
|
||||
combo = (opts.combo or conf[spec.setting] or spec.fallback).strip()
|
||||
combo = (opts.combo or conf[spec.setting]
|
||||
or hotkey.default_combo(opts.which)).strip()
|
||||
if not combo:
|
||||
return fail(opts, "no combination given and none stored; pass --combo", 2)
|
||||
if not hotkey.valid_shortcut(combo):
|
||||
|
||||
Reference in New Issue
Block a user