LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu
User Name
Password
Ubuntu This forum is for the discussion of Ubuntu Linux.

Notices


Reply
  Search this Thread
Old 12-18-2010, 05:05 AM   #1
grail
LQ Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 10,007

Rep: Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192
(Not a question) Ubuntu backgrounds (gnome)


So I have been playing around with Ubuntu's changing backgrounds and thought someone here
might appreciate the fruits of this labour

So if you copy the 2 pieces of code below into your Pictures directory, you can make as many
of these types of backgrounds as you like

Template: This is the standard template used to create the background transitions:
Code:
<background>
<static>
  <duration>600.0</duration>
  <file></file>
</static>
<transition>
  <duration>5.0</duration>
  <from></from>
  <to></to>
</transition>
</background>
Please this in a file in your Pictures directory and call it: background_template.xml

Code: This is the code to create each individual transition file:
Code:
#!/bin/bash

(( $# != 2 )) && { echo "Usage: $0 DIRECTORY FILENAME [EXTENSIONS]"; exit 1; }

DIRECTORY=~/Pictures/$1
FILENAME=$DIRECTORY/${2}.xml
TEMPLATE=~/Pictures/background_template.xml

[[ -d $DIRECTORY ]] || { echo "No such directory $DIRECTORY"; exit 1; }

exec >$FILENAME

START="<background>"
STATIC=$(awk '/stat/,/from/' $TEMPLATE)
TRANSITION=$(awk '/to/,/trans/' $TEMPLATE)
END=$(awk 'END{print}' $TEMPLATE)

echo $START

for PIC in $DIRECTORY/*.jpg # If you want more extensions in here replace jpg with {ext1,ext2,...}
do
    (( x++ )) && echo "$TRANSITION" | sed "/to/s@><@>$PIC<@"
    echo "$STATIC" | sed -r "/file|from/s@><@>$PIC<@"
done

echo -e "$TRANSITION\n$END"

if grep -q '*.' $FILENAME
then
    echo -e "No files with appropriate extension(s) were found in:\n\n$DIRECTORY\n" >&2
    rm $FILENAME
fi

exit 0
This code will place the file, with name of your choosing, into the directory where the
pictures are that you wish to transition over.

To run code simply issue:
Code:
./name_of_script <folder_to_look_in> <file_name>
Enjoy

If any issues please let me know
 
Old 12-19-2010, 08:04 PM   #2
Zetec
Member
 
Registered: Jul 2006
Distribution: Debian, Ubuntu, W7, openSUSE, Centos
Posts: 152

Rep: Reputation: 25
Nice find.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Konqueror backgrounds question Neruocomp Linux - Software 0 01-30-2005 01:33 AM
Source for backgrounds and a question about my mousewheel dhuberma Linux - Newbie 2 10-14-2003 12:49 PM
gnome cucles backgrounds? patientzero Linux - General 0 09-28-2003 02:10 AM
Nice Gnome Backgrounds Capt_Caveman General 1 08-08-2003 09:08 AM
Rotating Backgrounds in Gnome -=Sabin=- Linux - General 1 07-19-2003 08:30 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu

All times are GMT -5. The time now is 04:21 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration