Files
glassMxrph/quickshell/core/ScreenService.qml
T
mxandClaude Opus 5.5 99e64a7713 Add glassMxrph shell sources
Initial commit of the Quickshell desktop suite: bar, dock, launcher,
settings, Control Center, dashboard, OSD, lock screen, desktop widgets,
plugin host with the vendored Noctalia/Omarchy compatibility layer,
helpers, packaging, tests and phase documentation.

Includes the optimization work so far: usage widgets and dashboard
gauges no longer animate continuously, desktop widgets pause while
covered, system controls stop flickering on background polls, dock app
matching uses an indexed catalog, and workspace ghosts are created only
for occupied slots.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-07 22:36:17 +02:00

25 lines
908 B
QML

pragma Singleton
import QtQuick
import Quickshell
import Quickshell.Hyprland
Singleton {
id: root
property string focusedName: ""
Connections {
target: Hyprland
function onRawEvent(event) {
if (event.name === "focusedmon" || event.name === "focusedmonv2")
root.focusedName = event.parse(2)[0];
}
}
readonly property var active: Quickshell.screens.find(s => s.name === (focusedName || (Hyprland.focusedMonitor ? Hyprland.focusedMonitor.name : ""))) || primary
readonly property var primary: Quickshell.screens.find(s => s.x === 0 && s.y === 0) || Quickshell.screens[0] || null
function current(candidate) {
return Quickshell.screens.find(s => s === candidate) || active;
}
function resolve(name) {
return (name === "primary" ? primary : Quickshell.screens.find(s => s.name === name)) || primary;
}
}