This repository has been archived on 2026-11-02. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
dotfiles/mutable_config/quickshell/shell.qml
T

63 lines
1.3 KiB
QML

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
}
}