Results 1 to 5 of 5

Thread: HOWTO: Use you webcam feed as a wallpaper using Xwinwrap.

  1. #1
    Join Date
    Apr 2008
    Beans
    332

    HOWTO: Use you webcam feed as a wallpaper using Xwinwrap.

    This tutorial will show you how you can use your webcam feed as your wallpaper (For people who constantly need to look at themselves).
    This will NOT make you lose the functionality of icons, conkys, screenlets, or docks.

    From this_To This!

    1. Check Requirements:
    This will only work with Compiz-Fusion enabled as your Window Manager. Click Here for installation instructions.
    NOTE: This won't require any special settings in CompizConfig Settings Manager.

    This will also require Mplayer being installed. Click Here for installation instructions.


    This also requires an already working webcam.
    2. Download Xwinwrap.

    Installation Option 1
    Open Accessories>Terminal
    Enter the following codes:
    Code:
    sudo apt-get install build-essential libx11-dev x11proto-xext-dev libxrender-dev libxext-dev cvs
    Code:
    cvs -d :pserver:anoncvs@cvs.freedesktop.org:/cvs/xapps co xwinwrap
    Code:
    cd xwinwrap
    Code:
    make
    Code:
    sudo cp xwinwrap /usr/bin

    Installation Option 2
    Go to this URL. http://www.getdeb.net/app/xwinwrap

    Select the option that fits your system.

    Click Download Xwinwrap

    A download popup should appear.

    Select the option Open with GDebi Package Installer (default)

    Click OK
    The rest of the installation is automated.[/quote]

    You have now successfully installed Xwinwrap.

    3. Test it out.

    In Terminal
    Code:
    cd
    Code:
    xwinwrap -ni -o 0.20 -fs -s -sp -st -b -nf -- mplayer -wid  WID -quiet -fps 15 tv://
    If you want a Mirror effect add this to the end of the line above
    Code:
     -vf mirror
    NOTICE: When you close the terminal window it will stop Xwinwrap.



    4. Create an easy way to start/stop this effect
    .

    In Teminal
    Code:
    gedit toggle
    Paste this in your text editor
    Code:
    #!/bin/sh
    
    # click to start, click to stop
    if pidof xwinwrap ; then
     killall xwinwrap
     else
     exec xwinwrap -ni -o 0.20 -fs -s -sp -st -b -nf -- mplayer -wid  WID -quiet -fps 15 tv:// 
    fi
    NOTE: If you want the Mirror effect, after "tv://" , on the same line add:
    Code:
     -vf mirror
    Save and close.

    You now need to make the script executable.

    In Terminal
    Code:
    sudo chmod a+x toggle
    5. Create A Launcher:

    Right Click on either the desktop or on your panel.
    For Desktop select (create Launcher)
    For Panel select (click Add To Panel)+(Custom Application Launcher)

    For Name input anything.
    For Command input
    Code:
    ./toggle
    You can leave the comment section blank.
    Click Ok.

    You're done!
    -----------------------------------------------------

    Dissecting the Xwinwrap code.
    Code:
    xwinwrap -ni -o 0.20 -fs -s -sp -st -b -nf -- mplayer -wid  WID -quiet -fps 15 tv://
    -ni means No Input
    -o 0.20 is the Opacity setting from 0 to 1
    -fs means FullScreen
    -s means Sticky(its on all workspaces)
    -sp means Skip Pager (window won't appear in pager)
    -st means Skip Taskbar (window won't appear in taskbar)
    -b means Below
    -nf means No Focus
    -wid creates a window id
    --mplayer means mplayer
    -fps 15 means 15 Frames Per Second
    tv:// tells mplayer to use the default video input device.
    -vf mirror means video filter Mirror.

    Feel free to change any of these if you want it to act differently.
    More filters and effects can be found by opening Terminal and typing
    Code:
    man mplayer

    -----------------------------------------------------

    Problems you may run into.

    If you have a tv tuner hooked up to your computer. The tv:// command may not work, and instead of getting a webcam feed you could potentially get tv channels as your wallpaper. But that might be cooler than a webcam feed.

    Other programs can't use the webcam simultaneously. I suggest turning Off the program before you use other programs.

    Suspend-To-Ram won't work while your webcam is on. I suggest turning Off the program when you don't want it in use. You could also add the line killall xwinwrap to /etc/acpi/sleep.sh Which would kill the process before suspending to ram. You can also add the line killall xwinwrap to /etc/acip/hibernate.sh if you have problems suspending to the hard drive.

    This apparently only works using the X11 driver in Mplayer. Other drivers tend to not be capable for handling due to the lack of indirect rendering on some Intel cards.

    Got to give credit to The Warlock, gaminggeek, Valdi, and cammin for pointing out problems


    -----------------------------------------------------

    (For more info on Xwinwrap click Here or Here)

    Credit for the original idea Here and Here
    Last edited by easybake; August 9th, 2008 at 09:55 PM.

  2. #2
    Join Date
    Apr 2008
    Beans
    332

    Re: HOWTO: Use you webcam feed as a wallpaper using Xwinwrap.

    Let me know if you run into any problems or if you have any ideas on what to add.

  3. #3
    Join Date
    Sep 2007
    Beans
    138

    Re: HOWTO: Use you webcam feed as a wallpaper using Xwinwrap.

    If you add a line like
    killall xwinwrap
    to
    /etc/acpi/sleep.sh
    You won't have to remember to kill it before suspending to ram.

    You may have to add it to
    /etc/acip/hibernate.sh
    if you have problems suspending to the hard drive.


    [Here's a typical disclaimer about how you should be backing up files before you change them, and that you're doing what I mentioned at your own risk.]

  4. #4
    Join Date
    May 2007
    Beans
    4,513
    Distro
    Ubuntu

    Re: HOWTO: Use you webcam feed as a wallpaper using Xwinwrap.

    A tip, you can ease the xwrinwrap installation by recommending .debs: http://www.getdeb.net/search.php?keywords=xwinwrap

    (and if you'd like to make it super nice, maybe a gnome-panel gadget to toggle this )
    Last edited by Vadi; August 9th, 2008 at 06:41 PM.

  5. #5
    Join Date
    Apr 2008
    Beans
    332

    Re: HOWTO: Use you webcam feed as a wallpaper using Xwinwrap.

    Quote Originally Posted by Vadi View Post
    A tip, you can ease the xwrinwrap installation by recommending .debs: http://www.getdeb.net/search.php?keywords=xwinwrap

    (and if you'd like to make it super nice, maybe a gnome-panel gadget to toggle this )
    You can use the launcher part I had in the installation no matter which way you install it.

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
  •