Ubuntu-1310

 
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

 

Screenshot from 2014-01-04 17:14:15

 

 
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.

Screenshot from 2014-01-04 17:15:32
$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

 

Screenshot from 2014-01-04 17:16:15

 

That’s it…..

Screenshot from 2014-01-04 17:17:42

 

you can also convert movie files into gif using mplayer

$mplayer movie.avi -vo gif89a:output=movie.gif