Results 1 to 10 of 24

Thread: HOWTO: Animated .gif as a background

Hybrid View

  1. #1
    Join Date
    Sep 2006
    Beans
    4

    HOWTO: Animated .gif as a background

    So you went to put that funny animated gif as your desktop background but only the first frame appeared, static and alone? Cheer up, we can make it move.
    This is a guide to getting an animated gif centered on your desktop background. I've only tested it in gnome on Hardy Heron. It works with or without compiz. The only caveat is that if you happen to have icons on your desktop the gif may cover these up if it's big enough.

    Alright let's open a terminal window and get down to business.
    We're going to grab Shantz modified (i.e. fixed) version of xwinwrap.
    Ok we need the source from launchpad, but first we need to install bazaar to get the code, gcc to compile it, and gifsicle to actually display the gifs:
    Code:
    sudo apt-get install bzr build-essential gifsicle
    Now let's grab the code:
    Code:
    bzr branch lp:xwinwrap
    Let's change into that newly created directory and compile it and then install it.
    Code:
    cd xwinwrap
    make
    sudo make install
    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:
    Code:
    #!/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
    Save this file as gifbg.sh and let's not forget to make it executable:
    Code:
    chmod +x gifbg.sh
    Now when we can make our background move:
    Code:
    ./gifbg.sh /path/to/animated.gif
    You'll probably want to start this script when you login so hit the gnome menu -> system -> preferences -> sessions hit Add and make up a name and copy the command into the appropriate box. Notes: You have to put the complete path to the script in here because gnome doesn't respect the $PATH variable. Also, for some reason the image will appear always on top when it's loaded from boot, one solution is to add a "sleep 5" on top of the script to make sure it loads after the rest of your desktop.

    There you go, an animated background using a few megs of ram and an imperceptible amount of cpu time.

    To stop the magic happening either Ctrl-C the command if you ran it from the terminal or hit Alt-F2 and type:
    Code:
    killall xwinwrap
    To uninstall:
    Code:
    sudo rm /usr/bin/xwinwrap
    Last edited by memorygap; September 24th, 2008 at 10:42 PM. Reason: Fixed instructions for auto loading on login

  2. #2
    Join Date
    Jan 2008
    Location
    Brisbane
    Beans
    174
    Distro
    Ubuntu 9.10 Karmic Koala

    Re: HOWTO: Animated .gif as a background

    Does anyone have any good gifs to share? preferable some that would work as a background?

  3. #3
    Join Date
    Sep 2006
    Beans
    3,165
    Distro
    Ubuntu Karmic Koala (testing)

    Re: HOWTO: Animated .gif as a background

    awesome guide, it will be cool if someone can share good gifs .

  4. #4
    Join Date
    Sep 2006
    Beans
    4

    Re: HOWTO: Animated .gif as a background

    the gif that made me figure this out is on this page http://squareamerica.com/gif4.htm

  5. #5
    Join Date
    Aug 2007
    Location
    Naylor, Georgia, USA
    Beans
    33
    Distro
    Ubuntu 8.04 Hardy Heron

    Lightbulb Re: HOWTO: Animated background

    This is a little different than the animated gif but I think it is interesting.

    http://gnome-look.org/content/show.p...?content=83443

    Basically you make an xml file as the background that refers to the pictures of choice. It changes over time. The artist set it up to look like the sun moving in the sky.

    I have one in the works and will upload it to gnome-look when its done. So keep a look out.

  6. #6
    Join Date
    Nov 2007
    Beans
    450

    Re: HOWTO: Animated background

    I wasn't able to get this to work in Ibex. Just getting the branch downloaded from launchpad was pretty complicated (had to create a gpg and ssh key). After downloading the folder I wasn't able to make it.

    winwrap|$make
    gcc -Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -lX11 -lXext -lXrender xwinwrap.c -o xwinwrap
    mkdir x86_64
    mv ./xwinwrap ./x86_64
    gcc -m32 -Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -lX11 -lXext -lXrender xwinwrap.c -o xwinwrap
    mkdir i386
    mv ./xwinwrap ./i386
    winwrap|$sudo make install
    make: *** No rule to make target `install'. Stop.
    It's really too bad, I was about to use the hypnotoad gif.

    http://www.stumbleupon.com/toolbar/#...ewsIndex%253D1

  7. #7
    Join Date
    Sep 2012
    Beans
    3

    Re: HOWTO: Animated .gif as a background

    Im really interested in this howto but im getting some strange errors that I dont know how to fix. This is right after running brz branch lpwinwrap. Im guessing im missing a package somewhere?

    Code:
    ~/xwinwrap$ make
    gcc -Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -lX11 -lXext -lXrender xwinwrap.c -o xwinwrap
    /tmp/ccG67lai.o: In function `setWindowOpacity':
    xwinwrap.c:(.text+0xdf): undefined reference to `XInternAtom'
    xwinwrap.c:(.text+0x113): undefined reference to `XChangeProperty'
    /tmp/ccG67lai.o: In function `findArgbVisual':
    xwinwrap.c:(.text+0x151): undefined reference to `XGetVisualInfo'
    xwinwrap.c:(.text+0x19c): undefined reference to `XRenderFindVisualFormat'
    xwinwrap.c:(.text+0x1ed): undefined reference to `XFree'
    /tmp/ccG67lai.o: In function `find_desktop_window':
    xwinwrap.c:(.text+0x337): undefined reference to `XQueryTree'
    xwinwrap.c:(.text+0x379): undefined reference to `XFetchName'
    xwinwrap.c:(.text+0x3b2): undefined reference to `XGetWindowAttributes'
    xwinwrap.c:(.text+0x444): undefined reference to `XFree'
    xwinwrap.c:(.text+0x453): undefined reference to `XFree'
    xwinwrap.c:(.text+0x488): undefined reference to `XFree'
    /tmp/ccG67lai.o: In function `main':
    xwinwrap.c:(.text+0x5a7): undefined reference to `XOpenDisplay'
    xwinwrap.c:(.text+0x6cc): undefined reference to `XParseGeometry'
    xwinwrap.c:(.text+0x7f6): undefined reference to `XInternAtom'
    xwinwrap.c:(.text+0x864): undefined reference to `XInternAtom'
    xwinwrap.c:(.text+0x8c8): undefined reference to `XInternAtom'
    xwinwrap.c:(.text+0x92c): undefined reference to `XInternAtom'
    xwinwrap.c:(.text+0x990): undefined reference to `XInternAtom'
    /tmp/ccG67lai.o:xwinwrap.c:(.text+0x9f4): more undefined references to `XInternAtom' follow
    /tmp/ccG67lai.o: In function `main':
    xwinwrap.c:(.text+0xe84): undefined reference to `XCreateColormap'
    xwinwrap.c:(.text+0xef9): undefined reference to `XCreateWindow'
    xwinwrap.c:(.text+0xfaf): undefined reference to `XCreateWindow'
    xwinwrap.c:(.text+0x1021): undefined reference to `XCreateWindow'
    xwinwrap.c:(.text+0x107b): undefined reference to `XSetWMProperties'
    xwinwrap.c:(.text+0x10b1): undefined reference to `XCreateRegion'
    xwinwrap.c:(.text+0x10f9): undefined reference to `XShapeCombineRegion'
    xwinwrap.c:(.text+0x1108): undefined reference to `XDestroyRegion'
    xwinwrap.c:(.text+0x112a): undefined reference to `XInternAtom'
    xwinwrap.c:(.text+0x1169): undefined reference to `XChangeProperty'
    xwinwrap.c:(.text+0x119e): undefined reference to `XCreatePixmap'
    xwinwrap.c:(.text+0x11ca): undefined reference to `XCreateGC'
    xwinwrap.c:(.text+0x1208): undefined reference to `XSetForeground'
    xwinwrap.c:(.text+0x1242): undefined reference to `XFillRectangle'
    xwinwrap.c:(.text+0x1260): undefined reference to `XSetForeground'
    xwinwrap.c:(.text+0x12aa): undefined reference to `XFillArc'
    xwinwrap.c:(.text+0x1315): undefined reference to `XSetForeground'
    xwinwrap.c:(.text+0x134f): undefined reference to `XFillRectangle'
    xwinwrap.c:(.text+0x136d): undefined reference to `XSetForeground'
    xwinwrap.c:(.text+0x13a4): undefined reference to `XFillPolygon'
    xwinwrap.c:(.text+0x13de): undefined reference to `XShapeCombineMask'
    xwinwrap.c:(.text+0x13f7): undefined reference to `XMapWindow'
    xwinwrap.c:(.text+0x141c): undefined reference to `XLowerWindow'
    xwinwrap.c:(.text+0x1436): undefined reference to `XSync'
    xwinwrap.c:(.text+0x1575): undefined reference to `XDestroyWindow'
    xwinwrap.c:(.text+0x1584): undefined reference to `XCloseDisplay'
    collect2: error: ld returned 1 exit status
    make: *** [all64] Error 1
    Last edited by zach832; July 5th, 2013 at 06:36 PM.

  8. #8
    Join Date
    Nov 2010
    Location
    Istanbul.
    Beans
    6
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: HOWTO: Animated .gif as a background

    It's a new info for me. I'll try it soon. Thanks, this is awesome how to tutorial.

  9. #9
    Join Date
    Mar 2014
    Beans
    10

    Re: HOWTO: Animated .gif as a background

    with Ibex didn`t worked for me also, any other solution?

  10. #10
    Join Date
    May 2014
    Location
    Some where in the EU
    Beans
    95
    Distro
    Kubuntu 14.04 Trusty Tahr

    Re: HOWTO: Animated .gif as a background

    Hi I am on step 3 and i get this error any help thank u


    ubuntu@ubuntu:~/xwinwrap$ cd xwinwrap
    bash: cd: xwinwrap: No such file or directory
    ubuntu@ubuntu:~/xwinwrap$ cd xwinwrap
    bash: cd: xwinwrap: No such file or directory
    ubuntu@ubuntu:~/xwinwrap$ make
    gcc -Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -lX11 -lXext -lXrender xwinwrap.c -o xwinwrap
    xwinwrap.c:45:22: fatal error: X11/Xlib.h: No such file or directory
    #include <X11/Xlib.h>
    ^
    compilation terminated.
    make: *** [all64] Error 1
    ubuntu@ubuntu:~/xwinwrap$ sudo make install
    make: *** No rule to make target `install'. Stop.
    ubuntu@ubuntu:~/xwinwrap$

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •