Page 1 of 2 12 LastLast
Results 1 to 10 of 19

Thread: xgl desktop screensaver script

  1. #1
    Join Date
    Jun 2006
    Beans
    4

    xgl desktop screensaver script

    Hi all. Here's a little script that will run a specified screensaver as a script on your desktop. If you call it again with the name of a different screensaver, the first one will be killed and the second one started. If you call it again with the name of the same screensaver, the original one will be called.

    eg
    Code:
    dss atlantis  #runs atlantis on desktop
    dss juggler3d #kills atlantis, runs juggler on desktop
    dss juggler3d #kill juggler
    dss plamsa 0.3 #run plasma on desktop at 0.3 opacity

    You can assign the script to hotkeys, panel items, etc etc.

    Note I think this only works with xgl- I haven't got it going under standard gnome etc.

    First up, you'll need xwinwrap:

    Code:
    sudo apt-get install xwinwrap
    Then paste the following into a file and make it executable. I call mine dss for Desktop Screen Saver, and I keep it in /usr/bin

    Code:
    #!/bin/bash
    
    # Desktop screen saver flip flopper
    # This script runs a screensaver on your desktop,
    # and drops the name of the screensaver in a marker file.
    # When run a second time, it will kill the screensaver,
    # and optionaly start another, if the name of a different screensaver
    # is passed as an arg.
    # Requires xwinwrap to be installed.
    
    
    # dir to write marker file to
    DIR=~/
    
    #Niceness to run screen saver at. The lower this value, the higher
    #priority the screensaver will be. The higher the value, the jerkier
    #the screensaver will be, and the less it will intefere with your
    #work
    NICENESS=13
    
    #directory where your screensavers live
    SSDIR=/usr/lib/xscreensaver/
     
    if [ -z "$1" ]
    then
      echo "Usage: dss <screensaver> <opacity>"
      echo " where <screensaver exists in $SSDIR, and opacity (optional) is between 0.0 and 1.0"
      exit
    fi
    OPACITY=$2
    if [ -z $2 ]
    then
      OPACITY=1.0
    fi
    
      
    SCREENSAVER=$1
    
    if [ -e $DIR.flipflopmarker ]
    then
    	#get the name of the currently running desktop screensaver
    	#kill it, remove the marker file
    	OLDSCREENSAVER=`cat $DIR.flipflopmarker`
    	killall `cat $DIR.flipflopmarker` 
    	rm $DIR.flipflopmarker
    fi
    if [ "$SCREENSAVER" != "$OLDSCREENSAVER" ]
    then
    	#start the screensaver, write the name of it to a file
    	nice -n $NICENESS xwinwrap -ni  -o $OPACITY -argb -fs -s -st -sp -b -nf -- $SSDIR$1 -root -window-id WID &
    	echo $SCREENSAVER  > $DIR.flipflopmarker
    fi
    exit
    Last edited by enkidu75; June 27th, 2006 at 09:53 AM.

  2. #2
    Join Date
    Jun 2006
    Location
    Michigan, US
    Beans
    119
    Distro
    Ubuntu 6.06

    Re: xgl desktop screensaver script

    Hey, thanks, I've been looking for something like this since I found xwinwrap.

    I make it run on login... go to System->Preferences->Sessions, open the Startup Programs tab and hit Add, type in "dss <screensaver>"

    Atlantis and GLMatrix are my favorites so far.

    I know that xwinwrap has an opacity option (-o) to set these slightly translucent. Is there a way to set that up with this script? Plasma would make an awesome background, but since it is a solid color, it covers your desktop icons.

  3. #3
    Join Date
    Sep 2005
    Location
    Pittsburgh, PA
    Beans
    45
    Distro
    Kubuntu 7.10 Gutsy Gibbon

    Re: xgl desktop screensaver script

    This is a general xwinwrap question that I figured I would ask here. I run XGL on a TwinView display, and when I use xwinwrap, it focuses to my off-hand monitor (monitor 1). Is there a command argument that will force it to focus on my primary monitor? Or, better yet, span both?

    Thanks,

    Kratos

  4. #4
    Join Date
    Jun 2006
    Beans
    4

    Re: xgl desktop screensaver script

    Quote Originally Posted by Indras
    I know that xwinwrap has an opacity option (-o) to set these slightly translucent. Is there a way to set that up with this script? Plasma would make an awesome background, but since it is a solid color, it covers your desktop icons.
    I've updated the post to add opacity. Neat- I didn't know you could do that My favorite with opacity is plasma, but pong is pretty cute too.

    Cheers

  5. #5
    Join Date
    Oct 2005
    Location
    Southeast Asia
    Beans
    Hidden!
    Distro
    Ubuntu 7.04 Feisty Fawn

    Re: xgl desktop screensaver script

    Nice one! I went crazy trying to kill the dss . Now i'm looking for a screensaver that doesn't take 50% cpu time and looks great. Anyone?

    Thanks

  6. #6
    Join Date
    Jul 2005
    Location
    France
    Beans
    133

    Re: xgl desktop screensaver script

    Try electricsheep! It's not using a lot of CPU, and it looks nice. My only complain is that I can't slow down the animation enough... I can change the framerate, but then it's not smooth anymore. Would be better to keep the framerate, but slow down the animation.

    his is a general xwinwrap question that I figured I would ask here. I run XGL on a TwinView display, and when I use xwinwrap, it focuses to my off-hand monitor (monitor 1). Is there a command argument that will force it to focus on my primary monitor? Or, better yet, span both?
    +1 on this one!
    Last edited by risbac; June 29th, 2006 at 04:09 PM.

  7. #7
    Join Date
    Jun 2006
    Location
    Michigan, US
    Beans
    119
    Distro
    Ubuntu 6.06

    Re: xgl desktop screensaver script

    Quote Originally Posted by enkidu75
    I've updated the post to add opacity. Neat- I didn't know you could do that My favorite with opacity is plasma, but pong is pretty cute too.

    Cheers
    Sweet, that's exactly what I was looking for. TYVM!

  8. #8
    Join Date
    Apr 2006
    Beans
    7

    Re: xgl desktop screensaver script

    How do you get it to work with electricsheep? I have installed it from the repositories, but every time I try to direct dss to /usr/bin/electricsheep it doesn't work. I've edited the script to point to that directory but it still doesn't work. What am I doing wrong?

  9. #9
    Join Date
    Jun 2006
    Beans
    16

    Re: xgl desktop screensaver script

    Thanks a lot! This runs just great.
    Everyday I am amazed at what Ubuntu can do It seems like the sky is the limit.

    The only downside of this is that it's very cpu intensive. But that has nothing to do with this great guide.

  10. #10
    Join Date
    Feb 2005
    Location
    Geneva, Switzerland
    Beans
    976
    Distro
    Ubuntu 13.04 Raring Ringtail

    Re: xgl desktop screensaver script

    Thanks for the tip ! That's a great way of impressing your non-UNIX friends !!

Page 1 of 2 12 LastLast

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
  •