Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
2 images for wallpaper
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Multimedia
View previous topic :: View next topic  
Author Message
redbeardmcg
Apprentice
Apprentice


Joined: 12 Mar 2006
Posts: 171
Location: Suburbia Massachusetts

PostPosted: Sun Jan 21, 2007 6:49 am    Post subject: 2 images for wallpaper Reply with quote

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.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Multimedia All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum