1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-01-24 21:42:51 -05:00

wallpaper: fix per-monitor dankdash tab + allow matugen override

per-monitor

fixes #561
This commit is contained in:
bbedward
2025-10-27 15:36:07 -04:00
parent 7e5c6581c9
commit 7a3884a633
6 changed files with 676 additions and 442 deletions

View File

@@ -1,4 +1,5 @@
pragma Singleton
pragma ComponentBehavior: Bound
import QtCore
@@ -151,7 +152,8 @@ Singleton {
}
function saveSettings() {
if (isGreeterMode) return
if (isGreeterMode)
return
settingsFile.setText(JSON.stringify({
"isLightMode": isLightMode,
"wallpaperPath": wallpaperPath,
@@ -244,23 +246,12 @@ Singleton {
}
function cleanupUnusedKeys() {
const validKeys = [
"isLightMode", "wallpaperPath", "perMonitorWallpaper", "monitorWallpapers", "perModeWallpaper",
"wallpaperPathLight", "wallpaperPathDark", "monitorWallpapersLight",
"monitorWallpapersDark", "doNotDisturb", "nightModeEnabled",
"nightModeTemperature", "nightModeAutoEnabled", "nightModeAutoMode",
"nightModeStartHour", "nightModeStartMinute", "nightModeEndHour",
"nightModeEndMinute", "latitude", "longitude", "nightModeUseIPLocation", "nightModeLocationProvider",
"pinnedApps", "selectedGpuIndex", "nvidiaGpuTempEnabled",
"nonNvidiaGpuTempEnabled", "enabledGpuPciIds", "wallpaperCyclingEnabled",
"wallpaperCyclingMode", "wallpaperCyclingInterval", "wallpaperCyclingTime",
"monitorCyclingSettings", "lastBrightnessDevice", "launchPrefix", "wallpaperTransition",
"includedTransitions", "recentColors", "showThirdPartyPlugins", "configVersion"
]
const validKeys = ["isLightMode", "wallpaperPath", "perMonitorWallpaper", "monitorWallpapers", "perModeWallpaper", "wallpaperPathLight", "wallpaperPathDark", "monitorWallpapersLight", "monitorWallpapersDark", "doNotDisturb", "nightModeEnabled", "nightModeTemperature", "nightModeAutoEnabled", "nightModeAutoMode", "nightModeStartHour", "nightModeStartMinute", "nightModeEndHour", "nightModeEndMinute", "latitude", "longitude", "nightModeUseIPLocation", "nightModeLocationProvider", "pinnedApps", "selectedGpuIndex", "nvidiaGpuTempEnabled", "nonNvidiaGpuTempEnabled", "enabledGpuPciIds", "wallpaperCyclingEnabled", "wallpaperCyclingMode", "wallpaperCyclingInterval", "wallpaperCyclingTime", "monitorCyclingSettings", "lastBrightnessDevice", "launchPrefix", "wallpaperTransition", "includedTransitions", "recentColors", "showThirdPartyPlugins", "configVersion"]
try {
const content = settingsFile.text()
if (!content || !content.trim()) return
if (!content || !content.trim())
return
const settings = JSON.parse(content)
let needsSave = false
@@ -425,10 +416,13 @@ Singleton {
saveSettings()
if (typeof Theme !== "undefined" && typeof Quickshell !== "undefined") {
if (typeof Theme !== "undefined" && typeof Quickshell !== "undefined" && typeof SettingsData !== "undefined") {
var screens = Quickshell.screens
if (screens.length > 0 && screenName === screens[0].name) {
Theme.generateSystemThemesFromCurrentTheme()
if (screens.length > 0) {
var targetMonitor = (SettingsData.matugenTargetMonitor && SettingsData.matugenTargetMonitor !== "") ? SettingsData.matugenTargetMonitor : screens[0].name
if (screenName === targetMonitor) {
Theme.generateSystemThemesFromCurrentTheme()
}
}
}
}
@@ -461,7 +455,12 @@ Singleton {
function setMonitorCyclingEnabled(screenName, enabled) {
var newSettings = Object.assign({}, monitorCyclingSettings)
if (!newSettings[screenName]) {
newSettings[screenName] = { enabled: false, mode: "interval", interval: 300, time: "06:00" }
newSettings[screenName] = {
"enabled": false,
"mode": "interval",
"interval": 300,
"time": "06:00"
}
}
newSettings[screenName].enabled = enabled
monitorCyclingSettings = newSettings
@@ -471,7 +470,12 @@ Singleton {
function setMonitorCyclingMode(screenName, mode) {
var newSettings = Object.assign({}, monitorCyclingSettings)
if (!newSettings[screenName]) {
newSettings[screenName] = { enabled: false, mode: "interval", interval: 300, time: "06:00" }
newSettings[screenName] = {
"enabled": false,
"mode": "interval",
"interval": 300,
"time": "06:00"
}
}
newSettings[screenName].mode = mode
monitorCyclingSettings = newSettings
@@ -481,7 +485,12 @@ Singleton {
function setMonitorCyclingInterval(screenName, interval) {
var newSettings = Object.assign({}, monitorCyclingSettings)
if (!newSettings[screenName]) {
newSettings[screenName] = { enabled: false, mode: "interval", interval: 300, time: "06:00" }
newSettings[screenName] = {
"enabled": false,
"mode": "interval",
"interval": 300,
"time": "06:00"
}
}
newSettings[screenName].interval = interval
monitorCyclingSettings = newSettings
@@ -491,7 +500,12 @@ Singleton {
function setMonitorCyclingTime(screenName, time) {
var newSettings = Object.assign({}, monitorCyclingSettings)
if (!newSettings[screenName]) {
newSettings[screenName] = { enabled: false, mode: "interval", interval: 300, time: "06:00" }
newSettings[screenName] = {
"enabled": false,
"mode": "interval",
"interval": 300,
"time": "06:00"
}
}
newSettings[screenName].time = time
monitorCyclingSettings = newSettings
@@ -592,7 +606,8 @@ Singleton {
let recent = recentColors.slice()
recent = recent.filter(c => c !== colorStr)
recent.unshift(colorStr)
if (recent.length > 5) recent = recent.slice(0, 5)
if (recent.length > 5)
recent = recent.slice(0, 5)
recentColors = recent
saveSettings()
}
@@ -633,7 +648,8 @@ Singleton {
}
function syncWallpaperForCurrentMode() {
if (!perModeWallpaper) return
if (!perModeWallpaper)
return
if (perMonitorWallpaper) {
monitorWallpapers = isLightMode ? Object.assign({}, monitorWallpapersLight) : Object.assign({}, monitorWallpapersDark)
@@ -652,10 +668,10 @@ Singleton {
function getMonitorCyclingSettings(screenName) {
return monitorCyclingSettings[screenName] || {
enabled: false,
mode: "interval",
interval: 300,
time: "06:00"
"enabled": false,
"mode": "interval",
"interval": 300,
"time": "06:00"
}
}

View File

@@ -51,6 +51,7 @@ Singleton {
property string customThemeFile: ""
property string matugenScheme: "scheme-tonal-spot"
property bool runUserMatugenTemplates: true
property string matugenTargetMonitor: ""
property real dankBarTransparency: 1.0
property real dankBarWidgetTransparency: 1.0
property real popupTransparency: 1.0
@@ -90,16 +91,39 @@ Singleton {
property bool controlCenterShowNetworkIcon: true
property bool controlCenterShowBluetoothIcon: true
property bool controlCenterShowAudioIcon: true
property var controlCenterWidgets: [
{"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}
]
property var controlCenterWidgets: [{
"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
}]
property bool showWorkspaceIndex: false
property bool showWorkspacePadding: false
@@ -331,8 +355,14 @@ Singleton {
customThemeFile = settings.customThemeFile !== undefined ? settings.customThemeFile : ""
matugenScheme = settings.matugenScheme !== undefined ? settings.matugenScheme : "scheme-tonal-spot"
runUserMatugenTemplates = settings.runUserMatugenTemplates !== undefined ? settings.runUserMatugenTemplates : true
dankBarTransparency = settings.dankBarTransparency !== undefined ? (settings.dankBarTransparency > 1 ? settings.dankBarTransparency / 100 : settings.dankBarTransparency) : (settings.topBarTransparency !== undefined ? (settings.topBarTransparency > 1 ? settings.topBarTransparency / 100 : settings.topBarTransparency) : 1.0)
dankBarWidgetTransparency = settings.dankBarWidgetTransparency !== undefined ? (settings.dankBarWidgetTransparency > 1 ? settings.dankBarWidgetTransparency / 100 : settings.dankBarWidgetTransparency) : (settings.topBarWidgetTransparency !== undefined ? (settings.topBarWidgetTransparency > 1 ? settings.topBarWidgetTransparency / 100 : settings.topBarWidgetTransparency) : 1.0)
matugenTargetMonitor = settings.matugenTargetMonitor !== undefined ? settings.matugenTargetMonitor : ""
dankBarTransparency = settings.dankBarTransparency
!== undefined ? (settings.dankBarTransparency > 1 ? settings.dankBarTransparency
/ 100 : settings.dankBarTransparency) : (settings.topBarTransparency !== undefined ? (settings.topBarTransparency > 1 ? settings.topBarTransparency / 100 : settings.topBarTransparency) : 1.0)
dankBarWidgetTransparency = settings.dankBarWidgetTransparency
!== undefined ? (settings.dankBarWidgetTransparency
> 1 ? settings.dankBarWidgetTransparency
/ 100 : settings.dankBarWidgetTransparency) : (settings.topBarWidgetTransparency !== undefined ? (settings.topBarWidgetTransparency > 1 ? settings.topBarWidgetTransparency / 100 : settings.topBarWidgetTransparency) : 1.0)
popupTransparency = settings.popupTransparency !== undefined ? (settings.popupTransparency > 1 ? settings.popupTransparency / 100 : settings.popupTransparency) : 1.0
dockTransparency = settings.dockTransparency !== undefined ? (settings.dockTransparency > 1 ? settings.dockTransparency / 100 : settings.dockTransparency) : 1
use24HourClock = settings.use24HourClock !== undefined ? settings.use24HourClock : true
@@ -363,16 +393,39 @@ Singleton {
controlCenterShowNetworkIcon = settings.controlCenterShowNetworkIcon !== undefined ? settings.controlCenterShowNetworkIcon : true
controlCenterShowBluetoothIcon = settings.controlCenterShowBluetoothIcon !== undefined ? settings.controlCenterShowBluetoothIcon : true
controlCenterShowAudioIcon = settings.controlCenterShowAudioIcon !== undefined ? settings.controlCenterShowAudioIcon : true
controlCenterWidgets = settings.controlCenterWidgets !== undefined ? settings.controlCenterWidgets : [
{"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}
]
controlCenterWidgets = settings.controlCenterWidgets !== undefined ? settings.controlCenterWidgets : [{
"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
}]
showWorkspaceIndex = settings.showWorkspaceIndex !== undefined ? settings.showWorkspaceIndex : false
showWorkspacePadding = settings.showWorkspacePadding !== undefined ? settings.showWorkspacePadding : false
workspaceScrolling = settings.workspaceScrolling !== undefined ? settings.workspaceScrolling : false
@@ -393,18 +446,19 @@ Singleton {
if (settings.dankBarWidgetOrder || settings.topBarWidgetOrder) {
var widgetOrder = settings.dankBarWidgetOrder || settings.topBarWidgetOrder
dankBarLeftWidgets = widgetOrder.filter(w => {
return ["launcherButton", "workspaceSwitcher", "focusedWindow"].includes(w)
})
return ["launcherButton", "workspaceSwitcher", "focusedWindow"].includes(w)
})
dankBarCenterWidgets = widgetOrder.filter(w => {
return ["clock", "music", "weather"].includes(w)
})
return ["clock", "music", "weather"].includes(w)
})
dankBarRightWidgets = widgetOrder.filter(w => {
return ["systemTray", "clipboard", "systemResources", "notificationButton", "battery", "controlCenterButton"].includes(w)
})
return ["systemTray", "clipboard", "systemResources", "notificationButton", "battery", "controlCenterButton"].includes(w)
})
} else {
var leftWidgets = settings.dankBarLeftWidgets !== undefined ? settings.dankBarLeftWidgets : (settings.topBarLeftWidgets !== undefined ? settings.topBarLeftWidgets : ["launcherButton", "workspaceSwitcher", "focusedWindow"])
var centerWidgets = settings.dankBarCenterWidgets !== undefined ? settings.dankBarCenterWidgets : (settings.topBarCenterWidgets !== undefined ? settings.topBarCenterWidgets : ["music", "clock", "weather"])
var rightWidgets = settings.dankBarRightWidgets !== undefined ? settings.dankBarRightWidgets : (settings.topBarRightWidgets !== undefined ? settings.topBarRightWidgets : ["systemTray", "clipboard", "cpuUsage", "memUsage", "notificationButton", "battery", "controlCenterButton"])
var rightWidgets = settings.dankBarRightWidgets
!== undefined ? settings.dankBarRightWidgets : (settings.topBarRightWidgets !== undefined ? settings.topBarRightWidgets : ["systemTray", "clipboard", "cpuUsage", "memUsage", "notificationButton", "battery", "controlCenterButton"])
dankBarLeftWidgets = leftWidgets
dankBarCenterWidgets = centerWidgets
dankBarRightWidgets = rightWidgets
@@ -476,9 +530,9 @@ Singleton {
customPowerActionHibernate = settings.customPowerActionHibernate != undefined ? settings.customPowerActionHibernate : ""
customPowerActionReboot = settings.customPowerActionReboot != undefined ? settings.customPowerActionReboot : ""
customPowerActionPowerOff = settings.customPowerActionPowerOff != undefined ? settings.customPowerActionPowerOff : ""
updaterUseCustomCommand = settings.updaterUseCustomCommand !== undefined ? settings.updaterUseCustomCommand : false;
updaterCustomCommand = settings.updaterCustomCommand !== undefined ? settings.updaterCustomCommand : "";
updaterTerminalAdditionalParams = settings.updaterTerminalAdditionalParams !== undefined ? settings.updaterTerminalAdditionalParams : "";
updaterUseCustomCommand = settings.updaterUseCustomCommand !== undefined ? settings.updaterUseCustomCommand : false
updaterCustomCommand = settings.updaterCustomCommand !== undefined ? settings.updaterCustomCommand : ""
updaterTerminalAdditionalParams = settings.updaterTerminalAdditionalParams !== undefined ? settings.updaterTerminalAdditionalParams : ""
dankBarSpacing = settings.dankBarSpacing !== undefined ? settings.dankBarSpacing : (settings.topBarSpacing !== undefined ? settings.topBarSpacing : 4)
dankBarBottomGap = settings.dankBarBottomGap !== undefined ? settings.dankBarBottomGap : (settings.topBarBottomGap !== undefined ? settings.topBarBottomGap : 0)
dankBarInnerPadding = settings.dankBarInnerPadding !== undefined ? settings.dankBarInnerPadding : (settings.topBarInnerPadding !== undefined ? settings.topBarInnerPadding : 4)
@@ -491,7 +545,8 @@ Singleton {
dankBarBorderThickness = settings.dankBarBorderThickness !== undefined ? settings.dankBarBorderThickness : 1
popupGapsAuto = settings.popupGapsAuto !== undefined ? settings.popupGapsAuto : true
popupGapsManual = settings.popupGapsManual !== undefined ? settings.popupGapsManual : 4
dankBarPosition = settings.dankBarPosition !== undefined ? settings.dankBarPosition : (settings.dankBarAtBottom !== undefined ? (settings.dankBarAtBottom ? SettingsData.Position.Bottom : SettingsData.Position.Top) : (settings.topBarAtBottom !== undefined ? (settings.topBarAtBottom ? SettingsData.Position.Bottom : SettingsData.Position.Top) : SettingsData.Position.Top))
dankBarPosition = settings.dankBarPosition
!== undefined ? settings.dankBarPosition : (settings.dankBarAtBottom !== undefined ? (settings.dankBarAtBottom ? SettingsData.Position.Bottom : SettingsData.Position.Top) : (settings.topBarAtBottom !== undefined ? (settings.topBarAtBottom ? SettingsData.Position.Bottom : SettingsData.Position.Top) : SettingsData.Position.Top))
lockScreenShowPowerActions = settings.lockScreenShowPowerActions !== undefined ? settings.lockScreenShowPowerActions : true
enableFprint = settings.enableFprint !== undefined ? settings.enableFprint : false
maxFprintTries = settings.maxFprintTries !== undefined ? settings.maxFprintTries : 3
@@ -552,6 +607,7 @@ Singleton {
"customThemeFile": customThemeFile,
"matugenScheme": matugenScheme,
"runUserMatugenTemplates": runUserMatugenTemplates,
"matugenTargetMonitor": matugenTargetMonitor,
"dankBarTransparency": dankBarTransparency,
"dankBarWidgetTransparency": dankBarWidgetTransparency,
"popupTransparency": popupTransparency,
@@ -718,52 +774,12 @@ Singleton {
}
function cleanupUnusedKeys() {
const validKeys = [
"currentThemeName", "customThemeFile", "matugenScheme", "runUserMatugenTemplates",
"dankBarTransparency", "dankBarWidgetTransparency", "popupTransparency", "dockTransparency",
"use24HourClock", "showSeconds", "useFahrenheit", "nightModeEnabled", "weatherLocation",
"weatherCoordinates", "useAutoLocation", "weatherEnabled", "showLauncherButton",
"showWorkspaceSwitcher", "showFocusedWindow", "showWeather", "showMusic",
"showClipboard", "showCpuUsage", "showMemUsage", "showCpuTemp", "showGpuTemp",
"selectedGpuIndex", "enabledGpuPciIds", "showSystemTray", "showClock",
"showNotificationButton", "showBattery", "showControlCenterButton",
"controlCenterShowNetworkIcon", "controlCenterShowBluetoothIcon", "controlCenterShowAudioIcon",
"controlCenterWidgets", "showWorkspaceIndex", "workspaceScrolling", "showWorkspacePadding", "showWorkspaceApps",
"maxWorkspaceIcons", "workspacesPerMonitor", "workspaceNameIcons", "waveProgressEnabled",
"clockCompactMode", "focusedWindowCompactMode", "runningAppsCompactMode", "keyboardLayoutNameCompactMode",
"runningAppsCurrentWorkspace", "runningAppsGroupByApp", "clockDateFormat", "lockDateFormat", "mediaSize",
"dankBarLeftWidgets", "dankBarCenterWidgets", "dankBarRightWidgets",
"appLauncherViewMode", "spotlightModalViewMode", "sortAppsAlphabetically",
"networkPreference", "iconTheme", "launcherLogoMode", "launcherLogoCustomPath",
"launcherLogoColorOverride", "launcherLogoColorInvertOnMode", "launcherLogoBrightness",
"launcherLogoContrast", "launcherLogoSizeOffset", "fontFamily", "monoFontFamily",
"fontWeight", "fontScale", "dankBarFontScale", "notepadUseMonospace",
"notepadFontFamily", "notepadFontSize", "notepadShowLineNumbers",
"notepadTransparencyOverride", "notepadLastCustomTransparency", "soundsEnabled",
"useSystemSoundTheme", "soundNewNotification", "soundVolumeChanged", "soundPluggedIn", "gtkThemingEnabled",
"qtThemingEnabled", "syncModeWithPortal", "showDock", "dockAutoHide", "dockGroupByApp",
"dockOpenOnOverview", "dockPosition", "dockSpacing", "dockBottomGap", "dockIconSize", "dockIndicatorStyle",
"cornerRadius", "notificationOverlayEnabled", "dankBarAutoHide",
"dankBarOpenOnOverview", "dankBarVisible", "dankBarSpacing", "dankBarBottomGap",
"dankBarInnerPadding", "dankBarSquareCorners", "dankBarNoBackground",
"dankBarGothCornersEnabled", "dankBarBorderEnabled", "dankBarBorderColor",
"dankBarBorderOpacity", "dankBarBorderThickness", "popupGapsAuto", "popupGapsManual",
"dankBarPosition", "lockScreenShowPowerActions", "enableFprint", "maxFprintTries",
"hideBrightnessSlider", "widgetBackgroundColor", "surfaceBase", "wallpaperFillMode",
"blurredWallpaperLayer", "blurWallpaperOnOverview", "notificationTimeoutLow", "notificationTimeoutNormal", "notificationTimeoutCritical",
"notificationPopupPosition", "osdAlwaysShowValue", "powerActionConfirm",
"customPowerActionLock", "customPowerActionLogout", "customPowerActionSuspend",
"customPowerActionHibernate", "customPowerActionReboot", "customPowerActionPowerOff",
"updaterUseCustomCommand", "updaterCustomCommand", "updaterTerminalAdditionalParams",
"screenPreferences", "showOnLastDisplay", "animationSpeed", "customAnimationDuration", "acMonitorTimeout", "acLockTimeout",
"acSuspendTimeout", "acHibernateTimeout", "batteryMonitorTimeout", "batteryLockTimeout",
"batterySuspendTimeout", "batteryHibernateTimeout", "lockBeforeSuspend",
"loginctlLockIntegration", "launchPrefix", "brightnessDevicePins", "configVersion"
]
const validKeys = ["currentThemeName", "customThemeFile", "matugenScheme", "runUserMatugenTemplates", "matugenTargetMonitor", "dankBarTransparency", "dankBarWidgetTransparency", "popupTransparency", "dockTransparency", "use24HourClock", "showSeconds", "useFahrenheit", "nightModeEnabled", "weatherLocation", "weatherCoordinates", "useAutoLocation", "weatherEnabled", "showLauncherButton", "showWorkspaceSwitcher", "showFocusedWindow", "showWeather", "showMusic", "showClipboard", "showCpuUsage", "showMemUsage", "showCpuTemp", "showGpuTemp", "selectedGpuIndex", "enabledGpuPciIds", "showSystemTray", "showClock", "showNotificationButton", "showBattery", "showControlCenterButton", "controlCenterShowNetworkIcon", "controlCenterShowBluetoothIcon", "controlCenterShowAudioIcon", "controlCenterWidgets", "showWorkspaceIndex", "workspaceScrolling", "showWorkspacePadding", "showWorkspaceApps", "maxWorkspaceIcons", "workspacesPerMonitor", "workspaceNameIcons", "waveProgressEnabled", "clockCompactMode", "focusedWindowCompactMode", "runningAppsCompactMode", "keyboardLayoutNameCompactMode", "runningAppsCurrentWorkspace", "runningAppsGroupByApp", "clockDateFormat", "lockDateFormat", "mediaSize", "dankBarLeftWidgets", "dankBarCenterWidgets", "dankBarRightWidgets", "appLauncherViewMode", "spotlightModalViewMode", "sortAppsAlphabetically", "networkPreference", "iconTheme", "launcherLogoMode", "launcherLogoCustomPath", "launcherLogoColorOverride", "launcherLogoColorInvertOnMode", "launcherLogoBrightness", "launcherLogoContrast", "launcherLogoSizeOffset", "fontFamily", "monoFontFamily", "fontWeight", "fontScale", "dankBarFontScale", "notepadUseMonospace", "notepadFontFamily", "notepadFontSize", "notepadShowLineNumbers", "notepadTransparencyOverride", "notepadLastCustomTransparency", "soundsEnabled", "useSystemSoundTheme", "soundNewNotification", "soundVolumeChanged", "soundPluggedIn", "gtkThemingEnabled", "qtThemingEnabled", "syncModeWithPortal", "showDock", "dockAutoHide", "dockGroupByApp", "dockOpenOnOverview", "dockPosition", "dockSpacing", "dockBottomGap", "dockIconSize", "dockIndicatorStyle", "cornerRadius", "notificationOverlayEnabled", "dankBarAutoHide", "dankBarOpenOnOverview", "dankBarVisible", "dankBarSpacing", "dankBarBottomGap", "dankBarInnerPadding", "dankBarSquareCorners", "dankBarNoBackground", "dankBarGothCornersEnabled", "dankBarBorderEnabled", "dankBarBorderColor", "dankBarBorderOpacity", "dankBarBorderThickness", "popupGapsAuto", "popupGapsManual", "dankBarPosition", "lockScreenShowPowerActions", "enableFprint", "maxFprintTries", "hideBrightnessSlider", "widgetBackgroundColor", "surfaceBase", "wallpaperFillMode", "blurredWallpaperLayer", "blurWallpaperOnOverview", "notificationTimeoutLow", "notificationTimeoutNormal", "notificationTimeoutCritical", "notificationPopupPosition", "osdAlwaysShowValue", "powerActionConfirm", "customPowerActionLock", "customPowerActionLogout", "customPowerActionSuspend", "customPowerActionHibernate", "customPowerActionReboot", "customPowerActionPowerOff", "updaterUseCustomCommand", "updaterCustomCommand", "updaterTerminalAdditionalParams", "screenPreferences", "showOnLastDisplay", "animationSpeed", "customAnimationDuration", "acMonitorTimeout", "acLockTimeout", "acSuspendTimeout", "acHibernateTimeout", "batteryMonitorTimeout", "batteryLockTimeout", "batterySuspendTimeout", "batteryHibernateTimeout", "lockBeforeSuspend", "loginctlLockIntegration", "launchPrefix", "brightnessDevicePins", "configVersion"]
try {
const content = settingsFile.text()
if (!content || !content.trim()) return
if (!content || !content.trim())
return
const settings = JSON.parse(content)
let needsSave = false
@@ -788,7 +804,7 @@ Singleton {
if (use24HourClock) {
return showSeconds ? "hh:mm:ss" : "hh:mm"
} else {
return showSeconds ? "h:mm:ss AP": "h:mm AP"
return showSeconds ? "h:mm:ss AP" : "h:mm AP"
}
}
@@ -899,10 +915,12 @@ Singleton {
PortalService.setSystemIconTheme(gtkThemeName)
}
var configScript = "mkdir -p " + _configDir + "/gtk-3.0 " + _configDir + "/gtk-4.0\n" + "\n" + "for config_dir in " + _configDir + "/gtk-3.0 " + _configDir + "/gtk-4.0; do\n"
+ " settings_file=\"$config_dir/settings.ini\"\n" + " if [ -f \"$settings_file\" ]; then\n" + " if grep -q '^gtk-icon-theme-name=' \"$settings_file\"; then\n" + " sed -i 's/^gtk-icon-theme-name=.*/gtk-icon-theme-name=" + gtkThemeName + "/' \"$settings_file\"\n" + " else\n"
+ " if grep -q '\\[Settings\\]' \"$settings_file\"; then\n" + " sed -i '/\\[Settings\\]/a gtk-icon-theme-name=" + gtkThemeName + "' \"$settings_file\"\n" + " else\n" + " echo -e '\\n[Settings]\\ngtk-icon-theme-name=" + gtkThemeName + "' >> \"$settings_file\"\n" + " fi\n"
+ " fi\n" + " else\n" + " echo -e '[Settings]\\ngtk-icon-theme-name=" + gtkThemeName + "' > \"$settings_file\"\n" + " fi\n" + "done\n" + "\n" + "rm -rf ~/.cache/icon-cache ~/.cache/thumbnails 2>/dev/null || true\n" + "pkill -HUP -f 'gtk' 2>/dev/null || true\n"
var configScript = "mkdir -p " + _configDir + "/gtk-3.0 " + _configDir + "/gtk-4.0\n" + "\n" + "for config_dir in " + _configDir + "/gtk-3.0 "
+ _configDir + "/gtk-4.0; do\n" + " settings_file=\"$config_dir/settings.ini\"\n" + " if [ -f \"$settings_file\" ]; then\n"
+ " if grep -q '^gtk-icon-theme-name=' \"$settings_file\"; then\n" + " sed -i 's/^gtk-icon-theme-name=.*/gtk-icon-theme-name=" + gtkThemeName + "/' \"$settings_file\"\n"
+ " else\n" + " if grep -q '\\[Settings\\]' \"$settings_file\"; then\n" + " sed -i '/\\[Settings\\]/a gtk-icon-theme-name=" + gtkThemeName
+ "' \"$settings_file\"\n" + " else\n" + " echo -e '\\n[Settings]\\ngtk-icon-theme-name=" + gtkThemeName + "' >> \"$settings_file\"\n" + " fi\n" + " fi\n" + " else\n"
+ " echo -e '[Settings]\\ngtk-icon-theme-name=" + gtkThemeName + "' > \"$settings_file\"\n" + " fi\n" + "done\n" + "\n" + "rm -rf ~/.cache/icon-cache ~/.cache/thumbnails 2>/dev/null || true\n" + "pkill -HUP -f 'gtk' 2>/dev/null || true\n"
Quickshell.execDetached(["sh", "-lc", configScript])
}
}
@@ -914,9 +932,11 @@ Singleton {
return
}
var script = "mkdir -p " + _configDir + "/qt5ct " + _configDir + "/qt6ct " + _configDir + "/environment.d 2>/dev/null || true\n" + "update_qt_icon_theme() {\n" + " local config_file=\"$1\"\n"
+ " local theme_name=\"$2\"\n" + " if [ -f \"$config_file\" ]; then\n" + " if grep -q '^\\[Appearance\\]' \"$config_file\"; then\n" + " if grep -q '^icon_theme=' \"$config_file\"; then\n" + " sed -i \"s/^icon_theme=.*/icon_theme=$theme_name/\" \"$config_file\"\n" + " else\n" + " sed -i \"/^\\[Appearance\\]/a icon_theme=$theme_name\" \"$config_file\"\n" + " fi\n"
+ " else\n" + " printf '\\n[Appearance]\\nicon_theme=%s\\n' \"$theme_name\" >> \"$config_file\"\n" + " fi\n" + " else\n" + " printf '[Appearance]\\nicon_theme=%s\\n' \"$theme_name\" > \"$config_file\"\n" + " fi\n" + "}\n" + "update_qt_icon_theme " + _configDir + "/qt5ct/qt5ct.conf " + _shq(
qtThemeName) + "\n" + "update_qt_icon_theme " + _configDir + "/qt6ct/qt6ct.conf " + _shq(qtThemeName) + "\n" + "rm -rf " + home + "/.cache/icon-cache " + home + "/.cache/thumbnails 2>/dev/null || true\n"
+ " local theme_name=\"$2\"\n" + " if [ -f \"$config_file\" ]; then\n" + " if grep -q '^\\[Appearance\\]' \"$config_file\"; then\n" + " if grep -q '^icon_theme=' \"$config_file\"; then\n"
+ " sed -i \"s/^icon_theme=.*/icon_theme=$theme_name/\" \"$config_file\"\n" + " else\n" + " sed -i \"/^\\[Appearance\\]/a icon_theme=$theme_name\" \"$config_file\"\n" + " fi\n"
+ " else\n" + " printf '\\n[Appearance]\\nicon_theme=%s\\n' \"$theme_name\" >> \"$config_file\"\n" + " fi\n" + " else\n"
+ " printf '[Appearance]\\nicon_theme=%s\\n' \"$theme_name\" > \"$config_file\"\n" + " fi\n" + "}\n" + "update_qt_icon_theme " + _configDir + "/qt5ct/qt5ct.conf " + _shq(qtThemeName)
+ "\n" + "update_qt_icon_theme " + _configDir + "/qt6ct/qt6ct.conf " + _shq(qtThemeName) + "\n" + "rm -rf " + home + "/.cache/icon-cache " + home + "/.cache/thumbnails 2>/dev/null || true\n"
Quickshell.execDetached(["sh", "-lc", script])
}
@@ -938,15 +958,15 @@ Singleton {
if (dankBarPosition === SettingsData.Position.Left || dankBarPosition === SettingsData.Position.Right) {
return {
x: relativeY,
y: barThickness + dankBarSpacing + Theme.popupDistance,
width: widgetWidth
"x": relativeY,
"y": barThickness + dankBarSpacing + Theme.popupDistance,
"width": widgetWidth
}
}
return {
x: relativeX,
y: barThickness + dankBarSpacing + dankBarBottomGap + Theme.popupDistance,
width: widgetWidth
"x": relativeX,
"y": barThickness + dankBarSpacing + dankBarBottomGap + Theme.popupDistance,
"width": widgetWidth
}
}
@@ -969,11 +989,7 @@ Singleton {
}
function sendTestNotification(index) {
const notifications = [
["Notification Position Test", "DMS test notification 1 of 3 ~ Hi there!", "preferences-system"],
["Second Test", "DMS Notification 2 of 3 ~ Check it out!", "applications-graphics"],
["Third Test", "DMS notification 3 of 3 ~ Enjoy!", "face-smile"]
]
const notifications = [["Notification Position Test", "DMS test notification 1 of 3 ~ Hi there!", "preferences-system"], ["Second Test", "DMS Notification 2 of 3 ~ Check it out!", "applications-graphics"], ["Third Test", "DMS notification 3 of 3 ~ Enjoy!", "face-smile"]]
if (index < 0 || index >= notifications.length) {
return
@@ -1023,6 +1039,18 @@ Singleton {
}
}
function setMatugenTargetMonitor(monitorName) {
if (matugenTargetMonitor === monitorName)
return
matugenTargetMonitor = monitorName
saveSettings()
if (typeof Theme !== "undefined") {
Theme.generateSystemThemesFromCurrentTheme()
}
}
function setDankBarTransparency(transparency) {
dankBarTransparency = transparency
saveSettings()
@@ -1795,53 +1823,53 @@ Singleton {
}
function setPowerActionConfirm(confirm) {
powerActionConfirm = confirm;
saveSettings();
powerActionConfirm = confirm
saveSettings()
}
function setCustomPowerActionLock(command) {
customPowerActionLock = command;
saveSettings();
customPowerActionLock = command
saveSettings()
}
function setCustomPowerActionLogout(command) {
customPowerActionLogout = command;
saveSettings();
customPowerActionLogout = command
saveSettings()
}
function setCustomPowerActionSuspend(command) {
customPowerActionSuspend = command;
saveSettings();
customPowerActionSuspend = command
saveSettings()
}
function setCustomPowerActionHibernate(command) {
customPowerActionHibernate = command;
saveSettings();
customPowerActionHibernate = command
saveSettings()
}
function setCustomPowerActionReboot(command) {
customPowerActionReboot = command;
saveSettings();
customPowerActionReboot = command
saveSettings()
}
function setCustomPowerActionPowerOff(command) {
customPowerActionPowerOff = command;
saveSettings();
customPowerActionPowerOff = command
saveSettings()
}
function setUpdaterUseCustomCommandEnabled(enabled) {
updaterUseCustomCommand = enabled;
saveSettings();
updaterUseCustomCommand = enabled
saveSettings()
}
function setUpdaterCustomCommand(command) {
updaterCustomCommand = command;
saveSettings();
updaterCustomCommand = command
saveSettings()
}
function setUpdaterTerminalAdditionalParams(customArgs) {
updaterTerminalAdditionalParams = customArgs;
saveSettings();
updaterTerminalAdditionalParams = customArgs
saveSettings()
}
function setScreenPreferences(prefs) {

View File

@@ -19,7 +19,8 @@ Singleton {
readonly property bool envDisableMatugen: Quickshell.env("DMS_DISABLE_MATUGEN") === "1" || Quickshell.env("DMS_DISABLE_MATUGEN") === "true"
readonly property real popupDistance: {
if (typeof SettingsData === "undefined") return 4
if (typeof SettingsData === "undefined")
return 4
return SettingsData.popupGapsAuto ? Math.max(4, SettingsData.dankBarSpacing) : SettingsData.popupGapsManual
}
@@ -29,13 +30,14 @@ Singleton {
property bool colorsFileLoadFailed: false
readonly property string dynamic: "dynamic"
readonly property string custom : "custom"
readonly property string custom: "custom"
readonly property string homeDir: Paths.strip(StandardPaths.writableLocation(StandardPaths.HomeLocation))
readonly property string configDir: Paths.strip(StandardPaths.writableLocation(StandardPaths.ConfigLocation))
readonly property string shellDir: Paths.strip(Qt.resolvedUrl(".").toString()).replace("/Common/", "")
readonly property string wallpaperPath: {
if (typeof SessionData === "undefined") return ""
if (typeof SessionData === "undefined")
return ""
if (SessionData.perMonitorWallpaper) {
var screens = Quickshell.screens
@@ -60,14 +62,28 @@ Singleton {
return wallpaperPath
}
readonly property string rawWallpaperPath: {
if (typeof SessionData === "undefined") return ""
if (typeof SessionData === "undefined")
return ""
if (SessionData.perMonitorWallpaper) {
// Use first monitor's wallpaper for dynamic theming
var screens = Quickshell.screens
if (screens.length > 0) {
var firstMonitorWallpaper = SessionData.getMonitorWallpaper(screens[0].name)
return firstMonitorWallpaper || SessionData.wallpaperPath
var targetMonitor = (typeof SettingsData !== "undefined" && SettingsData.matugenTargetMonitor && SettingsData.matugenTargetMonitor !== "") ? SettingsData.matugenTargetMonitor : screens[0].name
var targetMonitorExists = false
for (var i = 0; i < screens.length; i++) {
if (screens[i].name === targetMonitor) {
targetMonitorExists = true
break
}
}
if (!targetMonitorExists) {
targetMonitor = screens[0].name
}
var targetMonitorWallpaper = SessionData.getMonitorWallpaper(targetMonitor)
return targetMonitorWallpaper || SessionData.wallpaperPath
}
}
@@ -84,59 +100,59 @@ Singleton {
Component.onCompleted: {
Quickshell.execDetached(["mkdir", "-p", stateDir])
Proc.runCommand("matugenCheck", ["which", "matugen"], (output, code) => {
matugenAvailable = (code === 0) && !envDisableMatugen
const isGreeterMode = (typeof SessionData !== "undefined" && SessionData.isGreeterMode)
matugenAvailable = (code === 0) && !envDisableMatugen
const isGreeterMode = (typeof SessionData !== "undefined" && SessionData.isGreeterMode)
if (!matugenAvailable || isGreeterMode) {
return
}
if (!matugenAvailable || isGreeterMode) {
return
}
if (colorsFileLoadFailed && currentTheme === dynamic && wallpaperPath) {
console.info("Theme: Matugen now available, regenerating colors for dynamic theme")
const isLight = (typeof SessionData !== "undefined" && SessionData.isLightMode)
const iconTheme = (typeof SettingsData !== "undefined" && SettingsData.iconTheme) ? SettingsData.iconTheme : "System Default"
Quickshell.execDetached(["rm", "-f", stateDir + "/matugen.key"])
const selectedMatugenType = (typeof SettingsData !== "undefined" && SettingsData.matugenScheme) ? SettingsData.matugenScheme : "scheme-tonal-spot"
if (wallpaperPath.startsWith("#")) {
setDesiredTheme("hex", wallpaperPath, isLight, iconTheme, selectedMatugenType)
} else {
setDesiredTheme("image", wallpaperPath, isLight, iconTheme, selectedMatugenType)
}
return
}
if (colorsFileLoadFailed && currentTheme === dynamic && rawWallpaperPath) {
console.info("Theme: Matugen now available, regenerating colors for dynamic theme")
const isLight = (typeof SessionData !== "undefined" && SessionData.isLightMode)
const iconTheme = (typeof SettingsData !== "undefined" && SettingsData.iconTheme) ? SettingsData.iconTheme : "System Default"
Quickshell.execDetached(["rm", "-f", stateDir + "/matugen.key"])
const selectedMatugenType = (typeof SettingsData !== "undefined" && SettingsData.matugenScheme) ? SettingsData.matugenScheme : "scheme-tonal-spot"
if (rawWallpaperPath.startsWith("#")) {
setDesiredTheme("hex", rawWallpaperPath, isLight, iconTheme, selectedMatugenType)
} else {
setDesiredTheme("image", rawWallpaperPath, isLight, iconTheme, selectedMatugenType)
}
return
}
const isLight = (typeof SessionData !== "undefined" && SessionData.isLightMode)
const iconTheme = (typeof SettingsData !== "undefined" && SettingsData.iconTheme) ? SettingsData.iconTheme : "System Default"
const isLight = (typeof SessionData !== "undefined" && SessionData.isLightMode)
const iconTheme = (typeof SettingsData !== "undefined" && SettingsData.iconTheme) ? SettingsData.iconTheme : "System Default"
if (currentTheme === dynamic) {
if (wallpaperPath) {
Quickshell.execDetached(["rm", "-f", stateDir + "/matugen.key"])
const selectedMatugenType = (typeof SettingsData !== "undefined" && SettingsData.matugenScheme) ? SettingsData.matugenScheme : "scheme-tonal-spot"
if (wallpaperPath.startsWith("#")) {
setDesiredTheme("hex", wallpaperPath, isLight, iconTheme, selectedMatugenType)
} else {
setDesiredTheme("image", wallpaperPath, isLight, iconTheme, selectedMatugenType)
}
}
} else {
let primaryColor
let matugenType
if (currentTheme === "custom") {
if (customThemeData && customThemeData.primary) {
primaryColor = customThemeData.primary
matugenType = customThemeData.matugen_type
}
} else {
primaryColor = currentThemeData.primary
matugenType = currentThemeData.matugen_type
}
if (currentTheme === dynamic) {
if (rawWallpaperPath) {
Quickshell.execDetached(["rm", "-f", stateDir + "/matugen.key"])
const selectedMatugenType = (typeof SettingsData !== "undefined" && SettingsData.matugenScheme) ? SettingsData.matugenScheme : "scheme-tonal-spot"
if (rawWallpaperPath.startsWith("#")) {
setDesiredTheme("hex", rawWallpaperPath, isLight, iconTheme, selectedMatugenType)
} else {
setDesiredTheme("image", rawWallpaperPath, isLight, iconTheme, selectedMatugenType)
}
}
} else {
let primaryColor
let matugenType
if (currentTheme === "custom") {
if (customThemeData && customThemeData.primary) {
primaryColor = customThemeData.primary
matugenType = customThemeData.matugen_type
}
} else {
primaryColor = currentThemeData.primary
matugenType = currentThemeData.matugen_type
}
if (primaryColor) {
Quickshell.execDetached(["rm", "-f", stateDir + "/matugen.key"])
setDesiredTheme("hex", primaryColor, isLight, iconTheme, matugenType)
}
}
}, 0)
if (primaryColor) {
Quickshell.execDetached(["rm", "-f", stateDir + "/matugen.key"])
setDesiredTheme("hex", primaryColor, isLight, iconTheme, matugenType)
}
}
}, 0)
if (typeof SessionData !== "undefined") {
SessionData.isLightModeChanged.connect(root.onLightModeChanged)
}
@@ -194,22 +210,51 @@ Singleton {
}
}
readonly property var availableMatugenSchemes: [
({ "value": "scheme-tonal-spot", "label": "Tonal Spot", "description": I18n.tr("Balanced palette with focused accents (default).") }),
({ "value": "scheme-vibrant-spot", "label": "Vibrant Spot", "description": I18n.tr("Lively palette with saturated accents.") }),
({ "value": "scheme-dynamic-contrast", "label": "Dynamic Contrast", "description": I18n.tr("High-contrast palette for strong visual distinction.") }),
({ "value": "scheme-content", "label": "Content", "description": I18n.tr("Derives colors that closely match the underlying image.") }),
({ "value": "scheme-expressive", "label": "Expressive", "description": I18n.tr("Vibrant palette with playful saturation.") }),
({ "value": "scheme-fidelity", "label": "Fidelity", "description": I18n.tr("High-fidelity palette that preserves source hues.") }),
({ "value": "scheme-fruit-salad", "label": "Fruit Salad", "description": I18n.tr("Colorful mix of bright contrasting accents.") }),
({ "value": "scheme-monochrome", "label": "Monochrome", "description": I18n.tr("Minimal palette built around a single hue.") }),
({ "value": "scheme-neutral", "label": "Neutral", "description": I18n.tr("Muted palette with subdued, calming tones.") }),
({ "value": "scheme-rainbow", "label": "Rainbow", "description": I18n.tr("Diverse palette spanning the full spectrum.") })
]
readonly property var availableMatugenSchemes: [({
"value": "scheme-tonal-spot",
"label": "Tonal Spot",
"description": I18n.tr("Balanced palette with focused accents (default).")
}), ({
"value": "scheme-vibrant-spot",
"label": "Vibrant Spot",
"description": I18n.tr("Lively palette with saturated accents.")
}), ({
"value": "scheme-dynamic-contrast",
"label": "Dynamic Contrast",
"description": I18n.tr("High-contrast palette for strong visual distinction.")
}), ({
"value": "scheme-content",
"label": "Content",
"description": I18n.tr("Derives colors that closely match the underlying image.")
}), ({
"value": "scheme-expressive",
"label": "Expressive",
"description": I18n.tr("Vibrant palette with playful saturation.")
}), ({
"value": "scheme-fidelity",
"label": "Fidelity",
"description": I18n.tr("High-fidelity palette that preserves source hues.")
}), ({
"value": "scheme-fruit-salad",
"label": "Fruit Salad",
"description": I18n.tr("Colorful mix of bright contrasting accents.")
}), ({
"value": "scheme-monochrome",
"label": "Monochrome",
"description": I18n.tr("Minimal palette built around a single hue.")
}), ({
"value": "scheme-neutral",
"label": "Neutral",
"description": I18n.tr("Muted palette with subdued, calming tones.")
}), ({
"value": "scheme-rainbow",
"label": "Rainbow",
"description": I18n.tr("Diverse palette spanning the full spectrum.")
})]
function getMatugenScheme(value) {
const schemes = availableMatugenSchemes
for (let i = 0; i < schemes.length; i++) {
for (var i = 0; i < schemes.length; i++) {
if (schemes[i].value === value)
return schemes[i]
}
@@ -296,13 +341,37 @@ Singleton {
property color shadowMedium: Qt.rgba(0, 0, 0, 0.08)
property color shadowStrong: Qt.rgba(0, 0, 0, 0.3)
readonly property var animationDurations: [
{ shorter: 0, short: 0, medium: 0, long: 0, extraLong: 0 },
{ shorter: 50, short: 75, medium: 150, long: 250, extraLong: 500 },
{ shorter: 100, short: 150, medium: 300, long: 500, extraLong: 1000 },
{ shorter: 150, short: 225, medium: 450, long: 750, extraLong: 1500 },
{ shorter: 200, short: 300, medium: 600, long: 1000, extraLong: 2000 }
]
readonly property var animationDurations: [{
"shorter": 0,
"short": 0,
"medium": 0,
"long": 0,
"extraLong": 0
}, {
"shorter": 50,
"short": 75,
"medium": 150,
"long": 250,
"extraLong": 500
}, {
"shorter": 100,
"short": 150,
"medium": 300,
"long": 500,
"extraLong": 1000
}, {
"shorter": 150,
"short": 225,
"medium": 450,
"long": 750,
"extraLong": 1500
}, {
"shorter": 200,
"short": 300,
"medium": 600,
"long": 1000,
"extraLong": 2000
}]
readonly property int currentAnimationSpeed: typeof SettingsData !== "undefined" ? SettingsData.animationSpeed : SettingsData.AnimationSpeed.Short
readonly property var currentDurations: animationDurations[currentAnimationSpeed] || animationDurations[SettingsData.AnimationSpeed.Short]
@@ -335,12 +404,13 @@ Singleton {
}
readonly property int currentAnimationBaseDuration: {
if (typeof SettingsData === "undefined") return 500
if (typeof SettingsData === "undefined")
return 500
if (SettingsData.animationSpeed === SettingsData.AnimationSpeed.Custom) {
return SettingsData.customAnimationDuration
}
const presetMap = [0, 250, 500, 750]
return presetMap[SettingsData.animationSpeed] !== undefined ? presetMap[SettingsData.animationSpeed] : 500
}
@@ -485,20 +555,40 @@ Singleton {
function getCatppuccinColor(variantName) {
const catColors = {
"cat-rosewater": "#f5e0dc", "cat-flamingo": "#f2cdcd", "cat-pink": "#f5c2e7", "cat-mauve": "#cba6f7",
"cat-red": "#f38ba8", "cat-maroon": "#eba0ac", "cat-peach": "#fab387", "cat-yellow": "#f9e2af",
"cat-green": "#a6e3a1", "cat-teal": "#94e2d5", "cat-sky": "#89dceb", "cat-sapphire": "#74c7ec",
"cat-blue": "#89b4fa", "cat-lavender": "#b4befe"
"cat-rosewater": "#f5e0dc",
"cat-flamingo": "#f2cdcd",
"cat-pink": "#f5c2e7",
"cat-mauve": "#cba6f7",
"cat-red": "#f38ba8",
"cat-maroon": "#eba0ac",
"cat-peach": "#fab387",
"cat-yellow": "#f9e2af",
"cat-green": "#a6e3a1",
"cat-teal": "#94e2d5",
"cat-sky": "#89dceb",
"cat-sapphire": "#74c7ec",
"cat-blue": "#89b4fa",
"cat-lavender": "#b4befe"
}
return catColors[variantName] || "#cba6f7"
}
function getCatppuccinVariantName(variantName) {
const catNames = {
"cat-rosewater": "Rosewater", "cat-flamingo": "Flamingo", "cat-pink": "Pink", "cat-mauve": "Mauve",
"cat-red": "Red", "cat-maroon": "Maroon", "cat-peach": "Peach", "cat-yellow": "Yellow",
"cat-green": "Green", "cat-teal": "Teal", "cat-sky": "Sky", "cat-sapphire": "Sapphire",
"cat-blue": "Blue", "cat-lavender": "Lavender"
"cat-rosewater": "Rosewater",
"cat-flamingo": "Flamingo",
"cat-pink": "Pink",
"cat-mauve": "Mauve",
"cat-red": "Red",
"cat-maroon": "Maroon",
"cat-peach": "Peach",
"cat-yellow": "Yellow",
"cat-green": "Green",
"cat-teal": "Teal",
"cat-sky": "Sky",
"cat-sapphire": "Sapphire",
"cat-blue": "Blue",
"cat-lavender": "Lavender"
}
return catNames[variantName] || "Unknown"
}
@@ -541,14 +631,14 @@ Singleton {
const colorMode = typeof SettingsData !== "undefined" ? SettingsData.widgetBackgroundColor : "sch"
switch (colorMode) {
case "s":
return surface
return surface
case "sc":
return surfaceContainer
return surfaceContainer
case "sch":
return surfaceContainerHigh
return surfaceContainerHigh
case "sth":
default:
return surfaceTextHover
return surfaceTextHover
}
}
@@ -562,14 +652,14 @@ Singleton {
const colorMode = typeof SettingsData !== "undefined" ? SettingsData.widgetBackgroundColor : "sch"
switch (colorMode) {
case "s":
return Qt.rgba(surface.r, surface.g, surface.b, widgetTransparency)
return Qt.rgba(surface.r, surface.g, surface.b, widgetTransparency)
case "sc":
return Qt.rgba(surfaceContainer.r, surfaceContainer.g, surfaceContainer.b, widgetTransparency)
return Qt.rgba(surfaceContainer.r, surfaceContainer.g, surfaceContainer.b, widgetTransparency)
case "sch":
return Qt.rgba(surfaceContainerHigh.r, surfaceContainerHigh.g, surfaceContainerHigh.b, widgetTransparency)
return Qt.rgba(surfaceContainerHigh.r, surfaceContainerHigh.g, surfaceContainerHigh.b, widgetTransparency)
case "sth":
default:
return Qt.rgba(surfaceContainer.r, surfaceContainer.g, surfaceContainer.b, widgetTransparency)
return Qt.rgba(surfaceContainer.r, surfaceContainer.g, surfaceContainer.b, widgetTransparency)
}
}
@@ -593,8 +683,10 @@ Singleton {
function barTextSize(barThickness) {
const scale = barThickness / 48
const dankBarScale = (typeof SettingsData !== "undefined" ? SettingsData.dankBarFontScale : 1.0)
if (scale <= 0.75) return fontSizeSmall * 0.9 * dankBarScale
if (scale >= 1.25) return fontSizeMedium * dankBarScale
if (scale <= 0.75)
return fontSizeSmall * 0.9 * dankBarScale
if (scale >= 1.25)
return fontSizeMedium * dankBarScale
return fontSizeSmall * dankBarScale
}
@@ -688,7 +780,6 @@ Singleton {
}
}
function onLightModeChanged() {
if (currentTheme === "custom" && customThemeFileView.path) {
customThemeFileView.reload()
@@ -725,10 +816,7 @@ Singleton {
const syncModeWithPortal = (typeof SettingsData !== "undefined" && SettingsData.syncModeWithPortal) ? "true" : "false"
if (rawWallpaperPath.startsWith("we:")) {
console.log("Theme: Starting matugen worker (WE wallpaper)")
systemThemeGenerator.command = [
"sh", "-c",
`sleep 1 && ${shellDir}/scripts/matugen-worker.sh '${stateDir}' '${shellDir}' '${configDir}' '${syncModeWithPortal}' --run`
]
systemThemeGenerator.command = ["sh", "-c", `sleep 1 && ${shellDir}/scripts/matugen-worker.sh '${stateDir}' '${shellDir}' '${configDir}' '${syncModeWithPortal}' --run`]
} else {
console.log("Theme: Starting matugen worker")
systemThemeGenerator.command = [shellDir + "/scripts/matugen-worker.sh", stateDir, shellDir, configDir, syncModeWithPortal, "--run"]
@@ -745,14 +833,14 @@ Singleton {
const iconTheme = (typeof SettingsData !== "undefined" && SettingsData.iconTheme) ? SettingsData.iconTheme : "System Default"
if (currentTheme === dynamic) {
if (!wallpaperPath) {
if (!rawWallpaperPath) {
return
}
const selectedMatugenType = (typeof SettingsData !== "undefined" && SettingsData.matugenScheme) ? SettingsData.matugenScheme : "scheme-tonal-spot"
if (wallpaperPath.startsWith("#")) {
setDesiredTheme("hex", wallpaperPath, isLight, iconTheme, selectedMatugenType)
if (rawWallpaperPath.startsWith("#")) {
setDesiredTheme("hex", rawWallpaperPath, isLight, iconTheme, selectedMatugenType)
} else {
setDesiredTheme("image", wallpaperPath, isLight, iconTheme, selectedMatugenType)
setDesiredTheme("image", rawWallpaperPath, isLight, iconTheme, selectedMatugenType)
}
} else {
let primaryColor
@@ -787,16 +875,16 @@ Singleton {
const isLight = (typeof SessionData !== "undefined" && SessionData.isLightMode) ? "true" : "false"
Proc.runCommand("gtkApplier", [shellDir + "/scripts/gtk.sh", configDir, isLight, shellDir], (output, exitCode) => {
if (exitCode === 0) {
if (typeof ToastService !== "undefined" && typeof NiriService !== "undefined" && !NiriService.matugenSuppression) {
ToastService.showInfo("GTK colors applied successfully")
}
} else {
if (typeof ToastService !== "undefined") {
ToastService.showError("Failed to apply GTK colors")
}
}
})
if (exitCode === 0) {
if (typeof ToastService !== "undefined" && typeof NiriService !== "undefined" && !NiriService.matugenSuppression) {
ToastService.showInfo("GTK colors applied successfully")
}
} else {
if (typeof ToastService !== "undefined") {
ToastService.showError("Failed to apply GTK colors")
}
}
})
}
function applyQtColors() {
@@ -808,32 +896,42 @@ Singleton {
}
Proc.runCommand("qtApplier", [shellDir + "/scripts/qt.sh", configDir], (output, exitCode) => {
if (exitCode === 0) {
if (typeof ToastService !== "undefined") {
ToastService.showInfo("Qt colors applied successfully")
}
} else {
if (typeof ToastService !== "undefined") {
ToastService.showError("Failed to apply Qt colors")
}
}
})
if (exitCode === 0) {
if (typeof ToastService !== "undefined") {
ToastService.showInfo("Qt colors applied successfully")
}
} else {
if (typeof ToastService !== "undefined") {
ToastService.showError("Failed to apply Qt colors")
}
}
})
}
function withAlpha(c, a) { return Qt.rgba(c.r, c.g, c.b, a); }
function withAlpha(c, a) {
return Qt.rgba(c.r, c.g, c.b, a)
}
function getFillMode(modeName) {
switch(modeName) {
case "Stretch": return Image.Stretch
case "Fit":
case "PreserveAspectFit": return Image.PreserveAspectFit
case "Fill":
case "PreserveAspectCrop": return Image.PreserveAspectCrop
case "Tile": return Image.Tile
case "TileVertically": return Image.TileVertically
case "TileHorizontally": return Image.TileHorizontally
case "Pad": return Image.Pad
default: return Image.PreserveAspectCrop
switch (modeName) {
case "Stretch":
return Image.Stretch
case "Fit":
case "PreserveAspectFit":
return Image.PreserveAspectFit
case "Fill":
case "PreserveAspectCrop":
return Image.PreserveAspectCrop
case "Tile":
return Image.Tile
case "TileVertically":
return Image.TileVertically
case "TileHorizontally":
return Image.TileHorizontally
case "Pad":
return Image.Pad
default:
return Image.PreserveAspectCrop
}
}
@@ -852,40 +950,48 @@ Singleton {
}
function invertHex(hex) {
hex = hex.replace('#', '');
hex = hex.replace('#', '')
if (!/^[0-9A-Fa-f]{6}$/.test(hex)) {
return hex;
return hex
}
const r = parseInt(hex.substr(0, 2), 16);
const g = parseInt(hex.substr(2, 2), 16);
const b = parseInt(hex.substr(4, 2), 16);
const r = parseInt(hex.substr(0, 2), 16)
const g = parseInt(hex.substr(2, 2), 16)
const b = parseInt(hex.substr(4, 2), 16)
const invR = (255 - r).toString(16).padStart(2, '0');
const invG = (255 - g).toString(16).padStart(2, '0');
const invB = (255 - b).toString(16).padStart(2, '0');
const invR = (255 - r).toString(16).padStart(2, '0')
const invG = (255 - g).toString(16).padStart(2, '0')
const invB = (255 - b).toString(16).padStart(2, '0')
return `#${invR}${invG}${invB}`;
return `#${invR}${invG}${invB}`
}
property string baseLogoColor: {
if (typeof SettingsData === "undefined") return ""
if (typeof SettingsData === "undefined")
return ""
const colorOverride = SettingsData.launcherLogoColorOverride
if (!colorOverride || colorOverride === "") return ""
if (colorOverride === "primary") return primary
if (colorOverride === "surface") return surfaceText
if (!colorOverride || colorOverride === "")
return ""
if (colorOverride === "primary")
return primary
if (colorOverride === "surface")
return surfaceText
return colorOverride
}
property string effectiveLogoColor: {
if (typeof SettingsData === "undefined") return ""
if (typeof SettingsData === "undefined")
return ""
const colorOverride = SettingsData.launcherLogoColorOverride
if (!colorOverride || colorOverride === "") return ""
if (!colorOverride || colorOverride === "")
return ""
if (colorOverride === "primary") return primary
if (colorOverride === "surface") return surfaceText
if (colorOverride === "primary")
return primary
if (colorOverride === "surface")
return surfaceText
if (!SettingsData.launcherLogoColorInvertOnMode) {
return colorOverride
@@ -898,8 +1004,6 @@ Singleton {
return colorOverride
}
Process {
id: systemThemeGenerator
running: false
@@ -956,9 +1060,7 @@ Singleton {
id: dynamicColorsFileView
path: {
const greetCfgDir = Quickshell.env("DMS_GREET_CFG_DIR") || "/etc/greetd/.dms"
const colorsPath = SessionData.isGreeterMode
? greetCfgDir + "/colors.json"
: stateDir + "/dms-colors.json"
const colorsPath = SessionData.isGreeterMode ? greetCfgDir + "/colors.json" : stateDir + "/dms-colors.json"
return colorsPath
}
watchChanges: currentTheme === dynamic && !SessionData.isGreeterMode
@@ -1000,7 +1102,7 @@ Singleton {
console.warn("Theme: Dynamic colors file load failed, marking for regeneration")
colorsFileLoadFailed = true
const isGreeterMode = (typeof SessionData !== "undefined" && SessionData.isGreeterMode)
if (!isGreeterMode && matugenAvailable && wallpaperPath) {
if (!isGreeterMode && matugenAvailable && rawWallpaperPath) {
console.log("Theme: Matugen available, triggering immediate regeneration")
generateSystemThemesFromCurrentTheme()
}

View File

@@ -49,12 +49,16 @@ DankPopout {
property bool __contentReady: false
function __tryFocusOnce() {
if (!__focusArmed) return
if (!__focusArmed)
return
const win = root.window
if (!win || !win.visible) return
if (!contentLoader.item) return
if (!win || !win.visible)
return
if (!contentLoader.item)
return
if (win.requestActivate) win.requestActivate()
if (win.requestActivate)
win.requestActivate()
contentLoader.item.forceActiveFocus(Qt.TabFocusReason)
if (contentLoader.item.activeFocus)
@@ -78,14 +82,18 @@ DankPopout {
target: contentLoader
function onLoaded() {
__contentReady = true
if (__focusArmed) __tryFocusOnce()
if (__focusArmed)
__tryFocusOnce()
}
}
Connections {
target: root.window ? root.window : null
enabled: !!root.window
function onVisibleChanged() { if (__focusArmed) __tryFocusOnce() }
function onVisibleChanged() {
if (__focusArmed)
__tryFocusOnce()
}
}
onBackgroundClicked: {
@@ -111,14 +119,14 @@ DankPopout {
target: root
function onShouldBeVisibleChanged() {
if (root.shouldBeVisible) {
Qt.callLater(function() {
Qt.callLater(function () {
mainContainer.forceActiveFocus()
})
}
}
}
Keys.onPressed: function(event) {
Keys.onPressed: function (event) {
if (event.key === Qt.Key_Escape) {
root.dashVisible = false
event.accepted = true
@@ -216,32 +224,43 @@ DankPopout {
}
model: {
let tabs = [
{ icon: "dashboard", text: I18n.tr("Overview") },
{ icon: "music_note", text: I18n.tr("Media") },
{ icon: "wallpaper", text: I18n.tr("Wallpapers") }
]
let tabs = [{
"icon": "dashboard",
"text": I18n.tr("Overview")
}, {
"icon": "music_note",
"text": I18n.tr("Media")
}, {
"icon": "wallpaper",
"text": I18n.tr("Wallpapers")
}]
if (SettingsData.weatherEnabled) {
tabs.push({ icon: "wb_sunny", text: I18n.tr("Weather") })
tabs.push({
"icon": "wb_sunny",
"text": I18n.tr("Weather")
})
}
tabs.push({ icon: "settings", text: I18n.tr("Settings"), isAction: true })
tabs.push({
"icon": "settings",
"text": I18n.tr("Settings"),
"isAction": true
})
return tabs
}
onTabClicked: function(index) {
onTabClicked: function (index) {
root.currentTabIndex = index
}
onActionTriggered: function(index) {
onActionTriggered: function (index) {
let settingsIndex = SettingsData.weatherEnabled ? 4 : 3
if (index === settingsIndex) {
dashVisible = false
settingsModal.show()
}
}
}
Item {
@@ -253,10 +272,14 @@ DankPopout {
id: pages
width: parent.width
implicitHeight: {
if (currentIndex === 0) return overviewTab.implicitHeight
if (currentIndex === 1) return mediaTab.implicitHeight
if (currentIndex === 2) return wallpaperTab.implicitHeight
if (SettingsData.weatherEnabled && currentIndex === 3) return weatherTab.implicitHeight
if (currentIndex === 0)
return overviewTab.implicitHeight
if (currentIndex === 1)
return mediaTab.implicitHeight
if (currentIndex === 2)
return wallpaperTab.implicitHeight
if (SettingsData.weatherEnabled && currentIndex === 3)
return weatherTab.implicitHeight
return overviewTab.implicitHeight
}
currentIndex: root.currentTabIndex
@@ -286,6 +309,7 @@ DankPopout {
active: root.currentTabIndex === 2
tabBarItem: tabBar
keyForwardTarget: mainContainer
targetScreen: root.triggerScreen
}
WeatherTab {
@@ -296,4 +320,4 @@ DankPopout {
}
}
}
}
}

View File

@@ -29,9 +29,26 @@ Item {
property bool enableAnimation: false
property string homeDir: StandardPaths.writableLocation(StandardPaths.HomeLocation)
property string selectedFileName: ""
property var targetScreen: null
property string targetScreenName: targetScreen ? targetScreen.name : ""
signal requestTabChange(int newIndex)
function getCurrentWallpaper() {
if (SessionData.perMonitorWallpaper && targetScreenName) {
return SessionData.getMonitorWallpaper(targetScreenName)
}
return SessionData.wallpaperPath
}
function setCurrentWallpaper(path) {
if (SessionData.perMonitorWallpaper && targetScreenName) {
SessionData.setMonitorWallpaper(targetScreenName, path)
} else {
SessionData.setWallpaper(path)
}
}
onCurrentPageChanged: {
if (currentPage !== lastPage) {
enableAnimation = false
@@ -71,7 +88,7 @@ Item {
if (absoluteIndex < wallpaperFolderModel.count) {
const filePath = wallpaperFolderModel.get(absoluteIndex, "filePath")
if (filePath) {
SessionData.setWallpaper(filePath.toString().replace(/^file:\/\//, ''))
setCurrentWallpaper(filePath.toString().replace(/^file:\/\//, ''))
}
}
}
@@ -151,32 +168,39 @@ Item {
}
function setInitialSelection() {
if (!SessionData.wallpaperPath || wallpaperFolderModel.count === 0) {
const currentWallpaper = getCurrentWallpaper()
if (!currentWallpaper || wallpaperFolderModel.count === 0) {
gridIndex = 0
updateSelectedFileName()
Qt.callLater(() => { enableAnimation = true })
Qt.callLater(() => {
enableAnimation = true
})
return
}
for (let i = 0; i < wallpaperFolderModel.count; i++) {
for (var i = 0; i < wallpaperFolderModel.count; i++) {
const filePath = wallpaperFolderModel.get(i, "filePath")
if (filePath && filePath.toString().replace(/^file:\/\//, '') === SessionData.wallpaperPath) {
if (filePath && filePath.toString().replace(/^file:\/\//, '') === currentWallpaper) {
const targetPage = Math.floor(i / itemsPerPage)
const targetIndex = i % itemsPerPage
currentPage = targetPage
gridIndex = targetIndex
updateSelectedFileName()
Qt.callLater(() => { enableAnimation = true })
Qt.callLater(() => {
enableAnimation = true
})
return
}
}
gridIndex = 0
updateSelectedFileName()
Qt.callLater(() => { enableAnimation = true })
Qt.callLater(() => {
enableAnimation = true
})
}
function loadWallpaperDirectory() {
const currentWallpaper = SessionData.wallpaperPath
const currentWallpaper = getCurrentWallpaper()
if (!currentWallpaper || currentWallpaper.startsWith("#") || currentWallpaper.startsWith("we:")) {
if (CacheData.wallpaperLastPath && CacheData.wallpaperLastPath !== "") {
@@ -216,6 +240,19 @@ Item {
setInitialSelection()
}
}
function onMonitorWallpapersChanged() {
loadWallpaperDirectory()
if (visible && active) {
setInitialSelection()
}
}
}
onTargetScreenNameChanged: {
loadWallpaperDirectory()
if (visible && active) {
setInitialSelection()
}
}
Connections {
@@ -267,18 +304,18 @@ Item {
fileExtensions: ["*.jpg", "*.jpeg", "*.png", "*.bmp", "*.gif", "*.webp"]
allowStacking: true
onFileSelected: (path) => {
const cleanPath = path.replace(/^file:\/\//, '')
SessionData.setWallpaper(cleanPath)
onFileSelected: path => {
const cleanPath = path.replace(/^file:\/\//, '')
setCurrentWallpaper(cleanPath)
const dirPath = cleanPath.substring(0, cleanPath.lastIndexOf('/'))
if (dirPath) {
wallpaperDir = dirPath
CacheData.wallpaperLastPath = dirPath
CacheData.saveCache()
}
close()
}
const dirPath = cleanPath.substring(0, cleanPath.lastIndexOf('/'))
if (dirPath) {
wallpaperDir = dirPath
CacheData.wallpaperLastPath = dirPath
CacheData.saveCache()
}
close()
}
onDialogClosed: {
Qt.callLater(() => wallpaperBrowserLoader.active = false)
@@ -327,7 +364,7 @@ Item {
const startIndex = currentPage * itemsPerPage
const endIndex = Math.min(startIndex + itemsPerPage, wallpaperFolderModel.count)
const items = []
for (let i = startIndex; i < endIndex; i++) {
for (var i = startIndex; i < endIndex; i++) {
const filePath = wallpaperFolderModel.get(i, "filePath")
if (filePath) {
items.push(filePath.toString().replace(/^file:\/\//, ''))
@@ -369,7 +406,7 @@ Item {
height: wallpaperGrid.cellHeight
property string wallpaperPath: modelData || ""
property bool isSelected: SessionData.wallpaperPath === modelData
property bool isSelected: getCurrentWallpaper() === modelData
Rectangle {
id: wallpaperCard
@@ -437,7 +474,7 @@ Item {
onClicked: {
gridIndex = index
if (modelData) {
SessionData.setWallpaper(modelData)
setCurrentWallpaper(modelData)
}
}
}

View File

@@ -136,9 +136,7 @@ Item {
var currentWallpaper = SessionData.perMonitorWallpaper ? SessionData.getMonitorWallpaper(selectedMonitorName) : SessionData.wallpaperPath
if (currentWallpaper && currentWallpaper.startsWith("we:")) {
var sceneId = currentWallpaper.substring(3)
return StandardPaths.writableLocation(StandardPaths.HomeLocation)
+ "/.local/share/Steam/steamapps/workshop/content/431960/"
+ sceneId + "/preview" + weExtensions[weExtIndex]
return StandardPaths.writableLocation(StandardPaths.HomeLocation) + "/.local/share/Steam/steamapps/workshop/content/431960/" + sceneId + "/preview" + weExtensions[weExtIndex]
}
return (currentWallpaper !== "" && !currentWallpaper.startsWith("#")) ? "file://" + currentWallpaper : ""
}
@@ -147,10 +145,7 @@ Item {
if (currentWallpaper && currentWallpaper.startsWith("we:") && status === Image.Error) {
if (weExtIndex < weExtensions.length - 1) {
weExtIndex++
source = StandardPaths.writableLocation(StandardPaths.HomeLocation)
+ "/.local/share/Steam/steamapps/workshop/content/431960/"
+ currentWallpaper.substring(3)
+ "/preview" + weExtensions[weExtIndex]
source = StandardPaths.writableLocation(StandardPaths.HomeLocation) + "/.local/share/Steam/steamapps/workshop/content/431960/" + currentWallpaper.substring(3) + "/preview" + weExtensions[weExtIndex]
} else {
visible = false
}
@@ -241,7 +236,6 @@ Item {
}
}
Rectangle {
width: 32
height: 32
@@ -263,7 +257,7 @@ Item {
var currentWallpaper = SessionData.perMonitorWallpaper ? SessionData.getMonitorWallpaper(selectedMonitorName) : SessionData.wallpaperPath
PopoutService.colorPickerModal.selectedColor = currentWallpaper.startsWith("#") ? currentWallpaper : Theme.primary
PopoutService.colorPickerModal.pickerTitle = "Choose Wallpaper Color"
PopoutService.colorPickerModal.onColorSelectedCallback = function(selectedColor) {
PopoutService.colorPickerModal.onColorSelectedCallback = function (selectedColor) {
if (SessionData.perMonitorWallpaper) {
SessionData.setMonitorWallpaper(selectedMonitorName, selectedColor)
} else {
@@ -434,11 +428,11 @@ Item {
return modes.indexOf(SettingsData.wallpaperFillMode)
}
onSelectionChanged: (index, selected) => {
if (selected) {
const modes = ["Stretch", "Fit", "Fill", "Tile", "TileVertically", "TileHorizontally", "Pad"]
SettingsData.setWallpaperFillMode(modes[index])
}
}
if (selected) {
const modes = ["Stretch", "Fit", "Fill", "Tile", "TileVertically", "TileHorizontally", "Pad"]
SettingsData.setWallpaperFillMode(modes[index])
}
}
Connections {
target: SettingsData
@@ -452,9 +446,9 @@ Item {
target: personalizationTab
function onSelectedMonitorNameChanged() {
Qt.callLater(() => {
const modes = ["Stretch", "Fit", "Fill", "Tile", "TileVertically", "TileHorizontally", "Pad"]
fillModeGroup.currentIndex = modes.indexOf(SettingsData.wallpaperFillMode)
})
const modes = ["Stretch", "Fit", "Fill", "Tile", "TileVertically", "TileHorizontally", "Pad"]
fillModeGroup.currentIndex = modes.indexOf(SettingsData.wallpaperFillMode)
})
}
}
}
@@ -507,8 +501,8 @@ Item {
anchors.verticalCenter: parent.verticalCenter
checked: SettingsData.blurWallpaperOnOverview
onToggled: checked => {
SettingsData.setBlurWallpaperOnOverview(checked)
}
SettingsData.setBlurWallpaperOnOverview(checked)
}
}
}
@@ -641,7 +635,7 @@ Item {
DankDropdown {
id: monitorDropdown
text: I18n.tr("Monitor")
text: I18n.tr("Wallpaper Monitor")
description: I18n.tr("Select monitor to configure wallpaper")
currentValue: selectedMonitorName || "No monitors"
options: {
@@ -656,6 +650,36 @@ Item {
selectedMonitorName = value
}
}
DankDropdown {
id: matugenTargetDropdown
text: I18n.tr("Matugen Target Monitor")
description: I18n.tr("Monitor whose wallpaper drives dynamic theming colors")
currentValue: {
if (!SettingsData.matugenTargetMonitor || SettingsData.matugenTargetMonitor === "") {
var screens = Quickshell.screens
return screens.length > 0 ? screens[0].name + " (Default)" : "No monitors"
}
return SettingsData.matugenTargetMonitor
}
options: {
var screenNames = []
var screens = Quickshell.screens
for (var i = 0; i < screens.length; i++) {
var label = screens[i].name
if (i === 0 && (!SettingsData.matugenTargetMonitor || SettingsData.matugenTargetMonitor === "")) {
label += " (Default)"
}
screenNames.push(label)
}
return screenNames
}
onValueChanged: value => {
var cleanValue = value.replace(" (Default)", "")
SettingsData.setMatugenTargetMonitor(cleanValue)
}
}
}
}
@@ -720,8 +744,8 @@ Item {
target: personalizationTab
function onSelectedMonitorNameChanged() {
cyclingToggle.checked = Qt.binding(() => {
return SessionData.perMonitorWallpaper ? SessionData.getMonitorCyclingSettings(selectedMonitorName).enabled : SessionData.wallpaperCyclingEnabled
})
return SessionData.perMonitorWallpaper ? SessionData.getMonitorCyclingSettings(selectedMonitorName).enabled : SessionData.wallpaperCyclingEnabled
})
}
}
}
@@ -779,12 +803,12 @@ Item {
target: personalizationTab
function onSelectedMonitorNameChanged() {
modeTabBar.currentIndex = Qt.binding(() => {
if (SessionData.perMonitorWallpaper) {
return SessionData.getMonitorCyclingSettings(selectedMonitorName).mode === "time" ? 1 : 0
} else {
return SessionData.wallpaperCyclingMode === "time" ? 1 : 0
}
})
if (SessionData.perMonitorWallpaper) {
return SessionData.getMonitorCyclingSettings(selectedMonitorName).mode === "time" ? 1 : 0
} else {
return SessionData.wallpaperCyclingMode === "time" ? 1 : 0
}
})
Qt.callLater(modeTabBar.updateIndicator)
}
}
@@ -835,15 +859,15 @@ Item {
function onSelectedMonitorNameChanged() {
// Force dropdown to refresh its currentValue
Qt.callLater(() => {
var currentSeconds
if (SessionData.perMonitorWallpaper) {
currentSeconds = SessionData.getMonitorCyclingSettings(selectedMonitorName).interval
} else {
currentSeconds = SessionData.wallpaperCyclingInterval
}
const index = intervalDropdown.intervalValues.indexOf(currentSeconds)
intervalDropdown.currentValue = index >= 0 ? intervalDropdown.intervalOptions[index] : "5 minutes"
})
var currentSeconds
if (SessionData.perMonitorWallpaper) {
currentSeconds = SessionData.getMonitorCyclingSettings(selectedMonitorName).interval
} else {
currentSeconds = SessionData.wallpaperCyclingInterval
}
const index = intervalDropdown.intervalValues.indexOf(currentSeconds)
intervalDropdown.currentValue = index >= 0 ? intervalDropdown.intervalOptions[index] : "5 minutes"
})
}
}
}
@@ -925,12 +949,12 @@ Item {
function onSelectedMonitorNameChanged() {
// Force text field to refresh its value
Qt.callLater(() => {
if (SessionData.perMonitorWallpaper) {
timeTextField.text = SessionData.getMonitorCyclingSettings(selectedMonitorName).time
} else {
timeTextField.text = SessionData.wallpaperCyclingTime
}
})
if (SessionData.perMonitorWallpaper) {
timeTextField.text = SessionData.getMonitorCyclingSettings(selectedMonitorName).time
} else {
timeTextField.text = SessionData.wallpaperCyclingTime
}
})
}
}
}
@@ -956,14 +980,15 @@ Item {
text: I18n.tr("Transition Effect")
description: I18n.tr("Visual effect used when wallpaper changes")
currentValue: {
if (SessionData.wallpaperTransition === "random") return "Random"
if (SessionData.wallpaperTransition === "random")
return "Random"
return SessionData.wallpaperTransition.charAt(0).toUpperCase() + SessionData.wallpaperTransition.slice(1)
}
options: ["Random"].concat(SessionData.availableWallpaperTransitions.map(t => t.charAt(0).toUpperCase() + t.slice(1)))
onValueChanged: value => {
var transition = value.toLowerCase()
SessionData.setWallpaperTransition(transition)
}
var transition = value.toLowerCase()
SessionData.setWallpaperTransition(transition)
}
}
Column {
@@ -995,17 +1020,17 @@ Item {
currentSelection: SessionData.includedTransitions
onSelectionChanged: (index, selected) => {
const transition = model[index]
let newIncluded = [...SessionData.includedTransitions]
const transition = model[index]
let newIncluded = [...SessionData.includedTransitions]
if (selected && !newIncluded.includes(transition)) {
newIncluded.push(transition)
} else if (!selected && newIncluded.includes(transition)) {
newIncluded = newIncluded.filter(t => t !== transition)
}
if (selected && !newIncluded.includes(transition)) {
newIncluded.push(transition)
} else if (!selected && newIncluded.includes(transition)) {
newIncluded = newIncluded.filter(t => t !== transition)
}
SessionData.includedTransitions = newIncluded
}
SessionData.includedTransitions = newIncluded
}
}
}
}
@@ -1065,8 +1090,8 @@ Item {
anchors.verticalCenter: parent.verticalCenter
checked: SettingsData.blurredWallpaperLayer
onToggled: checked => {
SettingsData.setBlurredWallpaperLayer(checked)
}
SettingsData.setBlurredWallpaperLayer(checked)
}
}
}
}
@@ -1122,9 +1147,9 @@ Item {
anchors.verticalCenter: parent.verticalCenter
checked: SessionData.isLightMode
onToggleCompleted: checked => {
Theme.screenTransition()
Theme.setLightMode(checked)
}
Theme.screenTransition()
Theme.setLightMode(checked)
}
}
}
}
@@ -1176,10 +1201,10 @@ Item {
selectionMode: "single"
currentIndex: SettingsData.animationSpeed
onSelectionChanged: (index, selected) => {
if (selected) {
SettingsData.setAnimationSpeed(index)
}
}
if (selected) {
SettingsData.setAnimationSpeed(index)
}
}
Connections {
target: SettingsData
@@ -1257,10 +1282,10 @@ Item {
showValue: false
wheelEnabled: false
onSliderValueChanged: (newValue) => {
SettingsData.setAnimationSpeed(SettingsData.AnimationSpeed.Custom)
SettingsData.setCustomAnimationDuration(newValue)
}
onSliderValueChanged: newValue => {
SettingsData.setAnimationSpeed(SettingsData.AnimationSpeed.Custom)
SettingsData.setCustomAnimationDuration(newValue)
}
Connections {
target: SettingsData
@@ -1388,19 +1413,21 @@ Item {
id: personalizationMatugenPaletteDropdown
text: I18n.tr("Matugen Palette")
description: I18n.tr("Select the palette algorithm used for wallpaper-based colors")
options: Theme.availableMatugenSchemes.map(function (option) { return option.label })
options: Theme.availableMatugenSchemes.map(function (option) {
return option.label
})
currentValue: Theme.getMatugenScheme(SettingsData.matugenScheme).label
enabled: Theme.matugenAvailable
opacity: enabled ? 1 : 0.4
onValueChanged: value => {
for (var i = 0; i < Theme.availableMatugenSchemes.length; i++) {
var option = Theme.availableMatugenSchemes[i]
if (option.label === value) {
SettingsData.setMatugenScheme(option.value)
break
}
}
}
for (var i = 0; i < Theme.availableMatugenSchemes.length; i++) {
var option = Theme.availableMatugenSchemes[i]
if (option.label === value) {
SettingsData.setMatugenScheme(option.value)
break
}
}
}
}
StyledText {
@@ -1459,8 +1486,8 @@ Item {
checked: SettingsData.runUserMatugenTemplates
enabled: Theme.matugenAvailable
onToggled: checked => {
SettingsData.setRunUserMatugenTemplates(checked)
}
SettingsData.setRunUserMatugenTemplates(checked)
}
}
}
@@ -1528,8 +1555,8 @@ Item {
anchors.verticalCenter: parent.verticalCenter
checked: SettingsData.soundsEnabled
onToggled: checked => {
SettingsData.setSoundsEnabled(checked)
}
SettingsData.setSoundsEnabled(checked)
}
}
}
@@ -1576,8 +1603,8 @@ Item {
anchors.verticalCenter: parent.verticalCenter
checked: SettingsData.useSystemSoundTheme
onToggled: checked => {
SettingsData.setUseSystemSoundTheme(checked)
}
SettingsData.setUseSystemSoundTheme(checked)
}
}
}
@@ -1598,10 +1625,10 @@ Item {
return AudioService.availableSoundThemes.length > 0 ? AudioService.availableSoundThemes[0] : ""
}
onValueChanged: value => {
if (value && value !== AudioService.currentSoundTheme) {
AudioService.setSoundTheme(value)
}
}
if (value && value !== AudioService.currentSoundTheme) {
AudioService.setSoundTheme(value)
}
}
}
Rectangle {
@@ -1641,8 +1668,8 @@ Item {
anchors.verticalCenter: parent.verticalCenter
checked: SettingsData.soundNewNotification
onToggled: checked => {
SettingsData.setSoundNewNotification(checked)
}
SettingsData.setSoundNewNotification(checked)
}
}
}
@@ -1675,8 +1702,8 @@ Item {
anchors.verticalCenter: parent.verticalCenter
checked: SettingsData.soundVolumeChanged
onToggled: checked => {
SettingsData.setSoundVolumeChanged(checked)
}
SettingsData.setSoundVolumeChanged(checked)
}
}
}
@@ -1710,8 +1737,8 @@ Item {
anchors.verticalCenter: parent.verticalCenter
checked: SettingsData.soundPluggedIn
onToggled: checked => {
SettingsData.setSoundPluggedIn(checked)
}
SettingsData.setSoundPluggedIn(checked)
}
}
}
}