Ubuntu – How to rotate background Images in Gnome-Terminal

command linegnome-terminalsoftware-recommendation

I have an image I use as a background while using the terminal.

I would like to know if there is a way for a selected few images can be rotated when using the terminal.

Not like a moving screen-saver, more like a rotating desktop background.

Best Answer

This is a slightly tricky question, as to change the terminal background image you have to feed gconftool-2 the exact string each time (as below), i.e. the exact location of your picture. There is no way to suggest that it takes any (*) pictures from the selected folder, so the exact command must be specified each time, as in the example below:

gconftool-2 --set /apps/gnome-terminal/profiles/Default/background_image --type=string /home/mike/Pictures/Canon/2012_09_05/IMG_1130.jpg

However, you can hack together a basic terminal wallpaper changer script like I show below. In this script I declare the variables and then call them and simply use sleep to give a delay between the changes. It works, but you can expand it to include more variables and more sleep commands to last several hours or more.

It changes the background whether the terminal is running or not, as it is the equivalent of using the gconftool-2 command above on the command-line. However, in your profile you must have selected 'image' and not 'solid' background in edit > profile preferences > background image, or by running the below command:

gconftool-2 --set /apps/gnome-terminal/profiles/Default/background_type --type=string image

The default terminal profile is selected in the command, so make sure that is the one you are using or change it as you wish.

One thing to watch out for is very high resolution pictures, as gnome-terminal tends to guzzle a lot of memory if you use 2-3mb images for your wallpaper, so its best to use 200-300kb images.

Save the script in a text-editor, make it executable with chmod u+x and then you can click to execute it.

#!/bin/bash

# a very simple script to act as an automatic background-switcher for gnome-terminal

pic1="gconftool-2 --set /apps/gnome-terminal/profiles/Default/background_image --type=string /home/mike/Pictures/Canon/2012_09_05/IMG_1130.jpg"
pic2="gconftool-2 --set /apps/gnome-terminal/profiles/Default/background_image --type=string /home/mike/Pictures/Canon/2012_09_05/IMG_1155.jpg"
pic3="gconftool-2 --set /apps/gnome-terminal/profiles/Default/background_image --type=string /home/mike/Pictures/Canon/2012_09_05/IMG_1163.jpg"
pic4="gconftool-2 --set /apps/gnome-terminal/profiles/Default/background_image --type=string /home/mike/Pictures/Canon/2012_09_05/IMG_1164.jpg"

$pic1
sleep 600
$pic2
sleep 600
$pic3
sleep 600
$pic4
exit 

Other alternatives

It is a very simple script and will obviously need to be restarted when the number of pictures to change runs out, so it might be better to use one of the gconftool-2 commands in cron to specify that, for example, every hour the background should be changed to a specific picture.

Related Question