Main index > About new desklets > Mplayer in Desklet

By dwmcqueen (User), on Sat Feb 18 21:43:41 2006: Mplayer in Desklet.

I want a desklet that embeds an mplayer window. Specifically, I would see it configurable so you could pull live video feeds and have them embedded on your desktop.

By syfou (Core Developer & Desklet Author), on Sun Feb 19 01:27:43 2006.

This is an interesting idea, dwmcqueen.. To me, it sure looks like a job for doityourself (see the desklets page) and a little scripting, not for a whole, separate desklet.

The only special point concerns how to "embed" mplayer windows inside the desktop: have a look at the -rootwin option from mplayer -- you might have to play around with the video output as well (I did)... See:

Code:

$ mplayer -vo help

Otherwise, if you use a window manager with a fake root window, you also have a -wid mplayer switch that you can use in conjunction with the ADESKLETS_ROOT environment variable to specify the desktop window. Finally, you could also achieve the same effect with a little help from your window manager (look around in the doc for decoration-less windows), or ultimately from third party applications such as Devil's pie. Have fun!

By dwmcqueen (User), on Fri Feb 24 15:02:38 2006: Thanks!.

I'll take a look at what you recommended - where you able to get a basic embedded version to work?

By syfou (Core Developer & Desklet Author), on Fri Feb 24 16:45:42 2006.

This worked for me -- mplayer embeds in the root window fine:

Code:


#!/bin/sh
# "Embedded" mplayer launcher for doityourself.
#
function rootid() {
   if test "x${ADESKLETS_ROOT}" = x ; then
      xwininfo -root | sed -n '/Window id/{s/.* \(0x[0-9a-z]*\).*/\1/p}'
   else
      echo ${ADESKLETS_ROOT}
    fi
}

# Set movie and parameters to suit your system.
#
# PARAMS="-vo x11 -wid `rootid`"  # <= Works for me!
#
MOVIE=/path/to/test.movie
PARAMS=                           # <= In 'normal' mode (no embedding)

case $1 in
    init)
        cat <<-EOF
                <window.never_shrink False/>
                <background.color 'FFFFFF'/>
                <color '000000'/>
                <test_delay 3600/>
        EOF
        exit 0
        ;;
    click)
        mplayer ${PARAMS} ${MOVIE} > /dev/null 2>&1 &
        ;;
esac

echo 'Click here'



Granted, you will probably need to adapt the mplayer command to your system -- see your mplayer documentation and my suggestions above. If you take the time to write a real interface, please share it with us: it would certainly interest others!

By ZeroDivide (Desklet Author), on Sun Feb 26 17:34:56 2006.

This looks like a really interesting idea. Is anyone able to get the -geometry flag working with -wid?

By syfou (Core Developer & Desklet Author), on Sun Feb 26 19:21:41 2006.

I didn't, but I haven't tried very hard... Basically, I think that setting a decoration-less windows makes more sense anyway: all the resizing options will work as expected, and you can achieve the same embedding effects, if not better, via most window managers or third-party EWMH-enabled property manglers.

By dwmcqueen (User), on Tue Apr 10 21:59:32 2007: RentACoder Request.

If anyone is interested in getting paid to code this - check here:

http://www.rentacoder.com/RentACoder/misc/BidRequests/ShowBidRequest.asp?lngBidRequestId=662396


adesklets is proud to be hosted on:

SourceForge.net Logo

Back to adesklets.sf.net.