Welcome to the Tiny Core Linux Wiki at tinycorelinux.net!

View Random Image

Ordinary Background Image

Copy image to /opt/backgrounds. To select background image, open the Control Panel, and click Wallpaper.

Random Background Image

You may have a number of images, and like a random background image each time you start the computer. You need persistent opt. Following is a guide on how this can be set up.

Copy images to /opt/backgrounds.

Open a text editor, and paste the following.

# This selects a random picture and changes the background image.

#!/bin/sh
cd /opt/backgrounds
/bin/rm -f pic.jpg
NUMBPIC=$(ls | wc -l)
PICSEL=$((($RANDOM%$NUMBPIC) +1))
PICCHANGE=$(ls | tail -$PICSEL | head -1)
cp $PICCHANGE pic.jpg
hsetroot -full /opt/backgrounds/pic.jpg
[ -x /usr/bin/wbar.sh ] && wbar.sh

Save this file as pic.sh in /opt.

Open the terminal and type

sudo chmod 775 /opt/pic.sh

Add the following to /opt/shutdown.sh.

/opt/pic.sh

Restart the computer.

Opening the Control Panel, click Wallpaper, and select “pic.jpg.”

You will now have a random background image each time you start the computer.

If you use backup, and this is not working, set up persistent opt.

View Random Images

You may set it up to change random images at regular intervals. The default is 10 seconds.

This could be used to display photos.

After doing what has already been discussed above, open a text editor, and paste the following.

# To be used with pic.sh
# This changes the background image at regular intervals.

#!/bin/sh
V=0
while [ $V -ne 5 ]
do
/opt/pic.sh
sleep 10  # Change this to the number of seconds you want it to wait.
done

Save this file as view.sh in /opt.

Open the terminal and type

sudo chmod 775 /opt/view.sh

Add the following line to /opt/bootlocal.sh

sudo cp /opt/view.sh /usr/sbin

Restart the computer.

To view random images, open the terminal and type

view.sh

To stop images changing (with the terminal open), press Ctrl+c.

This will change the image every 10 seconds. To change the time interval, edit the file /opt/view.sh, and change the line

sleep 10

Make this the number of seconds you want it to wait before changing images.

View without Wbar

If you use this to display images, you may want to remove the wbar, by including the bootcode

noicons

in the bootloader.

Restart the computer for this to take effect.

Turn Off Power Management

You may also want to disable power management, to prevent the screen from going off. To do this open ~/.xsession, and add the line

xset s off

Restart the computer for this to take effect.

Names with Spaces or Unusual Characters

You cannot load an image with a space in it's name, or certain other characters, such as brackets. If an image file has a space, brackets, or other unusual characters, rename it, excluding these.

Print/export
QR Code
QR Code wiki:random_background (generated for current page)