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 suppport for KDE/Plasma #28
Conversation
lib/linux.js
Outdated
set: ['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")}' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use a template literal here for the code and format it properly, for readability reasons.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What JS engine and version is PlasmaShell
running?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure what you mean with template literal here (haven't worked much with JS).
Also don't know much about the JS engine.
Just wanted to share my solution here after I managed to find/create a working command.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I found them of course :D Just not sure how to apply them here.
Just use the multiline (without \n) functionality like follows or do some magic tricks with replacement and more?
set: ['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");
}` ]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's what I was thinking, yes.
Can't we just change the order to prefer this if available over |
I think qdbus is available on (at least some) other systems (not running Plasma) as well, so it would be used instead of gsettings and thereby break the functionality. |
We could detect if Plasma is installed then. |
I did some formatting tweaks. Can you confirm it still works? |
Yes, we could check for As this probably affects other desktops as well I suggest doing this separate from this PR. Will check your changes when I am home |
Works |
On my linux system with Plasma (running Arch Linux/Manjaro) this tool does not work since neither gsettings nor gconftool-2 nor dcop work even though they are present.
This PR adds a working method using qdbus.
Without #27 or similar this does not really help as the other ones (gsettings ...) are present and used first.
As a workaround I just manually delete all other services from the lib/linux.js script for now.