Ubuntu – How to make and distribute an Ubuntu screensaver

programmingscreensaver

I have no programming language preferences and I have a good knowledge of OpenGL coding. If I could use something like OpenFrameworks or Processing as a base, that would be ideal.

Best Answer

  • A screensaver in Linux is a pretty simple thing made up of two key parts:

    1. A graphical application that renders the images.
    2. A .desktop file pointing to that application.

    I'm not sure what end-result you're trying to achieve so I'll start in reverse. The .desktop files for existing screensavers live in /usr/share/applications/screensavers/. Here's ubuntu_theme.desktop for an example of what you're aiming for:

    [Desktop Entry]
    Name=Floating Ubuntu
    Comment=Ubuntu logo floating around the screen
    Exec=floaters /usr/share/pixmaps/ubuntu-screensaver.svg
    TryExec=floaters
    StartupNotify=false
    Terminal=false
    Type=Application
    Categories=GNOME;Screensaver
    OnlyShowIn=GNOME
    

    If you want to float a different image around, you could just clone the launcher, and replace /usr/share/pixmaps/ubuntu-screensaver.svg with your own image (use SVGs where possible as they scale a lot better).

    If you want to write your own binary for a completely custom screensaver, you should probably start here: http://www.dis.uniroma1.it/~liberato/screensaver/

    It uses very simple X graphics to do some pretty simple things. You can pimp it out with OpenGL but it's important you get the basics laid out first.

    Once you're done, packaging is its whole set of problems but for a very simple package, you can quickly bang a package out following something like this: https://help.ubuntu.com/community/PythonRecipes/DebianPackage

    But if you're serious about distributing this to lots of people you probably want to start with a PPA (a private repository). You can read about PPAs, building source packages, the build process, etc on LaunchPad's help system.

  • Related Question