Page 1 of 3 123 LastLast
Results 1 to 10 of 24

Thread: HOWTO: Animated .gif as a background

  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
    Aug 2007
    Location
    hyderabad
    Beans
    138
    Distro
    Ubuntu 9.04 Jaunty Jackalope

    Re: HOWTO: Animated background

    This is what i get when i try to compile

    Code:
    gcc -Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -lX11 -lXext -lXrender xwinwrap.c -o xwinwrap
    xwinwrap.c:39:22: error: X11/Xlib.h: No such file or directory
    xwinwrap.c:40:23: error: X11/Xutil.h: No such file or directory
    xwinwrap.c:41:23: error: X11/Xatom.h: No such file or directory
    xwinwrap.c:42:24: error: X11/Xproto.h: No such file or directory
    xwinwrap.c:44:34: error: X11/extensions/shape.h: No such file or directory
    xwinwrap.c:45:36: error: X11/extensions/Xrender.h: No such file or directory
    xwinwrap.c:97: error: expected ‘)’ before ‘*’ token
    xwinwrap.c:110: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
    xwinwrap.c:177: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘find_desktop_window’
    xwinwrap.c: In function ‘main’:
    xwinwrap.c:219: error: ‘Display’ undeclared (first use in this function)
    xwinwrap.c:219: error: (Each undeclared identifier is reported only once
    xwinwrap.c:219: error: for each function it appears in.)
    xwinwrap.c:219: error: ‘dpy’ undeclared (first use in this function)
    xwinwrap.c:220: error: ‘Window’ undeclared (first use in this function)
    xwinwrap.c:220: error: expected ‘;’ before ‘win’
    xwinwrap.c:221: error: expected ‘;’ before ‘root’
    xwinwrap.c:222: error: expected ‘;’ before ‘p_desktop’
    xwinwrap.c:224: error: ‘XSizeHints’ undeclared (first use in this function)
    xwinwrap.c:224: error: expected ‘;’ before ‘xsh’
    xwinwrap.c:225: error: ‘XWMHints’ undeclared (first use in this function)
    xwinwrap.c:225: error: expected ‘;’ before ‘xwmh’
    xwinwrap.c:240: error: ‘Atom’ undeclared (first use in this function)
    xwinwrap.c:240: error: expected ‘;’ before ‘state’
    xwinwrap.c:244: error: ‘Pixmap’ undeclared (first use in this function)
    xwinwrap.c:244: error: expected ‘;’ before ‘mask’
    xwinwrap.c:245: error: ‘GC’ undeclared (first use in this function)
    xwinwrap.c:245: error: expected ‘;’ before ‘mask_gc’
    xwinwrap.c:246: error: ‘XGCValues’ undeclared (first use in this function)
    xwinwrap.c:246: error: expected ‘;’ before ‘xgcv’
    xwinwrap.c:248: warning: implicit declaration of function ‘XOpenDisplay’
    xwinwrap.c:255: warning: implicit declaration of function ‘DefaultScreen’
    xwinwrap.c:256: error: ‘root’ undeclared (first use in this function)
    xwinwrap.c:256: warning: implicit declaration of function ‘RootWindow’
    xwinwrap.c:263: warning: implicit declaration of function ‘XParseGeometry’
    xwinwrap.c:275: error: ‘state’ undeclared (first use in this function)
    xwinwrap.c:275: warning: implicit declaration of function ‘XInternAtom’
    xwinwrap.c:357: error: ‘xsh’ undeclared (first use in this function)
    xwinwrap.c:357: error: ‘PSize’ undeclared (first use in this function)
    xwinwrap.c:357: error: ‘PPosition’ undeclared (first use in this function)
    xwinwrap.c:358: warning: implicit declaration of function ‘DisplayWidth’
    xwinwrap.c:359: warning: implicit declaration of function ‘DisplayHeight’
    xwinwrap.c:368: error: ‘xwmh’ undeclared (first use in this function)
    xwinwrap.c:368: error: ‘InputHint’ undeclared (first use in this function)
    xwinwrap.c:373: error: ‘XSetWindowAttributes’ undeclared (first use in this function)
    xwinwrap.c:373: error: expected ‘;’ before ‘attr’
    xwinwrap.c:374: error: ‘Visual’ undeclared (first use in this function)
    xwinwrap.c:374: error: ‘visual’ undeclared (first use in this function)
    xwinwrap.c:376: warning: implicit declaration of function ‘findArgbVisual’
    xwinwrap.c:383: error: ‘attr’ undeclared (first use in this function)
    xwinwrap.c:385: warning: implicit declaration of function ‘XCreateColormap’
    xwinwrap.c:385: error: ‘AllocNone’ undeclared (first use in this function)
    xwinwrap.c:387: error: ‘win’ undeclared (first use in this function)
    xwinwrap.c:387: warning: implicit declaration of function ‘XCreateWindow’
    xwinwrap.c:388: error: ‘InputOutput’ undeclared (first use in this function)
    xwinwrap.c:389: error: ‘CWBackPixel’ undeclared (first use in this function)
    xwinwrap.c:389: error: ‘CWBorderPixel’ undeclared (first use in this function)
    xwinwrap.c:389: error: ‘CWColormap’ undeclared (first use in this function)
    xwinwrap.c:393: error: expected ‘;’ before ‘attr’
    xwinwrap.c:396: warning: implicit declaration of function ‘find_desktop_window’
    xwinwrap.c:396: error: ‘p_desktop’ undeclared (first use in this function)
    xwinwrap.c:399: error: ‘CopyFromParent’ undeclared (first use in this function)
    xwinwrap.c:400: error: ‘CWOverrideRedirect’ undeclared (first use in this function)
    xwinwrap.c:410: warning: implicit declaration of function ‘XSetWMProperties’
    xwinwrap.c:413: warning: implicit declaration of function ‘setWindowOpacity’
    xwinwrap.c:417: error: ‘Region’ undeclared (first use in this function)
    xwinwrap.c:417: error: expected ‘;’ before ‘region’
    xwinwrap.c:419: error: ‘region’ undeclared (first use in this function)
    xwinwrap.c:419: warning: implicit declaration of function ‘XCreateRegion’
    xwinwrap.c:422: warning: implicit declaration of function ‘XShapeCombineRegion’
    xwinwrap.c:422: error: ‘ShapeInput’ undeclared (first use in this function)
    xwinwrap.c:422: error: ‘ShapeSet’ undeclared (first use in this function)
    xwinwrap.c:423: warning: implicit declaration of function ‘XDestroyRegion’
    xwinwrap.c:428: warning: implicit declaration of function ‘XChangeProperty’
    xwinwrap.c:429: error: ‘XA_ATOM’ undeclared (first use in this function)
    xwinwrap.c:429: error: ‘PropModeReplace’ undeclared (first use in this function)
    xwinwrap.c:434: error: ‘mask’ undeclared (first use in this function)
    xwinwrap.c:434: warning: implicit declaration of function ‘XCreatePixmap’
    xwinwrap.c:435: error: ‘mask_gc’ undeclared (first use in this function)
    xwinwrap.c:435: warning: implicit declaration of function ‘XCreateGC’
    xwinwrap.c:435: error: ‘xgcv’ undeclared (first use in this function)
    xwinwrap.c:442: warning: implicit declaration of function ‘XSetForeground’
    xwinwrap.c:443: warning: implicit declaration of function ‘XFillRectangle’
    xwinwrap.c:446: warning: implicit declaration of function ‘XFillArc’
    xwinwrap.c:451: error: ‘XPoint’ undeclared (first use in this function)
    xwinwrap.c:451: error: expected ‘;’ before ‘points’
    xwinwrap.c:459: warning: implicit declaration of function ‘XFillPolygon’
    xwinwrap.c:459: error: ‘points’ undeclared (first use in this function)
    xwinwrap.c:459: error: ‘Complex’ undeclared (first use in this function)
    xwinwrap.c:459: error: ‘CoordModeOrigin’ undeclared (first use in this function)
    xwinwrap.c:469: warning: implicit declaration of function ‘XShapeCombineMask’
    xwinwrap.c:469: error: ‘ShapeBounding’ undeclared (first use in this function)
    xwinwrap.c:472: warning: implicit declaration of function ‘XMapWindow’
    xwinwrap.c:476: warning: implicit declaration of function ‘XLowerWindow’
    xwinwrap.c:479: warning: implicit declaration of function ‘XSync’
    xwinwrap.c:513: warning: implicit declaration of function ‘XDestroyWindow’
    xwinwrap.c:514: warning: implicit declaration of function ‘XCloseDisplay’
    make: *** [all64] Error 1
    You can Follow Me Here and My Blog Here

  8. #8
    Join Date
    Nov 2005
    Location
    Sendai, Japan
    Beans
    11,296
    Distro
    Kubuntu

    Re: HOWTO: Animated .gif as a background

    @kranny

    Code:
    sudo apt-get install xorg-dev
    「明後日の夕方には帰ってるからね。」


  9. #9
    Join Date
    Feb 2009
    Location
    Middle of Nowhere
    Beans
    14
    Distro
    Ubuntu 9.04 Jaunty Jackalope

    Re: HOWTO: Animated .gif as a background

    This is after getting the stuff from the post before me and running the rest of the first post I could:



    fail@dotroot:~/xwinwrap$ cd xwinwrap
    bash: cd: xwinwrap: No such file or directory
    fail@dotroot:~/xwinwrap$ 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
    In file included from /usr/include/features.h:354,
    from /usr/include/sys/types.h:27,
    from /usr/include/X11/Xlib.h:52,
    from xwinwrap.c:45:
    /usr/include/gnu/stubs.h:7:27: error: gnu/stubs-32.h: No such file or directory
    make: *** [all32] Error 1
    fail@dotroot:~/xwinwrap$ sudo make install
    [sudo] password for kyo:
    make: *** No rule to make target `install'. Stop.
    fail@dotroot:~/xwinwrap$
    Last edited by [.root/fail]; April 3rd, 2009 at 06:34 AM. Reason: a serious need for help now

  10. #10
    Join Date
    Nov 2007
    Beans
    124
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: HOWTO: Animated background

    Quote Originally Posted by whitethorn View Post
    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.



    It's really too bad, I was about to use the hypnotoad gif.

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

    This happened to me too. All that has happened is that the winwrap ececutable file hasn't been moved to /usr/bin, which isn't too much of a problem. You could move it or alter the script to direct to the file. Depending on your architecture the file to direct to is in i386 or x86_64 in the winwrap directory.

Page 1 of 3 123 LastLast

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
  •