We are now going set a animated gif or playing movie files as desktop background wallpapers.
So we now going to use Shantz modified (i.e. fixed) version of xwinwrap. before that we need to install some essential packages for that.
$sudo apt-get install bzr build-essential gifsicle
$wget http://tech.shantanugoel.com/resources/downloads/shantz-xwinwrap.zip
$unzip shantz-xwinwrap.zip
$cd shantz-xwinwrap/
It has deb packages for both i386 and x86_64 architecture, so for my machine is x86_64.
$cd x86_64/
$sudo dpkg -i shantz-xwinwrap_0.3-1_amd64.deb
I’ve created a little script to make centering a gif easy for myself so open up your favorite text editor and copy and paste the following:
$vi gifbg.sh
#!/bin/sh
# Uses xwinwrap to display given animated .gif in the center of the screen
if [ $# -ne 1 ]; then
echo 1>&2 Usage: $0 image.gif
exit 1
fi
#get screen resolution
SCRH=`xrandr | awk ‘/current/ { print $8 }’`
SCRW=`xrandr | awk ‘/current/ { print $10 }’`
SCRW=${SCRW%\,}
#get gif resolution
IMGHW=`gifsicle –info $1 | awk ‘/logical/ { print $3 }’`
IMGH=${IMGHW%x*}
IMGW=${IMGHW#*x}
#calculate position
POSH=$((($SCRH/2)-($IMGH/2)))
POSW=$((($SCRW/2)-($IMGW/2)))
xwinwrap -g ${IMGHW}+${POSH}+${POSW} -ov -ni -s -nf — gifview -w WID $1 -a
exit 0
:wq
Save this file as gifbg.sh and let’s not forget to make it executable
$chmod +x gifbg.sh
Now when we can make our background move.that’s it.
$sh /home/sathish/gifbg.sh /home/sathish/Pictures/Wallpapers/KSjIOHk.gif
you can use this command in the startup application to start everytime ,when the machine is up.
this method is for animated gif files ,but another method i having is straightway you can play movie files ( flv, mp4, vob, …) using mplayer…
for that we need to install some deb packages..
$sudo apt-get install xorg-dev build-essential libx11-dev x11proto-xext-dev libxrender-dev libxext-dev cvs mplayer
we already install xwinwrap from above command ,so need of that.

$nice -n 15 xwinwrap -s -st -sp -b -ni -fs -nf -ov -o 1.000000 — mplayer /home/sathish/1.mp4 -quiet -noconsolecontrols -loop 0 -wid WID
That’s it…..
you can also convert movie files into gif using mplayer
$mplayer movie.avi -vo gif89a:output=movie.gif
















i got lost at save the script as “gifbg.sh”, save where and how to make it executable
gifbg.sh saves into the directory xwinwrap.
To make executable:
#chmod +x gifbg.sh
This is what turns a pile of text into a pile of code. Learn chmod, and you just became qualified to run the IT department of an entire Junior-High.
Sorry for the delay in reply.
Same as gerry… no matter what I do cannot access or open the file even after making executable
I get an error :
arithmetic expression: expecting primary: “(1920/2)-(/2)”
It also seems that WP has mangled the ‘ character. I had to change lines 8 to 12 to read:
SCRH=`xrandr | awk ‘/current/ { print $8 }’`
SCRW=`xrandr | awk ‘/current/ { print $10 }’`
SCRW=${SCRW%\,}
#get gif resolution
IMGHW=`gifsicle –info $1 | awk ‘/logical/ { print $3 }’`
Hmm. Its done the same thing in my post – the character displaying as ‘ should be the one that normally appears on the keyboard below the double inverted comma symbol.
On closer look, it seems this line:
gifsicle -info /home/me/path/to/my.gif | awk ‘/logical/ { print $3 }’`
does not return any value …
Hi! I am using bash script and l also tried this thing but got following error:
awk: cmd. line:1: ‘/current/
awk: cmd. line:1: ^ invalid char ‘�’ in expression
awk: cmd. line:1: ‘/current/
awk: cmd. line:1: ^ invalid char ‘�’ in expression
gifsicle: –info: No such file or directory
awk: cmd. line:1: ‘/logical/
awk: cmd. line:1: ^ invalid char ‘�’ in expression
/home/aman/shantz-xwinwrap/x86_64/gifbg.sh: line 18: (/2)-(/2): syntax error: operand expected (error token is “/2)-(/2)”)
/home/aman/shantz-xwinwrap/x86_64/gifbg.sh: line 19: (/2)-(/2): syntax error: operand expected (error token is “/2)-(/2)”)
xwinwrap v0.3- Modified by Shantanu Goel. Visit http://tech.shantanugoel.com for updates, queries and feature requests
Usage: xwinwrap [-g {w}x{h}+{x}+{y}] [-ni] [-argb] [-fs] [-s] [-st] [-sp] [-a] [-b] [-nf] [-o OPACITY] [-sh SHAPE] [-ov]– COMMAND ARG1…
Options:
-g – Specify Geometry (w=width, h=height, x=x-coord, y=y-coord. ex: -g 640×480+100+100)
-ni – Ignore Input
-d – Desktop Window Hack. Provide name of the “Desktop” window as parameter -argb – RGB
-fs – Full Screen
-s – Sticky
-st – Skip Taskbar
-sp – Skip Pager
-a – Above
-b – Below
-nf – No Focus
-o – Opacity value between 0 to 1 (ex: -o 0.20)
-sh – Shape of window (choose between rectangle, circle or triangle. Default is rectangle)
-ov – Set override_redirect flag (For seamless desktop background integration in non-fullscreenmode)
-debug – Enable debug messages
Can you help with this?
thanks