Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for setting the wallpaper in Plasma 6 #673

Merged
merged 2 commits into from
Jan 4, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions data/scripts/set_wallpaper
Original file line number Diff line number Diff line change
Expand Up @@ -128,16 +128,22 @@ fi
if [ "${KDE_FULL_SESSION}" == "true" ]; then
# Plasma 5.7 introduced a new feature to set the wallpaper via a dbus script:
# https://github.com/KDE/plasma-workspace/commit/903cbfd7e267a4812a6ec222eb7e1b5dd775686f
if [[ -n "${KDE_SESSION_VERSION}" && "${KDE_SESSION_VERSION}" == '5' ]]; then
dbus-send --type=method_call --dest=org.kde.plasmashell /PlasmaShell org.kde.PlasmaShell.evaluateScript string:"
plasma_qdbus_script="
let allDesktops = desktops();
for (let d of allDesktops) {
if (d.wallpaperPlugin == 'org.kde.image') {
d.currentConfigGroup = Array('Wallpaper', 'org.kde.image', 'General');
d.writeConfig('Image', 'file://""$WP""')
d.writeConfig('Image', 'file://""$WP""');
}
}
"
"
if [[ -n "${KDE_SESSION_VERSION}" && "${KDE_SESSION_VERSION}" == '6' ]]; then
dbus-send --type=method_call --dest=org.kde.plasmashell /PlasmaShell org.kde.PlasmaShell.evaluateScript string:"$plasma_qdbus_script"
# Reuse the exit code from dbus
exit "$?"

elif [[ -n "${KDE_SESSION_VERSION}" && "${KDE_SESSION_VERSION}" == '5' ]]; then
guss77 marked this conversation as resolved.
Show resolved Hide resolved
dbus-send --type=method_call --dest=org.kde.plasmashell /PlasmaShell org.kde.PlasmaShell.evaluateScript string:"$plasma_qdbus_script"
# Reuse the exit code from dbus
dbus_exitcode="$?"

Expand Down