Move config out of the plugin dir so edits don't reload the plugin

The shell watches every file under ~/.config/omarchy/plugins/ with
inotify (no extension filter) and reloads all plugin code on any change,
so config.json there made every edit tear down and rebuild the panel and
bar widget. Config now lives at ~/.config/omarchy/key-visualizer.json, which
is not watched: edits update the display live. The panel migrates the
old plugin-dir config (values carried over, file removed) on first load
after the update.
This commit is contained in:
felixzsh
2026-08-11 13:42:24 -05:00
parent c0d491db29
commit 5670aca888
3 changed files with 25 additions and 14 deletions
+4 -2
View File
@@ -28,12 +28,14 @@ Panel {
property int margin: 67
property int lingerMs: 1000
readonly property string pluginDir: Quickshell.env("HOME") + "/.config/omarchy/plugins/felixzsh.key-visualizer"
// Config lives outside the plugin folder (the shell reloads all plugin
// code on any file change under ~/.config/omarchy/plugins/), so editing it
// updates the display live instead of restarting the plugin.
readonly property string configPath: Quickshell.env("HOME") + "/.config/omarchy/key-visualizer.json"
readonly property string pausePath: {
var runtime = Quickshell.env("XDG_RUNTIME_DIR")
return (runtime && runtime.length > 0 ? runtime : "/tmp") + "/omarchy-key-visualizer.paused"
}
readonly property string configPath: root.pluginDir + "/config.json"
// ------------------------------------------------------------- pause