pragma Singleton pragma ComponentBehavior: Bound import qs.modules.common import qs.modules.common.functions import QtQuick import Quickshell import Quickshell.Io import Quickshell.Hyprland /** * A service that provides access to Hyprland keybinds. * Uses the `get_keybinds.py` script to parse comments in config files in a certain format and convert to JSON. */ Singleton { id: root property var keybinds: [] Connections { target: Hyprland function onRawEvent(event) { if (event.name == "configreloaded") { getKeybinds.running = true } } } Process { id: getKeybinds running: true command: ["hyprctl", "binds", "-j"] stdout: StdioCollector { onStreamFinished: { try { root.keybinds = JSON.parse(text) } catch (e) { console.error("[CheatsheetKeybinds] Error parsing keybinds:", e) } } } } }