Displaying video in XScreenSaver

Monday, 05 Oct 2015

I wondered if it was possible to display any arbitrary video as a screensaver using XScreenSaver. It turns out it is.

The only thing to do is to edit the ~/.xscreensaver config file and add an entry after the programs: tag. That entry should contain the command that would be invoked when the screensaver is launched.

This is an example using VLC as a player:

"NasaTV"    cvlc --quiet --no-audio \
              --video-on-top --fullscreen \
              --drawable-xid=$XSCREENSAVER_WINDOW \
               --sub-track=0 \
              "https://nasatv-lh.akamaihd.net/i/NASA_101@319270/master.m3u8" \n\

That plays a NASA TV stream with no sound and with the first subtitle track. The key parameter for VLC is the window id, so that it outputs to the actual screensaver window.