1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2025-12-06 05:25:41 -05:00

Add support for linux-wallpaperengine wallpapers (#191)

* Add support for linux-wallpaperengine wallpapers

* Remove unnecessary onCompleted hook
This commit is contained in:
Aziz Hasanain
2025-09-12 19:13:14 +03:00
committed by GitHub
parent c3759dc542
commit c8cb5dc146
6 changed files with 262 additions and 28 deletions

View File

@@ -1,3 +1,4 @@
import QtCore
import QtQuick
import QtQuick.Controls
import QtQuick.Effects
@@ -75,6 +76,12 @@ Item {
anchors.fill: parent
source: {
var currentWallpaper = SessionData.getMonitorWallpaper(screenName)
if (screenName && currentWallpaper && currentWallpaper.startsWith("we:")) {
const cacheHome = StandardPaths.writableLocation(StandardPaths.CacheLocation).toString()
const baseDir = cacheHome.startsWith("file://") ? cacheHome.substring(7) : cacheHome
const screenshotPath = baseDir + "/dankshell/we_screenshots" + "/" + currentWallpaper.substring(3) + ".jpg"
return screenshotPath
}
return (currentWallpaper && !currentWallpaper.startsWith("#")) ? currentWallpaper : ""
}
fillMode: Image.PreserveAspectCrop