summaryrefslogtreecommitdiff
path: root/raveos-hyprland-theme/theme-data/DankMaterialShell/quickshell/Modules/ControlCenter/utils/widgets.js
diff options
context:
space:
mode:
authorNippy <nippy@rp1.hu>2026-05-09 13:33:09 +0200
committerNippy <nippy@rp1.hu>2026-05-09 13:33:09 +0200
commita2b924d7e9492b978ad6dc33b6c1ffcb304b4bc5 (patch)
tree1a8769217f84bfe9d6216fafaadaf8cdd876d457 /raveos-hyprland-theme/theme-data/DankMaterialShell/quickshell/Modules/ControlCenter/utils/widgets.js
parent34b9c34f982b2596cfa9e368a2d7f74e9a17477c (diff)
downloadRaveOS-PKGBUILD-a2b924d7e9492b978ad6dc33b6c1ffcb304b4bc5.tar.gz
RaveOS-PKGBUILD-a2b924d7e9492b978ad6dc33b6c1ffcb304b4bc5.zip
raveos update
Diffstat (limited to 'raveos-hyprland-theme/theme-data/DankMaterialShell/quickshell/Modules/ControlCenter/utils/widgets.js')
-rw-r--r--raveos-hyprland-theme/theme-data/DankMaterialShell/quickshell/Modules/ControlCenter/utils/widgets.js90
1 files changed, 0 insertions, 90 deletions
diff --git a/raveos-hyprland-theme/theme-data/DankMaterialShell/quickshell/Modules/ControlCenter/utils/widgets.js b/raveos-hyprland-theme/theme-data/DankMaterialShell/quickshell/Modules/ControlCenter/utils/widgets.js
deleted file mode 100644
index 3e11d88..0000000
--- a/raveos-hyprland-theme/theme-data/DankMaterialShell/quickshell/Modules/ControlCenter/utils/widgets.js
+++ /dev/null
@@ -1,90 +0,0 @@
-function getWidgetForId(baseWidgetDefinitions, widgetId) {
- return baseWidgetDefinitions.find(w => w.id === widgetId)
-}
-
-function addWidget(widgetId) {
- var widgets = SettingsData.controlCenterWidgets.slice()
- var widget = {
- "id": widgetId,
- "enabled": true,
- "width": 50
- }
-
- if (widgetId === "diskUsage") {
- widget.instanceId = generateUniqueId()
- widget.mountPath = "/"
- }
-
- if (widgetId === "brightnessSlider") {
- widget.instanceId = generateUniqueId()
- widget.deviceName = ""
- }
-
- widgets.push(widget)
- SettingsData.set("controlCenterWidgets", widgets)
-}
-
-function generateUniqueId() {
- return Date.now().toString(36) + Math.random().toString(36).substr(2)
-}
-
-function removeWidget(index) {
- var widgets = SettingsData.controlCenterWidgets.slice()
- if (index >= 0 && index < widgets.length) {
- widgets.splice(index, 1)
- SettingsData.set("controlCenterWidgets", widgets)
- }
-}
-
-function toggleWidgetSize(index) {
- var widgets = SettingsData.controlCenterWidgets.slice()
- if (index >= 0 && index < widgets.length) {
- const currentWidth = widgets[index].width || 50
- const id = widgets[index].id || ""
-
- if (id === "wifi" || id === "bluetooth" || id === "audioOutput" || id === "audioInput") {
- widgets[index].width = currentWidth <= 50 ? 100 : 50
- } else {
- if (currentWidth <= 25) {
- widgets[index].width = 50
- } else if (currentWidth <= 50) {
- widgets[index].width = 100
- } else {
- widgets[index].width = 25
- }
- }
-
- SettingsData.set("controlCenterWidgets", widgets)
- }
-}
-
-function reorderWidgets(newOrder) {
- SettingsData.set("controlCenterWidgets", newOrder)
-}
-
-function moveWidget(fromIndex, toIndex) {
- let widgets = [...(SettingsData.controlCenterWidgets || [])]
- if (fromIndex >= 0 && fromIndex < widgets.length && toIndex >= 0 && toIndex < widgets.length) {
- const movedWidget = widgets.splice(fromIndex, 1)[0]
- widgets.splice(toIndex, 0, movedWidget)
- SettingsData.set("controlCenterWidgets", widgets)
- }
-}
-
-function resetToDefault() {
- const defaultWidgets = [
- {"id": "volumeSlider", "enabled": true, "width": 50},
- {"id": "brightnessSlider", "enabled": true, "width": 50},
- {"id": "wifi", "enabled": true, "width": 50},
- {"id": "bluetooth", "enabled": true, "width": 50},
- {"id": "audioOutput", "enabled": true, "width": 50},
- {"id": "audioInput", "enabled": true, "width": 50},
- {"id": "nightMode", "enabled": true, "width": 50},
- {"id": "darkMode", "enabled": true, "width": 50}
- ]
- SettingsData.set("controlCenterWidgets", defaultWidgets)
-}
-
-function clearAll() {
- SettingsData.set("controlCenterWidgets", [])
-}