So I've hacked together the following workaround by creating wrappers for the xscreensaver commands:
- Create a file called
/usr/local/bin/xscreensaver-command
that contains the following:
#!/bin/bash while [ "$1" != "" ] do arg=$1 shift case "$arg" in -prefs) gnome-screensaver-preferences ;; -demo) if [[ "$1" =~ ^[0-9]+$ ]]; then num=$1 shift else echo $1 fi gnome-screensaver-preferences ;; -cycle) gnome-screensaver-command --cycle ;; -next) gnome-screensaver-command --cycle ;; -prev) gnome-screensaver-command --cycle ;; -lock) gnome-screensaver-command --lock ;; -activate) gnome-screensaver-command --activate ;; -deactivate) gnome-screensaver-command --deactivate ;; -time) gnome-screensaver-command --time ;; -exit) gnome-screensaver-command --exit ;; *) echo Unrecognized command: $arg ;; esac done
- Create a file called
/usr/local/bin/xscreensaver-demo
that contains the following:
#!/bin/bash gnome-screensaver-preferences
- Create a file called
/usr/local/share/applications/xscreensaver-properties.desktop
that contains the following:
[Desktop Entry] Exec=xscreensaver-demo Icon=Screensaver Terminal=false StartupNotify=true Name=Screensaver Comment=Change screensaver properties Type=Application Categories=Settings;DesktopSettings;Security;X-XFCE;
Change theIcon
entry to the name of a screensaver icon in/usr/share/icons
or/usr/local/share/icons
. (I downloaded a GnomeScreensaver.svg
icon from here.)
I've been using this wrapper for over three years on Debian and Ubuntu distributions with no problems. (I should note, however, that Gnome Screensaver uses the Gnome Power Manager rather than Xfce Power Manager--- as I've been using the former, this has not been an issue for me.)
Thanks! I was just looking for this, just one note, I think that on Ubuntu 11.04 the correct path for xscreensaver scripts would be /usr/bin instead of /usr/local/bin, and /usr/share/applications/xscreensaver-properties.desktop for properties file.
ReplyDeletehttp://packages.ubuntu.com/natty/amd64/xscreensaver/filelist
Oh, and since i found out that gnome-screensaver started using gnome session for idle timeout, which is not present in xfce environment, I worked around it by putting xautolock to start up automatically and then use your script since it was already there: xautolock -time 5 -locker 'xscreensaver-command -lock' &
ReplyDeleteWorks like a charm - thanks!
ReplyDeleteThanks Robert and Ugljesa! I find gnome-screensaver-preferences is gone in GNOME 3, so I skipped the step 2 and modified xscreensaver-command to ignore -prefs and -demo option.
ReplyDeleteis this still working?
ReplyDelete