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

167 lines
4.1 KiB
QML

import QtQuick
import Quickshell
import Quickshell.Io
import "components/Bar"
import "components/CommandPalette"
import "components/OSD"
import "components/Shared"
import "components/LogoutMenu"
import "components/ClipboardManager"
import "components/Notifications"
import "components/WallpaperPicker"
import "components/LockScreen"
import "components/QuickSettings"
ShellRoot {
id: root
// --- Global State ---
property bool commandPaletteOpen: false
property bool logoutMenuOpen: false
property bool clipboardManagerOpen: false
property bool wallpaperPickerOpen: false
property bool quickSettingsOpen: false
property bool dndEnabled: false
// Only one overlay is ever open at once - closing every other one is
// simpler and less error-prone than each toggle() hand-listing its
// siblings (which is how this used to work, and reliably went stale
// every time a new overlay was added).
function closeOtherOverlays(keepOpen) {
if (keepOpen !== "commandPalette") commandPaletteOpen = false;
if (keepOpen !== "logoutMenu") logoutMenuOpen = false;
if (keepOpen !== "clipboardManager") clipboardManagerOpen = false;
if (keepOpen !== "wallpaperPicker") wallpaperPickerOpen = false;
if (keepOpen !== "quickSettings") quickSettingsOpen = false;
}
IpcHandler {
target: "commandPalette"
function toggle() {
commandPaletteOpen = !commandPaletteOpen;
if (commandPaletteOpen) closeOtherOverlays("commandPalette");
}
}
IpcHandler {
target: "logoutMenu"
function toggle() {
logoutMenuOpen = !logoutMenuOpen;
if (logoutMenuOpen) closeOtherOverlays("logoutMenu");
}
}
IpcHandler {
target: "clipboardManager"
function toggle() {
clipboardManagerOpen = !clipboardManagerOpen;
if (clipboardManagerOpen) closeOtherOverlays("clipboardManager");
}
}
IpcHandler {
target: "quickSettings"
function toggle() {
quickSettingsOpen = !quickSettingsOpen;
if (quickSettingsOpen) closeOtherOverlays("quickSettings");
}
}
IpcHandler {
target: "osd"
function showVolume() {
osd.show("volume");
}
function showBrightness() {
osd.show("brightness");
}
}
IpcHandler {
target: "wallpaperSwitcher"
function open() {
wallpaperPickerOpen = !wallpaperPickerOpen;
if (wallpaperPickerOpen) closeOtherOverlays("wallpaperPicker");
}
function random() {
randomWallpaperProcess.running = false;
randomWallpaperProcess.running = true;
}
}
Process {
id: randomWallpaperProcess
command: ["nu", Quickshell.env("HOME") + "/.dotfiles/config/nushell/scripts/wallpaper-switch.nu", "--random"]
running: false
}
Variants {
model: Quickshell.screens
Bar {
required property var modelData
screen: modelData
rootState: root
}
}
CommandPalette {
id: commandPalette
rootState: root
}
LogoutMenu {
id: logoutMenu
rootState: root
}
ClipboardManager {
id: clipboardManager
rootState: root
}
OSD {
id: osd
}
Notifications {
id: notifications
rootState: root
}
QuickSettings {
id: quickSettings
rootState: root
}
WallpaperPicker {
id: wallpaperPicker
rootState: root
}
IpcHandler {
target: "showcase"
function toggle() {
showcase.open = !showcase.open;
}
}
Showcase {
id: showcase
}
// No unlock/toggle exposed here on purpose: unlocking only ever happens
// through a successful PamContext result inside LockScreen.qml.
IpcHandler {
target: "lockScreen"
function lock() {
lockScreen.locked = true;
}
}
LockScreen {
id: lockScreen
}
}