Fix Warnings and implements Systray

This commit is contained in:
Amaro Lopes
2025-09-22 23:03:42 -03:00
parent 690a244bad
commit 99f7e41ff4
8 changed files with 156 additions and 114 deletions

View File

@@ -2,12 +2,17 @@ pragma Singleton
import Quickshell
import Quickshell.Hyprland
import Quickshell.Wayland
Singleton {
readonly property string hyprlandSignature: Quickshell.env("HYPRLAND_INSTANCE_SIGNATURE")
property var sortedTopLevels: {
if (!ToplevelManager.toplevels || !ToplevelManager.toplevels.values) {
return []
}
const topLevels = Array.from(Hyprland.toplevels.values)
const sortedHyprland = topLevels.sort((a, b) => {
if (a.monitor && b.monitor) {
@@ -50,7 +55,7 @@ Singleton {
return 0
})
return sortedHyprland
return sortedHyprland.filter(tl => tl.wayland !== null)
}
@@ -59,8 +64,10 @@ Singleton {
}
property var sortedDesktopApplications: {
const desktopEntries = sortedTopLevels.map( topLevel => {
return DesktopEntries.heuristicLookup(topLevel.wayland.appId)
const sortedWayland = sortedTopLevels.map(topLevel => topLevel.wayland).filter(wayland=> wayland !== null)
const desktopEntries = sortedWayland.map( topLevel => {
return DesktopEntries.heuristicLookup(topLevel.appId)
})
const workspace = sortedTopLevels.map( topLevel => {
return topLevel.workspace.id