Results 1 to 5 of 5

Thread: gnome-screensaver - make your own

  1. #1
    Join Date
    Aug 2009
    Beans
    17

    Post gnome-screensaver - make your own

    I have been working on making my own screensaver. Ubuntu uses gnome-screensaver, but there seems to be absolutely no information online about how to write a screensaver compatible with gnome-screensaver. Last year, I made a bunch of progress, figured it out, and I was going to post a tutorial. There still aren't any tutorials out there, so I thought I'd post how I made a screensaver. It's not a full tutorial, but it's better than nothing. Below you should find instructions to download, compile, and install a simple, commented screensaver that uses OpenGL to show a rectangle that changes color.

    For a program to be run by gnome-screensaver, it must use a gs-theme-window. To use this window, you will need the files:gs-theme-window.c gs-theme-window.h (also in attached tar)

    You'll also need the gtk libraries installed, libgtk2.0-dev libgtkglext1-dev. The second one is an OpenGL extension for Gtk.
    Code:
    sudo apt-get install libgtk2.0-dev libgtkglext1-dev
    Download the sample files, and extract them, and try to compile.
    Code:
    tar -zxf sample_screensave.tar.gz
    cd screensaver
    make
    It should compile with one warning, though I have not throughly tested. Let me know if it doesn't work for you, and I'll try to help.

    Try running it, just to be sure it works
    Code:
    ./your_screensaver
    The code is fairly straightforward and well commented, so you should easily be able to hack it to do what you want. Now to get gnome-screensaver to use it.

    You must put the screensaver into the location gnome-screensaver can run it from. Find the directory with:
    Code:
    pkg-config --variable=privlibexecdir gnome-screensaver
    Copy the program into that directory. Then edit the your_screensaver.desktop file and ensure that it is referring to the location you just put the screensaver in. Then copy the desktop file into the location given by
    Code:
    pkg-config --variable=themesdir gnome-screensaver
    Theoretically, you should now be able to choose your screensaver:
    Code:
    gnome-screensaver-preferences
    However, it doesn't show up for me. That's where you are supposed to put the file from what I can tell, but it doesn't show up as an option until I put the .desktop file in:
    Code:
    ~/.local/share/applications/screensavers/
    I have no idea why, but if you put the desktop file there, you should be able to use your new screensaver. Happy Hacking, and I'll try to answer any question you post. Also, if anyone *does* know of a tutorial, please say so!
    Attached Files Attached Files

  2. #2
    Join Date
    May 2011
    Beans
    2

    Re: gnome-screensaver - make your own

    =D>

    Thank YOU!

    i searched in web 6 or 7 hours and find nothing ...

    Now i have build my first Screensaver,

    ugly but running

  3. #3
    Join Date
    Aug 2009
    Beans
    17

    Re: gnome-screensaver - make your own

    Glad to hear it!

    Also, for anyone else coming across this, please go to the other thread at http://ubuntuforums.org/showthread.php?t=1583335 I apologise greatly for double posting, but I thought my first post hadn't gone through.

  4. #4
    Join Date
    May 2011
    Beans
    2

    Re: gnome-screensaver - make your own

    Quote Originally Posted by ankillito View Post
    Glad to hear it!

    Also, for anyone else coming across this, please go to the other thread at http://ubuntuforums.org/showthread.php?t=1583335 I apologise greatly for double posting, but I thought my first post hadn't gone through.

    LOL

    I found this tread before I landed here, and I think this tread here is eseay to understand and more clear and simple ^^

    the only thing missing now is a useful opengl tutorial linked, but i'm working on it:

  5. #5
    Join Date
    Aug 2009
    Beans
    17

    Re: gnome-screensaver - make your own

    I think I started learning OpenGL with NeHe's tutorials. Not mindbogglingly great, but I found them very useful.

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
  •