feat: automatically sync KDE KScreenLocker lockscreen wallpaper with current desktop wallpaper
This commit is contained in:
parent
b56a9fa115
commit
bb6baa5f5e
@ -38,6 +38,7 @@ Item {
|
||||
Theme.wallpaperPath = fileUrl
|
||||
let rawPath = parsed.wallpaper.replace("file://", "")
|
||||
Quickshell.execDetached(["plasma-apply-wallpaperimage", rawPath])
|
||||
Quickshell.execDetached(["kwriteconfig6", "--file", "kscreenlockerrc", "--group", "Greeter", "--group", "Wallpaper", "--group", "org.kde.image", "--group", "General", "--key", "Image", "file://" + rawPath])
|
||||
}
|
||||
}
|
||||
} catch (e) {}
|
||||
@ -91,6 +92,7 @@ Item {
|
||||
}
|
||||
|
||||
Quickshell.execDetached(["plasma-apply-wallpaperimage", rawPath])
|
||||
Quickshell.execDetached(["kwriteconfig6", "--file", "kscreenlockerrc", "--group", "Greeter", "--group", "Wallpaper", "--group", "org.kde.image", "--group", "General", "--key", "Image", "file://" + rawPath])
|
||||
|
||||
if (!skipSave) {
|
||||
Quickshell.execDetached(["python3", Quickshell.env("HOME") + "/.config/quickshell/services/python/save_wallpaper.py", rawPath, vName])
|
||||
|
||||
@ -36,5 +36,12 @@ def save_wallpaper():
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
try:
|
||||
import subprocess
|
||||
file_url = wp_path if wp_path.startswith("file://") else f"file://{wp_path}"
|
||||
subprocess.run(["kwriteconfig6", "--file", "kscreenlockerrc", "--group", "Greeter", "--group", "Wallpaper", "--group", "org.kde.image", "--group", "General", "--key", "Image", file_url], capture_output=True)
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
if __name__ == '__main__':
|
||||
save_wallpaper()
|
||||
|
||||
@ -182,6 +182,7 @@ Item {
|
||||
wallpaperPath = imgPath.startsWith("file://") ? imgPath : "file://" + imgPath
|
||||
let rawPath = imgPath.replace("file://", "")
|
||||
Quickshell.execDetached(["plasma-apply-wallpaperimage", rawPath])
|
||||
Quickshell.execDetached(["kwriteconfig6", "--file", "kscreenlockerrc", "--group", "Greeter", "--group", "Wallpaper", "--group", "org.kde.image", "--group", "General", "--key", "Image", "file://" + rawPath])
|
||||
}
|
||||
let rawPath = imgPath.replace("file://", "")
|
||||
Quickshell.execDetached(["sh", "-c", "wallust run '" + rawPath + "' || ~/.cargo/bin/wallust run '" + rawPath + "' 2>/dev/null || true"])
|
||||
|
||||
Loading…
Reference in New Issue
Block a user