Hooks: expose to grab the screen name

This commit is contained in:
Ly-sec 2025-09-04 19:15:50 +02:00
parent 46bc8939b4
commit a9affb5ae4
3 changed files with 10 additions and 4 deletions

View file

@ -17,7 +17,7 @@ Singleton {
}
// Execute wallpaper change hook
function executeWallpaperHook(wallpaperPath) {
function executeWallpaperHook(wallpaperPath, screenName) {
if (!Settings.data.hooks?.enabled) {
return
}
@ -28,7 +28,8 @@ Singleton {
}
try {
const command = script.replace(/\$1/g, wallpaperPath)
let command = script.replace(/\$1/g, wallpaperPath)
command = command.replace(/\$2/g, screenName || "")
Quickshell.execDetached(["sh", "-c", command])
Logger.log("HooksService", `Executed wallpaper hook: ${command}`)
} catch (e) {

View file

@ -288,7 +288,7 @@ Singleton {
// Execute wallpaper change hook after the change is complete
if (HooksService) {
HooksService.executeWallpaperHook(path)
HooksService.executeWallpaperHook(path, screenName)
}
// Restart the random wallpaper timer