Wallpaper: added IPC to set a wallpaper
qs -c noctalia-shell ipc call wallpaper set $path $monitor $monitor can be a monitor name or "all" or "" to assign to all monitors.
This commit is contained in:
parent
9168eba07b
commit
84fdb7c647
3 changed files with 12 additions and 5 deletions
|
|
@ -138,5 +138,12 @@ Item {
|
||||||
WallpaperService.setRandomWallpaper()
|
WallpaperService.setRandomWallpaper()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function set(path: string, screen: string) {
|
||||||
|
if (screen === "all" || screen === "") {
|
||||||
|
screen = undefined
|
||||||
|
}
|
||||||
|
WallpaperService.changeWallpaper(path, screen)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -210,9 +210,9 @@ ColumnLayout {
|
||||||
hoverEnabled: true
|
hoverEnabled: true
|
||||||
onPressed: {
|
onPressed: {
|
||||||
if (Settings.data.wallpaper.setWallpaperOnAllMonitors) {
|
if (Settings.data.wallpaper.setWallpaperOnAllMonitors) {
|
||||||
WallpaperService.changeWallpaper(undefined, wallpaperPath)
|
WallpaperService.changeWallpaper(wallpaperPath, undefined)
|
||||||
} else if (screen) {
|
} else if (screen) {
|
||||||
WallpaperService.changeWallpaper(screen.name, wallpaperPath)
|
WallpaperService.changeWallpaper(wallpaperPath, screen.name)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -220,7 +220,7 @@ Singleton {
|
||||||
}
|
}
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
function changeWallpaper(screenName, path) {
|
function changeWallpaper(path, screenName) {
|
||||||
if (screenName !== undefined) {
|
if (screenName !== undefined) {
|
||||||
_setWallpaper(screenName, path)
|
_setWallpaper(screenName, path)
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -305,7 +305,7 @@ Singleton {
|
||||||
if (wallpaperList.length > 0) {
|
if (wallpaperList.length > 0) {
|
||||||
var randomIndex = Math.floor(Math.random() * wallpaperList.length)
|
var randomIndex = Math.floor(Math.random() * wallpaperList.length)
|
||||||
var randomPath = wallpaperList[randomIndex]
|
var randomPath = wallpaperList[randomIndex]
|
||||||
changeWallpaper(screenName, randomPath)
|
changeWallpaper(randomPath, screenName)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -315,7 +315,7 @@ Singleton {
|
||||||
if (wallpaperList.length > 0) {
|
if (wallpaperList.length > 0) {
|
||||||
var randomIndex = Math.floor(Math.random() * wallpaperList.length)
|
var randomIndex = Math.floor(Math.random() * wallpaperList.length)
|
||||||
var randomPath = wallpaperList[randomIndex]
|
var randomPath = wallpaperList[randomIndex]
|
||||||
changeWallpaper(undefined, randomPath)
|
changeWallpaper(randomPath, undefined)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue