Skip to content
This repository was archived by the owner on Jul 11, 2023. It is now read-only.
Draft
Show file tree
Hide file tree
Changes from all commits
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
15 changes: 15 additions & 0 deletions build/lib/wpreddit/wallpaper.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,21 @@ def linux_wallpaper():
check_call(["feh", "--bg-fill", path])
elif check_de(de, ["sway"]):
check_call(["swaymsg", "output * bg %s fill" % path])
elif check_de(de, ['plasma']):
command = """
qdbus org.kde.plasmashell /PlasmaShell org.kde.PlasmaShell.evaluateScript "
var allDesktops = desktops();
print (allDesktops);
for (i=0;i<allDesktops.length;i++) {
d = allDesktops[i];
d.wallpaperPlugin = 'org.kde.image';
d.currentConfigGroup = Array('Wallpaper',
'org.kde.image',
'General');
d.writeConfig('Image', 'file://%s')
}"
""" % path
check_call(command, shell=True)
elif config.setcmd == '':
print("Your DE could not be detected to set the wallpaper. "
"You need to set the 'setcommand' paramter at ~/.config/wallpaper-reddit. "
Expand Down
16 changes: 16 additions & 0 deletions wpreddit/wallpaper.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,22 @@ def linux_wallpaper():
check_call(["feh", "--bg-fill", path])
elif check_de(de, ["sway"]):
check_call(["swaymsg", "output * bg %s fill" % path])
elif check_de(de, ['plasma']):
# This is a small script to add the wallpaper on each monitor in plasma
command = """
qdbus org.kde.plasmashell /PlasmaShell org.kde.PlasmaShell.evaluateScript "
var allDesktops = desktops();
print (allDesktops);
for (i=0;i<allDesktops.length;i++) {
d = allDesktops[i];
d.wallpaperPlugin = 'org.kde.image';
d.currentConfigGroup = Array('Wallpaper',
'org.kde.image',
'General');
d.writeConfig('Image', 'file://%s')
}"
""" % path
check_call(command, shell=True)
elif config.setcmd == '':
print("Your DE could not be detected to set the wallpaper. "
"You need to set the 'setcommand' paramter at ~/.config/wallpaper-reddit. "
Expand Down