How to Change Background pictures automaticaly at regular internver

@Terry_Rosinski

Did you added new pictures to the ones that were there ?
If yes, did you have to add them one by one or you simply COPIED them into some folder ?

JF
I am ok now, pictures are rotating in a loop, but when I tried to add some picture, I think we have to add them one by one through some tools, but I am not sure… DIdn’t played / tried enough yet… So if you imported a lot of pictures you had easily, let me know how… THe file format, from what I saw, was not the same…

Yes, I added them one by one. Used the Settings-Wallpaper-Picture-add a picture, it then adds your picture to your home…hidden folder with .e\e17\backgrounds\…which have the.edj formats

2 Likes

It worked. And after that, I brought back those personal / custom pictures to /usr/share/enlightenment/data/backgrounds

Good to hear that o:)

Can you please provide me with your script that allows the repeat loop. I don’t write code and can understand some of what is written but can write any.

I followed @Thanatermesis recommendation
while true ; do
OLD CODE LOOP - (the “for” block code)
done

So it is the following :

#!/bin/bash
source /usr/lib/elive-tools/functions

main(){
    # pre {{{
    local file

    if grep -qs "boot=live" /proc/cmdline ; then
        is_live=1
    fi

    for arg in "$@"
    do
        case "$arg" in
            --delay=*)
                time_switching_seconds="${arg##--delay=}"
                shift
                ;;
        esac
    done

    # }}}

    # minutes
    #time_switching_seconds="$(( 5 * 60 ))"
    # seconds
    if [[ -z "$time_switching_seconds" ]] ; then
        time_switching_seconds="20"
    fi

    # default wallpaper to use
    default_wallpaper="/usr/share/enlightenment/data/backgrounds/Elive Stars.edj"

    #el_debug "Starting (infinite) loop for switching between existing wallpapers"
    #while true
    #do

    # wait a bit before to start
    if ((is_live)) ; then
        sleep 40
    fi

    el_debug "Starting demo switch between wallpapers"

    # not infinite loop mode, so more friendly
    while true ; do
    for file in /usr/share/enlightenment/data/backgrounds/*edj $HOME/.e/*/backgrounds/*edj
    do
        if [[ -s "$file" ]] ; then

            el_debug "Switching to desktop wallpaper: $file"

            enlightenment_remote -desktop-bg-set "$file"

            sleep "$time_switching_seconds"
        fi
    done
    done

    if [[ -s "$default_wallpaper" ]] ; then
        el_debug "Set default wallpaper: $default_wallpaper"
        enlightenment_remote -desktop-bg-set "$default_wallpaper"
    fi

}

#
#  MAIN
#
main "$@"

# vim: set foldmethod=marker :

so I used the script in usr bin
Screenshot%20from%202018-09-20%2020%3A08%3A24

I edited the post of @yoda to be correctly formated in the forum, so that @Terry_Rosinski can copy-paste it correctly (using the "pre-formated text" )

Also removed the & from the done which was in the wrong place, I assume that the script works good this way, but to run it in background mode you need to do the background to the command itself (not the inside code), something like:

command-wallpapers-stuff &
exit

it will exit from the terminal after to run it in background
that way to run the command can be added to the file .elxstrt to run it at the desktop startup

1 Like

2 posts were merged into an existing topic: Update of desktop not working

Weird it was working, I was typing enlightenment-wallpapers-switcher 1 in the terminal window and was closing the terminal windows and the background changing was ok. but I will modify it and add it to elxstrt so I don't have top start it manually

yes it worked but the & was in the wrong place, so you needed to run the entire command/tool in background and instead it ran the loop in background (which, just run the loop and continued the script process), this causes the somewhat bug that just after to start the loop, the default background is set, but you simply don’t notice this since just after that it starts switching to the first/next wallpaper

1 Like

Trying to locate that file without success... .elxstrt

its in the home of the user:

cd
cat .elxstrt
scite .elxstrt

1 Like

How do I add the line properly ?
that line at the end ?

/usr/bin/enlightenment-wallpapers-switcher

nope, this will run the original script (see the full address), since you moved it to your home you should use the new address

but since your PATH variable should contain your home as preference if the directory exists (i mean, $HOME/bin/ , or $HOME/.local/bin/ if you preffer this other one), running the command itself without the full path address will search for it in your home first, so running it instead of hte original script

so at the end I add :

$HOME/bin/enlightenment-wallpapers-switcher

??
I mean after :
#egrep -i ‘synap|alps|etps|elan’ /proc/bus/input/devices
#if grep -qsiE ‘synap|alps|cyapa|trackpad|etps|elan’ /proc/bus/input/devices ; then
#if ! ps ux | grep -v “grep” | grep -qs “syndaemon” ; then
#LC_ALL=C syndaemon -d -i 1 -t -k &
#fi
#fi
$HOME/bin/enlightenment-wallpapers-switcher

Yes, but:

  • add also an & at the end of the command

Small correction: I said before that you didn’t needed the full path because the variable PATH was already using this place as preference against /usr/bin, this was true but only for your terminal shell, not for the script, so yes your command is correct this way (including the full path) :slight_smile:

1 Like

Someone could me the default enlightenment-wallpapers-switcher 1 script ?
months ago, I tweaked it for my own purpose and I would like to bring it back to it's default to experience the Elive 3.0.3 background "stuff" @Thanatermesis prepared for us.

I don't know if I will be able to experience it's magic on a 2 screen Elive config, but want to try.

For now I simply see my own rotating WallPapers...
JF
I could reinstall Elive in a VM to get the default script but asking for it hear is simpler.

to recover it, reinstall the package (apir) which includes it (dpkg -S /usr/bin/filename…), or delete the script that you copied in your home location (so that the original one will be used instead)

1 Like