chiark / gitweb /
Go back to xscreensaver. Mostly.
authorMark Wooding <mdw@distorted.org.uk>
Thu, 6 Aug 2009 23:06:57 +0000 (00:06 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Thu, 6 Aug 2009 23:06:57 +0000 (00:06 +0100)
There's a new program `lock-screen' which works out which screensaver is
in use.  gnome-screensaver is in my bad books now because the 2.26 version
relies on gnome-session for its idle-time measuring.

This partially reverts commit f9f6fd32cf1e8cfab6ac71f9c34854e69e58711f.

bin/lock-screen [new file with mode: 0755]
dot/e16-bindings
dot/xinitrc
setup

diff --git a/bin/lock-screen b/bin/lock-screen
new file mode 100755 (executable)
index 0000000..5401260
--- /dev/null
@@ -0,0 +1,25 @@
+#! /bin/sh
+
+set -e
+
+win=no
+
+## xscreensaver
+if xscreensaver-command -version >/dev/null 2>&1; then
+  xscreensaver-command -lock
+  win=yes
+fi
+
+## gnome-screensaver
+if gnome-screensaver-command --query >/dev/null 2>&1; then
+  gnome-screensaver-command --lock
+  win=yes
+fi
+
+## Make sure we did something useful.
+case $win in
+  no)
+    echo >&2 "$0: no screensaver found"
+    exit 1
+    ;;
+esac
index 8cf502c99d7f062093dfcd044d05f4180c3a4926..79d10f6f4f203eaec2a904989caa2cfa64ce01d7 100644 (file)
@@ -32,7 +32,7 @@ KeyDown    5       F7 exec un-backslashify-selection
 KeyDown    5       F8 exec xatom set XINIT_COMMAND :terminal
 KeyDown    5       F9 exec xatom set XINIT_COMMAND :ask-run
 KeyDown           5      F10 exec xatom set XINIT_COMMAND :ask-command
-KeyDown           5      F11 exec gnome-screensaver-command --lock
+KeyDown           5      F11 exec lock-screen
 KeyDown    5      F12 exec xshutdown
 KeyDown    5      Tab focus next
 KeyDown    5     plus desk next
index 7543e1522062a1902a3575aa1ac7797933f0558f..a0722c5588c0d32bdbe7d65dbb2e3bb1a8501978 100755 (executable)
@@ -125,6 +125,14 @@ start-clients () {
   ## System monitor.
   case $vnc in no) run bginit gkrellm ;; esac
 
+  ## Screensaver.
+  case $vnc in
+    no)
+      run init xscreensaver-command -exit
+      run bginit xscreensaver -no-splash
+      ;;
+  esac
+
   ## Panel.
   case $vnc in no) run bginit gnome-panel ;; esac
 
diff --git a/setup b/setup
index 7174162701ede1e12a0ba418743e22520dec3848..85c615a273bb51cc530ecc3f2a9daadb063204c2 100755 (executable)
--- a/setup
+++ b/setup
@@ -220,6 +220,7 @@ scripts="
 [ "$xstuff" ] && scripts="$scripts
   xinitcmd
   un-backslashify-selection
+  lock-screen
   xshutdown"
 echo "Installing scripts..."
 mkdir -p $HOME$sub/bin