Files
DankMaterialShell/quickshell/Modules/DankBar/WidgetModel.js
T
purian23 5623476126 feat(island): host the island as a widget in any bar configuration
- The island is now a bar widget so any bar can host one alongside the island layout and dot
- Routing got simpler: pick which shortcuts open here, the rest follow the shared rules
- IPC close/hide take down every surface showing the activity
- Qt 6.11 pointer prune workaround so the expanded island stays clickable
2026-09-27 02:02:30 -04:00

58 lines
2.0 KiB
JavaScript

.pragma library
function normalize(widgets) {
return (widgets || []).map((widget, index) => {
if (typeof widget === "string")
return { widgetId: widget, id: widget + "_" + index, enabled: true };
const entry = Object.assign({}, widget);
entry.widgetId = widget.id || widget.widgetId;
entry.id = entry.widgetId + "_" + index;
entry.enabled = widget.enabled !== false;
return entry;
});
}
var componentNames = {
"launcherButton": "launcherButtonComponent",
"workspaceSwitcher": "workspaceSwitcherComponent",
"focusedWindow": "focusedWindowComponent",
"runningApps": "runningAppsComponent",
"clock": "clockComponent",
"music": "mediaComponent",
"mediaActivity": "mediaActivityComponent",
"weather": "weatherComponent",
"systemTray": "systemTrayComponent",
"privacyIndicator": "privacyIndicatorComponent",
"clipboard": "clipboardComponent",
"cpuUsage": "cpuUsageComponent",
"memUsage": "memUsageComponent",
"diskUsage": "diskUsageComponent",
"cpuTemp": "cpuTempComponent",
"gpuTemp": "gpuTempComponent",
"notificationButton": "notificationButtonComponent",
"battery": "batteryComponent",
"controlCenterButton": "controlCenterButtonComponent",
"capsLockIndicator": "capsLockIndicatorComponent",
"idleInhibitor": "idleInhibitorComponent",
"spacer": "spacerComponent",
"separator": "separatorComponent",
"network_speed_monitor": "networkComponent",
"keyboard_layout_name": "keyboardLayoutNameComponent",
"vpn": "vpnComponent",
"notepadButton": "notepadButtonComponent",
"colorPicker": "colorPickerComponent",
"systemUpdate": "systemUpdateComponent",
"layout": "layoutComponent",
"powerMenuButton": "powerMenuButtonComponent",
"appsDock": "appsDockComponent",
"island": "islandComponent"
};
function builtinComponents(components) {
const result = {};
for (const id of Object.keys(componentNames))
result[id] = components[componentNames[id]];
return result;
}