import QtQuick import Quickshell import Quickshell.Io import "components/Bar" import "components/CommandPalette" import "components/Shared" ShellRoot { id: root // --- Global State --- property bool commandPaletteOpen: false property bool commandPaletteOsdMode: false IpcHandler { target: "commandPalette" function toggle() { root.toggleCommandPalette(); } function openOsd() { root.showOsd(); } } function toggleCommandPalette() { if (commandPaletteOpen && !commandPaletteOsdMode) { commandPaletteOpen = false; } else { commandPaletteOsdMode = false; commandPaletteOpen = true; } } function showOsd() { commandPaletteOsdMode = true; commandPaletteOpen = true; osdHideTimer.restart(); } Timer { id: osdHideTimer interval: 2000 onTriggered: { if (root.commandPaletteOsdMode) { root.commandPaletteOpen = false; root.commandPaletteOsdMode = false; } } } // -------------------- Bar { id: bar rootState: root } CommandPalette { id: commandPalette rootState: root } }