diff --git a/Assets/Translations/en.json b/Assets/Translations/en.json index 5c83e6d29..d7f1923a1 100644 --- a/Assets/Translations/en.json +++ b/Assets/Translations/en.json @@ -1220,7 +1220,7 @@ }, "hooks": { "info-command-info-description": "• Commands are executed via shell (sh -lc)
• Commands run in background (detached)
• Test buttons execute with current values", - "info-parameters-description": "• Wallpaper hook: $1 = wallpaper path, $2 = screen name
• Theme toggle hook: $1 = true/false (Dark Mode state)
• Screen lock/unlock hooks: $1 = lock/unlock (screen lock state)
• Performance mode hooks: No parameters
• Session hook: $1 = action (shutdown/reboot)", + "info-parameters-description": "• Wallpaper hook: $1 = wallpaper path, $2 = screen name, $3 = theme (dark/light)
• Theme toggle hook: $1 = true/false (Dark Mode state)
• Screen lock/unlock hooks: $1 = lock/unlock (screen lock state)
• Performance mode hooks: No parameters
• Session hook: $1 = action (shutdown/reboot)", "info-parameters-label": "Available parameters", "noctalia-started-description": "Command to execute when Noctalia has finished loading.", "noctalia-started-label": "Noctalia started", diff --git a/Modules/Panels/Settings/Tabs/Hooks/HooksListSubTab.qml b/Modules/Panels/Settings/Tabs/Hooks/HooksListSubTab.qml index 2e7d4196f..3540c598d 100644 --- a/Modules/Panels/Settings/Tabs/Hooks/HooksListSubTab.qml +++ b/Modules/Panels/Settings/Tabs/Hooks/HooksListSubTab.qml @@ -68,7 +68,7 @@ ColumnLayout { Settings.saveImmediate(); }, val => { if (val) - Quickshell.execDetached(["sh", "-lc", val.replace("$1", "test_wallpaper_path").replace("$2", "test_screen")]); + Quickshell.execDetached(["sh", "-lc", val.replace("$1", "test_wallpaper_path").replace("$2", "test_screen").replace("$3", "dark")]); }) } diff --git a/Services/Control/HooksService.qml b/Services/Control/HooksService.qml index 872662a84..d179d7b9c 100644 --- a/Services/Control/HooksService.qml +++ b/Services/Control/HooksService.qml @@ -118,8 +118,10 @@ Singleton { } try { + const theme = Settings.data.colorSchemes.darkMode ? "dark" : "light"; let command = script.replace(/\$1/g, wallpaperPath); command = command.replace(/\$2/g, screenName || ""); + command = command.replace(/\$3/g, theme); Quickshell.execDetached(["sh", "-lc", command]); Logger.d("HooksService", `Executed wallpaper hook: ${command}`); } catch (e) {