i92guboj Gentoo support team

Registered: May 2008 Location: Lucena, Córdoba (Spain) Distribution: Gentoo Posts: 4,083

Rep:





Code: #!/bin/bash # random_wallpaper.sh # Reads a given directory and set a random # wallpaper using the images on that dir. # Set WALLPAPERDIR and change feh --scale-bg # to your likings WALLPAPERDIR="$HOME/wallpapers" if [[ -d "${WALLPAPERDIR}" ]] then files=$(ls "${WALLPAPERDIR}") file_matrix=($files) num_files=${#file_matrix[*]} feh --bg-scale "${WALLPAPERDIR}/${file_matrix[$((RANDOM%num_files))]}" fi exit 0



Code: #!/bin/bash # random_wallpaper_slideshow.sh # Reads a given directory and set a random # wallpaper using the images on that dir. # The script stays resident until you kill it # and changes the background periodically. # The period is adjustable by the sleep command WALLPAPERDIR="$HOME/wallpapers" if [[ -d "${WALLPAPERDIR}" ]] then while(true) do files=$(ls "${WALLPAPERDIR}") file_matrix=($files) num_files=${#file_matrix[*]} feh --bg-scale "${WALLPAPERDIR}/${file_matrix[$((RANDOM%num_files))]}" sleep 10m done fi exit 0



For the videos (including flv files from youtube) you can use mplayer, maximized, without border and window titles and sticked to the background of the desktop. How to configure the window to look adequately is up to you and your window manager or desktop environment.



Of course, this are just my home made solutions because I don't use big desktops nor strange tools for these things. There might be specific tools for this, but I don't know about them. For pictures:You can set up your window manager or desktop to launch this script at startup. An extended version of the script would be this:Again, how to launch it at startup is a thing of the wm or de. Remember: this script will stay around in memory until you kill it. So, if it's launched when you enter your session, then you exit the session and open another session, and you don't kill the script when closing sessions, you will have many instances of it running in the background, which can have undesired effects :PFor the videos (including flv files from youtube) you can use mplayer, maximized, without border and window titles and sticked to the background of the desktop. How to configure the window to look adequately is up to you and your window manager or desktop environment.Of course, this are just my home made solutions because I don't use big desktops nor strange tools for these things. There might be specific tools for this, but I don't know about them.