Cinnamon, dbus, and the slideshow scripts

Please post suggestions for improvement of Cinnamon on:
https://github.com/linuxmint/Cinnamon
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
Altreus

Cinnamon, dbus, and the slideshow scripts

Post by Altreus »

Hihi

I've been working on some scripts for my slideshow because I have an image dump and I'd like to throw away wallpapers that suck. I also like the option I have on Windows 10 of being able to right-click the desktop and just skip to the next image. This is good if it randomly picks the same images in short order without giving the rest a fair shake.

So I have one script called `wp-sucks` and another called `wp-next`. (Please use these if you want them)

Code: Select all

#!/bin/bash
# wp-sucks

WP=$(gsettings get org.cinnamon.desktop.background picture-uri | tr -d \')

rm ${WP/file:\/\//}

wp-next

Code: Select all

#!/bin/bash
#wp-next

WPPATH=$(
    gsettings get org.cinnamon.desktop.background.slideshow image-source \
    | tr -d \'
)

WPPATH=${WPPATH/directory:\/\//}
WP=$( shuf -n 1 <(command ls -1 $WPPATH) )
gsettings set org.cinnamon.desktop.background picture-uri file://$WPPATH/$WP
gsettings set org.cinnamon.desktop.background.slideshow slideshow-enabled true
So the weird thing is this last line, because if I set the picture-uri manually it disables the slideshow, so I have to turn it back on again. But it seems like this sometimes gets stuck and it's hard to reproduce this problem (although this might have been testing issues).

My question is, is there a better way of asking the slideshow to advance now? Can I poke whatever internal timer is running to get it to trigger immediately?
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
deepakdeshp
Level 20
Level 20
Posts: 12341
Joined: Sun Aug 09, 2015 10:00 am

Re: Cinnamon, dbus, and the slideshow scripts

Post by deepakdeshp »

If I have helped you solve a problem, please add [SOLVED] to your first post title, it helps other users looking for help.
Regards,
Deepak

Mint 21.1 Cinnamon 64 bit with AMD A6 / 8GB
Mint 21.1 Cinnamon AMD Ryzen3500U/8gb
Altreus

Re: Cinnamon, dbus, and the slideshow scripts

Post by Altreus »

As a follow-up to my previous post, I have also noticed that if I use gsettings to change the directory the wallpapers are drawn from, the slideshow stalls, even if I reactivate it. They don't start again until I go into the wallpaper settings GUI and turn the slideshow off and on again.
I appreciate you looking at my question but this link is about slide shows in LibreOffice Impress, not the Cinnamon desktop wallpaper slideshow.
Altreus

Re: Cinnamon, dbus, and the slideshow scripts

Post by Altreus »

I've discovered that I can trigger the next image by toggling the flag that enables the slideshow in the first place

Code: Select all

#!/bin/bash

gsettings set org.cinnamon.desktop.background.slideshow slideshow-enabled false
sleep 1
gsettings set org.cinnamon.desktop.background.slideshow slideshow-enabled true
This seems to require the sleep and causes my laptop to try to take off while it does the change. It doesn't seem to get quite so warm when changing normally. It also seems like a hack and a half.
Locked

Return to “Cinnamon”