If you're looking for a pure bash implementation, ImageMagick's convert
command is what you're looking for:
for szFile in /path/*.png
do
convert "$szFile" -rotate 90 /tmp/"$(basename "$szFile")" ;
done
Above will leave existing files intact and copy the newly rotated ones to /tmp
so you can move or copy them somewhere else or even replace the existing ones after the conversion and after verification.
(and it'll work on all recent releases of Ubuntu as it's standard software)
What will you need ? xdotool (sudo apt-get install xdotool
) and couple different profiles. I have 8 different profiles in my gnome-terminal , all with different colors or background settings. Make sure you have the menu bar (File, Edit, etc.) enabled. Otherwise - won't work
The command
xdotool key alt+f b $( expr $RANDOM % 8 )
Explanation: we get a random number $RANDOM as generated by the shell, get it's modulus (remainder) out of division by maximum number of profiles you have, and let xdotool
execute sequence of keyboard shortcuts that correspond to dropping down File
(alt+f) menu, selecting open new tab
(b), and selecting profile with corresponding number
You can turn this command into an alias (alias newtab='xdotool key alt+f b $( expr $RANDOM % 8 )'
) or script
I've taken that very same alias and placed it into my .mkshrc
file (because I use mksh, not bash, so for you it's .bashrc). Here it is in action
Update | April 22, 2015
Here's a script to open a terminal window with your desired profile (and for each profile you can specify your own colors and background picture). Bind it to a keyboard shortcut through System Settings -> Keyboard -> Shortcuts -> Custom.
For the command add full path to script
The script
#!/bin/bash
PROFILE=$(zenity --entry --text="Enter Profile Name")
gnome-terminal --window-with-profile="$PROFILE" &
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: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: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.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 incron
to specify that, for example, every hour the background should be changed to a specific picture.