You are not logged in.

#26 2026-06-09 17:20:53

MAYBL8
Member
From: Florida USA
Registered: 2022-01-14
Posts: 408
Website

Re: trying to script kde plasma wallpaper settings

I hope you guys don't get mad at me.
I was really trying to do what you were saying with the confg files. But with doing that I was having issues keeping them the same from liveuser to installed user.
So I reached out to a couple of AI helpers also.
perplexity didn't work for me.
duckduckgo AI didn't work for me.
The one that worked was Claude desktop.
After a couple of mistakes that I caught that it made we got it working . I will show you all the files we used and the summary doc it created for me.
Hopefully we all learned something here.
Here are the files we created.
first the desktop file that goes into the autostart folder.

[Desktop Entry]
Type=Application
Name=Set Slideshow Wallpaper
Exec=/bin/bash /usr/local/bin/set-wallpaper-launcher.sh
OnlyShowIn=KDE;
X-KDE-autostart-phase=2
X-KDE-StartupNotify=false
X-KDE-AutostartEnabled=true

Then the script file that launches the script to change the wallpaper systemsettings.:

#!/bin/bash
sleep 15
exec "${HOME}/.local/bin/set-slideshow.sh"

Then the script to set the settings

#!/bin/bash

# Add near the top of set-slideshow.sh
#exec > "${HOME}/set-slideshow.log" 2>&1
#echo "Script started at $(date)"
#echo "DBUS: $DBUS_SESSION_BUS_ADDRESS"
#echo "HOME: $HOME"



# Abort if not running in a KDE Plasma session
if [ -z "$DBUS_SESSION_BUS_ADDRESS" ]; then
  exit 1
fi

WALLPAPER_DIR="${HOME}/.config/variety/Downloaded"
INTERVAL=300  # 5 minutes in seconds

# Wait until plasmashell is fully operational (up to 60s)
for i in {1..60}; do
  RESULT=$(qdbus org.kde.plasmashell /PlasmaShell \
    org.kde.PlasmaShell.evaluateScript "var d = desktops(); print(d.length);" 2>/dev/null)
  if [[ "$RESULT" =~ ^[1-9] ]]; then
    break
  fi
  sleep 1
done

if [[ ! "$RESULT" =~ ^[1-9] ]]; then
  # plasmashell never became ready, exit without self-deleting so it retries next login
  exit 1
fi

qdbus org.kde.plasmashell /PlasmaShell \
  org.kde.PlasmaShell.evaluateScript "
    var allDesktops = desktops();
    for (var i = 0; i < allDesktops.length; i++) {
      var d = allDesktops[i];
      d.wallpaperPlugin = 'org.kde.slideshow';
      d.currentConfigGroup = ['Wallpaper', 'org.kde.slideshow', 'General'];
      d.writeConfig('SlidePaths', '${WALLPAPER_DIR}');
      d.writeConfig('SlideInterval', ${INTERVAL});
    }
  "

# Only self-delete if we got this far (success)
#rm -- "${HOME}/.local/bin/set-slideshow.sh"
#rm -- "${HOME}/.config/autostart/set-wallpaper.desktop"

Then the summary doc file:

KDE Plasma Slideshow Wallpaper
Archiso Configuration Summary
Overview
This configuration automatically applies a KDE Plasma slideshow wallpaper using the Variety wallpaper manager's downloaded folder. It works for both the live ISO user and any user created after installation, by leveraging /etc/skel/ for file distribution.
File Structure
Place the following files in your archiso profile directory:

File	Location
set-wallpaper.desktop	airootfs/etc/skel/.config/autostart/
set-slideshow.sh	airootfs/etc/skel/.local/bin/
set-wallpaper-launcher.sh	airootfs/usr/local/bin/

File Contents
1. set-wallpaper.desktop
Stored in /etc/skel so it is copied to every user's home on account creation. The Exec line uses an absolute path to avoid shell variable expansion issues in .desktop files.
[Desktop Entry]
Type=Application
Name=Set Slideshow Wallpaper
Exec=/bin/bash /usr/local/bin/set-wallpaper-launcher.sh
OnlyShowIn=KDE;
X-KDE-autostart-phase=2
X-KDE-StartupNotify=false
X-KDE-AutostartEnabled=true

2. set-wallpaper-launcher.sh
A system-wide launcher at a fixed absolute path. Adds a delay to allow plasmashell to fully start before the main script runs.
#!/bin/bash
sleep 15
exec "${HOME}/.local/bin/set-slideshow.sh"

3. set-slideshow.sh
The main configuration script. Waits up to 60 seconds for plasmashell to become fully operational, then applies the slideshow wallpaper settings via the qdbus PlasmaShell API. Runs on every login to ensure settings persist after logout.
#!/bin/bash

if [ -z "$DBUS_SESSION_BUS_ADDRESS" ]; then exit 1; fi

WALLPAPER_DIR="${HOME}/.config/variety/Downloaded"
INTERVAL=300  # 5 minutes in seconds

for i in {1..60}; do
  RESULT=$(qdbus org.kde.plasmashell /PlasmaShell \
    org.kde.PlasmaShell.evaluateScript \
    "var d = desktops(); print(d.length);" 2>/dev/null)
  if [[ "$RESULT" =~ ^[1-9] ]]; then break; fi
  sleep 1
done

if [[ ! "$RESULT" =~ ^[1-9] ]]; then exit 1; fi

qdbus org.kde.plasmashell /PlasmaShell \
  org.kde.PlasmaShell.evaluateScript "
    var allDesktops = desktops();
    for (var i = 0; i < allDesktops.length; i++) {
      var d = allDesktops[i];
      d.wallpaperPlugin = 'org.kde.slideshow';
      d.currentConfigGroup = ['Wallpaper', 'org.kde.slideshow', 'General'];
      d.writeConfig('SlidePaths', '${WALLPAPER_DIR}');
      d.writeConfig('SlideInterval', ${INTERVAL});
    }
  "

profiledef.sh Permissions
Add these entries to the file_permissions array in your profiledef.sh:
file_permissions=(
  ["/etc/skel/.config/autostart/set-wallpaper.desktop"]="0:0:644"
  ["/etc/skel/.local/bin/set-slideshow.sh"]="0:0:755"
  ["/usr/local/bin/set-wallpaper-launcher.sh"]="0:0:755"
)

Required Packages
Ensure these are present in your packages.x86_64:
    • variety — wallpaper manager that populates the Downloaded folder
    • qt5-tools — provides qdbus (required for PlasmaShell API calls)
    • plasma-desktop — KDE Plasma desktop environment

How It Works
Stage	What Happens
Live ISO boot	liveuser gets files via /etc/skel copy. Autostart fires set-wallpaper-launcher.sh on KDE login, which runs set-slideshow.sh after a 15s delay.
After install	Installer copies /etc/skel to new user's home. set-wallpaper-launcher.sh is already system-wide. Same flow applies on first login.
Every login	Script reapplies settings each login to prevent Plasma from reverting to default wallpaper on logout/login.

Key Lessons Learned
    • Desktop file Exec lines do not support shell syntax — use an absolute path to a real script instead of bash -c '...' with variables or &&.
    • KDE logs 'ignoring unknown escape sequences' when shell syntax appears in Exec lines — check journalctl --user to diagnose autostart issues.
    • Do not self-delete the script — Plasma resets wallpaper settings on logout, so the script must reapply them on every login.
    • The plasmashell wait loop is essential — the script must poll until desktops() returns a valid count before applying settings.
    • Wallpaper path uses $HOME so it works for liveuser (/home/liveuser) and any installed user (/home/username) without hardcoding.

Thanks guys for not giving up on me and helping through this project.
It has been a great learning experience.
I hope you guys can take this and use some things from it also.

Offline

#27 2026-06-09 17:26:50

qinohe
Member
From: Netherlands
Registered: 2012-06-20
Posts: 1,596

Re: trying to script kde plasma wallpaper settings

ReDress wrote:

though I didn't quite get why people prefer them.

Mostly because tilling is the best option for me, I work a lot with apps like vim and ranger.
Quickly moving around using only a keyboard is what I prefer apps like vim and ranger are fully keyboard orientated
I have tried a modern approach with 'Niri' but I think I'm not ready for that, yet, though this new-kid on the block works surprisingly well wink

Anyway, isn't slideshow a Windows thing? Is Linux DEs supposed to just duplicate windows features?

Any desktop is basically the same, be it Mac, Unix or Windows and Linux too, they all have about the same ingredients only tilling WM's are a little different F.I. i3 and sway don't have a desktop

@MAYBL8, why would I get mad, of course not, it wouldn't be my way of doing it but you got it to work and that's what you were aiming for.
I would try and to not rely on AI that much, that's all wink

Last edited by qinohe (2026-06-09 17:41:44)

Offline

#28 2026-06-09 17:41:41

ReDress
Member
From: Nairobi
Registered: 2024-11-30
Posts: 322

Re: trying to script kde plasma wallpaper settings

qinohe wrote:
ReDress wrote:

though I didn't quite get why people prefer them.

Mostly because tilling is the best option for me, I work a lot with apps like vim and ranger.
Quickly moving around using only a keyboard is what I prefer apps like vim and ranger are fully keyboard orientated

For me Alt + Tab or Meta(Home) + select via arrow keys usually is good enough for moving around ...erhm... windows wink

Offline

#29 2026-06-09 19:04:21

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 75,879

Re: trying to script kde plasma wallpaper settings

If you cannot distribute (ideally in /etc/skel) a plasma config that does not get overridden on first launch (or *every* launch) you'd have to file a bug against plasma but I doubt that to be the case.

nb. that what you've there will
1. run on *every* plasma login
2. run a script that sleeps for 15s and then runs another script (you can just merge those)
3. dbus runs a javascript via dbus to query the count of virtual desktops (there's probably a better way for that)
4. dbus runs a javascript to write the plasma config (file)

I'm not mad at you for proving that LLMs are dumb, but this is batshit crazy and anyone actually using that might arguably get mad at you tongue

plasma *cannot* reasonably reset the config w/ every login and neither must your script - why how and when are the configuration files in #24 overwritten?
nb. that you cannot place them there while plasma is running (because then they'll reasonably get overidden when plasma writes the internal config back, eg. on on logout) - you have to provide them *before* logging into plasma

Offline

#30 Yesterday 02:16:09

MAYBL8
Member
From: Florida USA
Registered: 2022-01-14
Posts: 408
Website

Re: trying to script kde plasma wallpaper settings

@Seth
   I need to do some more testing on this.
   One thing I thought the same thing on combining the 2 scripts .

   There seems to be a difference on how the appletscr config file works from between liveuser and installed user.
   I will test this some more.

   I know it is not the best solution but it works. Now I can make it better.
   I don't know as much as you guys do so I am learning. I've said that in other posts I've made but it is the truth.
   For most users manually configuring the system is the easiest way.
   I don't know C or C++ . I know a little python. But I am not an expert at coding.
   I will continue to tweak this and make it better.

Offline

#31 Yesterday 08:05:18

ReDress
Member
From: Nairobi
Registered: 2024-11-30
Posts: 322

Re: trying to script kde plasma wallpaper settings

MAYBL8 wrote:

@Seth

I was really trying to do what you were saying with the confg files. But with doing that I was having issues keeping them the same from liveuser to installed user.

What exactly are you doing? I saw @pinohe talk about ISO a few times and didn't quite get exactly what that was referring to.

You're setting up wallpaper slideshow on a liveuser boot session?

Sorry, I'm just a high school computer teacher, I don't understand most of these things.

Offline

#32 Yesterday 11:45:12

MAYBL8
Member
From: Florida USA
Registered: 2022-01-14
Posts: 408
Website

Re: trying to script kde plasma wallpaper settings

ReDress wrote:
MAYBL8 wrote:

@Seth

I was really trying to do what you were saying with the confg files. But with doing that I was having issues keeping them the same from liveuser to installed user.

What exactly are you doing? I saw @pinohe talk about ISO a few times and didn't quite get exactly what that was referring to.

You're setting up wallpaper slideshow on a liveuser boot session?

Sorry, I'm just a high school computer teacher, I don't understand most of these things.

What I am doing is learning about archiso . You can look that up on the arch wiki. It is a method to build your own arch iso.
So what I wanted to do was customize it the way I wanted it. To use KDE Plasma and have plasma configured how I like it. One of the issues in doing that is I wanted to choose slideshow to rotate wallpapers at a specified interval. It is easy to do that through the systemsettings but I wanted it built that way for the liveuser and installed user when the iso gets built with archiso. It gets a little technical and I am trying to learn some of that. Allot of trial and error goes into it. There are people here allot smarter than me so I posed the question here to see if I could get some guidance .
I have a github that you can download or look at what to see what I have done.
It is here.  https://github.com/mylastarch/mylastarch-Rc1

Last edited by MAYBL8 (Yesterday 11:45:58)

Offline

#33 Yesterday 14:32:04

qinohe
Member
From: Netherlands
Registered: 2012-06-20
Posts: 1,596

Re: trying to script kde plasma wallpaper settings

I can imagine you don't want to go trough the same settings every time you start your ISO.
What I don't get and I do agree with seth on this one is when you install the system you want a pre configured system but you only do that once!!
Personally I would maybe use some backups from a previous system, but, that would be it...
Why would you configure a new system with config files that are prone to renewal.
And if it comes to that are you then going to write pacnew files for your ISO's ?
My bet is you're going to be done with this pretty quick due to the overhead
Of course do what you like however I think you give yourself a lot of work

Than there is your github repo, I promise you that will become outdated in a few months and will be a pain in the butt for someone willing to try it!!
I have a script that builds my profile for me, so everything I want on an ISO is made like templates which I copy on top of a fresh F.I. releng profile by using a matrix like way of scripting, my profiles never get outdated!
That way I only need to maintenance the templates not the whole profile, which will in the end be a pain in the ass!
If I have the time I will try and make it usable for 'any' user and upload to github or gitlab, it's kinda long 700+ lines of shell scripting wink
It basically simple and does most of the profile building for me like bootfiles, packages(add or remove), customrepos, skeleton dir., root dirs., change some profiledef values etc. etc.
However I need to write a good user guide first for it's complicated to use, at least at first that is, then it gets easy.
That said I really need some time but I will publish it in a little while...

Offline

#34 Yesterday 14:59:49

ReDress
Member
From: Nairobi
Registered: 2024-11-30
Posts: 322

Re: trying to script kde plasma wallpaper settings

I can imagine you don't want to go trough the same settings every time you start your ISO.
What I don't get and I do agree with seth on this one is when you install the system you want a pre configured system but you only do that once!!

Yeah, I'm not exactly knowledgeable but it would probably make more sense if you modd'd KDE directly since it seems you're keen on sharing the final product.

That is the ultimate best platform for your changes!

Last edited by ReDress (Yesterday 15:00:53)

Offline

#35 Yesterday 15:27:29

qinohe
Member
From: Netherlands
Registered: 2012-06-20
Posts: 1,596

Re: trying to script kde plasma wallpaper settings

Well, for sure you can pre-configure everything, it's always up to user trying a profile to change it or not!
However, I would try to  stay as vanilla as possible and mention changes done to the user environment, always...

Offline

#36 Yesterday 15:47:26

ReDress
Member
From: Nairobi
Registered: 2024-11-30
Posts: 322

Re: trying to script kde plasma wallpaper settings

qinohe wrote:

Well, for sure you can pre-configure everything, it's always up to user trying a profile to change it or not!
However, I would try to  stay as vanilla as possible and mention changes done to the user environment, always...

I'd like to assume you're not just prying for my POV(as hard as that might seem given the level of suspicion I have been held to)

But, I finished my work years ago. I passed on the intended message.

Last edited by ReDress (Yesterday 15:50:50)

Offline

#37 Yesterday 15:58:25

qinohe
Member
From: Netherlands
Registered: 2012-06-20
Posts: 1,596

Re: trying to script kde plasma wallpaper settings

Of course not, it means I agree with your point of view, English is not my first language so I may express myself bad sometimes...

Offline

#38 Yesterday 16:10:54

ReDress
Member
From: Nairobi
Registered: 2024-11-30
Posts: 322

Re: trying to script kde plasma wallpaper settings

qinohe wrote:

Of course not, it means I agree with your point of view, English is not my first language so I may express myself bad sometimes...

Part of the problem. And the whole problem, it seems to me, is that someone is trying to be very discreet.

Consequently, it causes a scene.

Offline

#39 Today 12:36:22

MAYBL8
Member
From: Florida USA
Registered: 2022-01-14
Posts: 408
Website

Re: trying to script kde plasma wallpaper settings

qinohe wrote:

I can imagine you don't want to go trough the same settings every time you start your ISO.
What I don't get and I do agree with seth on this one is when you install the system you want a pre configured system but you only do that once!!
Personally I would maybe use some backups from a previous system, but, that would be it...
Why would you configure a new system with config files that are prone to renewal.
And if it comes to that are you then going to write pacnew files for your ISO's ?
My bet is you're going to be done with this pretty quick due to the overhead
Of course do what you like however I think you give yourself a lot of work

Than there is your github repo, I promise you that will become outdated in a few months and will be a pain in the butt for someone willing to try it!!
I have a script that builds my profile for me, so everything I want on an ISO is made like templates which I copy on top of a fresh F.I. releng profile by using a matrix like way of scripting, my profiles never get outdated!
That way I only need to maintenance the templates not the whole profile, which will in the end be a pain in the ass!
If I have the time I will try and make it usable for 'any' user and upload to github or gitlab, it's kinda long 700+ lines of shell scripting wink
It basically simple and does most of the profile building for me like bootfiles, packages(add or remove), customrepos, skeleton dir., root dirs., change some profiledef values etc. etc.
However I need to write a good user guide first for it's complicated to use, at least at first that is, then it gets easy.
That said I really need some time but I will publish it in a little while...

Let me try to address some of your points.
I may not understand all you are trying to say but as far as going though the same settings everytime you start your ISO I would say you only start the ISO only once or twice and then you install.
Some of the config files I copied from an installed system I already have
As far as configuring a system with files that are prone to renewal . Those are the ones I wanted to configure and operate the way I wanted them to
Don't think I see the need for the pacnew files. I would just create a new ISO
My goal is to keep the github updated but we will see how that goes.
I am always in favor of less work to do hence getting help from here and AI.
I would be very much interested in your templates when you get the time to do them. Maybe I could help with that
You should try AI for your user guide. It wrote my summary doc.

As I said earlier I really appreciate the help and guidance on this project of mine

Last edited by MAYBL8 (Today 12:37:08)

Offline

#40 Today 12:44:17

ReDress
Member
From: Nairobi
Registered: 2024-11-30
Posts: 322

Re: trying to script kde plasma wallpaper settings

I think you just immigrate to Cuba is a more reliable option

Offline

Board footer

Powered by FluxBB