1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-01-26 06:22:50 -05:00

RunningApps widget

- Sorts by monitor, workspace, then position (on a new enough niri
  version)
This commit is contained in:
bbedward
2025-08-18 11:17:33 -04:00
parent 4414b863c7
commit be9bd388c2
5 changed files with 344 additions and 4 deletions

View File

@@ -48,7 +48,10 @@ Item {
clear()
var items = []
var runningApps = NiriService.getRunningAppIds()
// Use ordered app IDs if available from Niri, fallback to unordered
var runningApps = NiriService.niriAvailable && NiriService.getRunningAppIdsOrdered
? NiriService.getRunningAppIdsOrdered()
: NiriService.getRunningAppIds()
var pinnedApps = [...(SessionData.pinnedApps || [])]
var addedApps = new Set()
@@ -73,6 +76,7 @@ Item {
var unpinnedAppsSet = new Set()
// First: Add ALL currently running apps that aren't pinned
// They come pre-ordered from NiriService if Niri is available
runningApps.forEach(appId => {
var lowerAppId = appId.toLowerCase()
if (!addedApps.has(lowerAppId)) {