diff --git a/KeyVisualizer.qml b/KeyVisualizer.qml index fa18752..982f7e3 100644 --- a/KeyVisualizer.qml +++ b/KeyVisualizer.qml @@ -166,9 +166,11 @@ Item { function setPaused(p) { if (p === root.paused) return + // Always rewrite the flag with "0" or "1", never delete it: the + // FileView watcher fires on content changes but not on deletion. var cmd = p ? "printf 1 > " + Util.shellQuote(root.pausePath) - : "rm -f " + Util.shellQuote(root.pausePath) + : "printf 0 > " + Util.shellQuote(root.pausePath) pauseToggleProc.command = ["sh", "-c", cmd] pauseToggleProc.running = true } diff --git a/Panel.qml b/Panel.qml index e07769a..3c24dcf 100644 --- a/Panel.qml +++ b/Panel.qml @@ -41,9 +41,12 @@ Panel { function setPaused(p) { if (p === root.paused) return + // The flag file is always rewritten with "0" or "1" — never deleted: + // the FileView watcher fires on content changes but not on deletion, so + // a removed flag would leave the toggle stuck. var cmd = p ? "printf 1 > " + Util.shellQuote(root.pausePath) - : "rm -f " + Util.shellQuote(root.pausePath) + : "printf 0 > " + Util.shellQuote(root.pausePath) toggleProc.command = ["sh", "-c", cmd] toggleProc.running = true } diff --git a/manifest.json b/manifest.json index ee743cd..7e20900 100644 --- a/manifest.json +++ b/manifest.json @@ -2,7 +2,7 @@ "schemaVersion": 1, "id": "felixzsh.key-visualizer", "name": "Key Visualizer", - "version": "1.3.2", + "version": "1.3.3", "description": "Shows the keys you press on screen. Great for keybinding tutorials, demos, and screencasts.", "kinds": [ "panel",