![]() Registered Member ![]()
|
Hello everyone,
I'm trying to execute the following script that changes the wallpaper in plasma, but are having some difficulties executing it the way I would like.
Now, this script works very well, but the problem I'm having is executing it. The way I've been executing it is by running the following command, which opens up a window with my code in it and an execute button that can run the script.
I'm using the script inside of another program, so I woud really like it if I could execute this script without having the gui open and then having to select execute. So in other words a qdbus command to execute the script for me, kind of like how the default desktop settings program does it. |
![]() Administrator ![]()
|
I'm afraid that Plasma Desktop doesn't support such automatic execution of scripts, only the manual execution you are currently using. You could automate the selection of "Execute" using xte however.
KDE Sysadmin
[img]content/bcooksley_sig.png[/img] |
![]() Registered Member ![]()
|
That's unfortunate, but if I can't execute it that way, then maybe there's an alternative method I could perform. For example, the way that "default desktop settings" changes it in the same method that the script above does, only it doesn't pop open the window to execute it. I could be mistaken, but I doubt default desktop settings automates the execution of the script, or it has a different method of changing it, which I would be interested in looking at. I would like to check the source code for default desktop settings, but I have no idea where to look. I don't even know the the actual program's name is, or if it's packaged with plasma. Would you mind pointing me in the right direction of the source code, if there is any? |
![]() Administrator ![]()
|
The Default Desktop settings window is part of the actual Plasma Desktop process itself, which is how it is able to perform these changes. Unfortunately i'm not sure exactly where the code is located for the window itself - as Plasma uses a highly plugin based approach, I suspect the code will be located somewhere in the wallpaper though.
KDE Sysadmin
[img]content/bcooksley_sig.png[/img] |
![]() Registered Member ![]()
|
Here is how I change the wallpaper using Python: https://github.com/warvariuc/mykde/blob ... _init__.py
|
![]() Administrator ![]()
|
Please note that Plasma Desktop won't pick this up until it's restarted, and your changes could potentially be overwritten by Plasma Desktop itself when it exits.
KDE Sysadmin
[img]content/bcooksley_sig.png[/img] |
![]() Registered Member ![]()
|
Yes, that the line `affects = [mykde.Plasma]` which ensures that Plasma is stopped before making this stuff and then started again.
|
![]() Registered Member ![]()
|
Can this be executed as a servicemenu for dolphin? I am looking for a way to browse by photos with dolphin (fullscreen, not widescreen monitor, so no space to drag and drop) and then just rightclick on an image file and choose "set as wallpaper"... |
![]() Registered Member ![]()
|
Yes, but only after you change it to a script that takes path to the wallpaper as a command line argument. I can do that, if you can't. |
![]() Registered Member ![]()
|
That would be great!! |
![]() Registered Member ![]()
|
Here is the script: https://github.com/warvariuc/kde-wallpa ... llpaper.py
|
Registered users: Bing [Bot], Google [Bot], Sogou [Bot]