diff --git a/Modules/IPC/IPCManager.qml b/Modules/IPC/IPCManager.qml index 15ae2d7..7436829 100644 --- a/Modules/IPC/IPCManager.qml +++ b/Modules/IPC/IPCManager.qml @@ -138,5 +138,12 @@ Item { WallpaperService.setRandomWallpaper() } } + + function set(path: string, screen: string) { + if (screen === "all" || screen === "") { + screen = undefined + } + WallpaperService.changeWallpaper(path, screen) + } } } diff --git a/Modules/SettingsPanel/Tabs/WallpaperSelectorTab.qml b/Modules/SettingsPanel/Tabs/WallpaperSelectorTab.qml index 8cf41dd..6952c71 100644 --- a/Modules/SettingsPanel/Tabs/WallpaperSelectorTab.qml +++ b/Modules/SettingsPanel/Tabs/WallpaperSelectorTab.qml @@ -210,9 +210,9 @@ ColumnLayout { hoverEnabled: true onPressed: { if (Settings.data.wallpaper.setWallpaperOnAllMonitors) { - WallpaperService.changeWallpaper(undefined, wallpaperPath) + WallpaperService.changeWallpaper(wallpaperPath, undefined) } else if (screen) { - WallpaperService.changeWallpaper(screen.name, wallpaperPath) + WallpaperService.changeWallpaper(wallpaperPath, screen.name) } } } diff --git a/Services/WallpaperService.qml b/Services/WallpaperService.qml index 705fb67..7f99a0d 100644 --- a/Services/WallpaperService.qml +++ b/Services/WallpaperService.qml @@ -220,7 +220,7 @@ Singleton { } // ------------------------------------------------------------------- - function changeWallpaper(screenName, path) { + function changeWallpaper(path, screenName) { if (screenName !== undefined) { _setWallpaper(screenName, path) } else { @@ -305,7 +305,7 @@ Singleton { if (wallpaperList.length > 0) { var randomIndex = Math.floor(Math.random() * wallpaperList.length) var randomPath = wallpaperList[randomIndex] - changeWallpaper(screenName, randomPath) + changeWallpaper(randomPath, screenName) } } } else { @@ -315,7 +315,7 @@ Singleton { if (wallpaperList.length > 0) { var randomIndex = Math.floor(Math.random() * wallpaperList.length) var randomPath = wallpaperList[randomIndex] - changeWallpaper(undefined, randomPath) + changeWallpaper(randomPath, undefined) } } }