redbeardmcg Apprentice
Joined: 12 Mar 2006 Posts: 171 Location: Suburbia Massachusetts
|
Posted: Sun Jan 21, 2007 6:49 am Post subject: 2 images for wallpaper |
|
|
I don't know if there is a utility to do this, but i found the only way to have a different wallpaper for 2 screens in gnome is to combine 2 images, so I wrote a script incase anyone is interested.
Code: | #! /bin/bash
#
# Ryan McGuire's wallpaper maker-
# Make sure to change the resoluions to fit your needs
#
# Minimum number of args
MINARGS=2
# Check to ensure there are 2 images defined
if [ $# -lt "$MINARGS" ]
then
echo
echo "Please enter 2 image names"
echo
echo "Usage: makewall file1 file2 [Destination Directory] [Destination File]"
echo
exit 0
fi
# Check to make sure the images exist
if [ ! -e "$1" ] || [ ! -e "$2" ]
then
echo
echo "Please make sure the images exist first!"
echo
exit 0
fi
# Convert the first image
echo
echo "Resizing and Cropping First Image..."
convert $1 -verbose -resize 1365x1024 -gravity center -crop 1280x1024+0+0 +repage /tmp/img1.jpg
echo
# Convert the second image
echo "resizing and Cropping Second Image..."
convert $2 -verbose -resize 1365x1024 -gravity center -crop 1280x1024+0+0 +repage /tmp/img2.jpg
echo
# Check if a destination directory is specified
if [ -e "$3" ]
then
DESTDIR="$3"
else
DESTDIR="./"
fi
# Check to see if a destination filename is specified
if [ -e $4 ]
then
DESTFILE="$4"
else
DESTFILE="wallpaper.jpg"
fi
# Append the second image to the first
echo
echo "Combining Images and making wallpaper in $DESTDIR"
convert -verbose /tmp/img1.jpg /tmp/img2.jpg +append $DESTDIR/$DESTFILE
echo
echo "Opening image"
eog $DESTDIR/$DESTFILE &&
echo
exit 0 |
I am a newbie at shell scripting, so im sure it could be a lot better, but it works assuming you have imagemagick installed _________________ Sacrifice:::Your role may be thankless, but if you're willing to give it your all, you just might bring success to those who outlast you. |
|