##############
- # wraps secure shell with some parameters we like, most importantly to enable X forwarding.
+ # wraps secure shell with some parameters we like.
function ssh()
{
local args=($@)
restore_terminal_title
}
+ # returns zero (success) if the X window system is currently running.
+ function test_for_xwin()
+ {
+ if ! timeout 1s xset q &>/dev/null; then
+#echo "No X server is running on \$DISPLAY [$DISPLAY]" >&2
+ return 1
+ else
+#echo "X server is running on \$DISPLAY [$DISPLAY]" >&2
+ return 0
+ fi
+ }
+
##############
# locates a process given a search pattern to match in the process list.
# load some helper methods for the terminal which we'll use below.
source "$FEISTY_MEOW_SCRIPTS/tty/terminal_titler.sh"
+ # start up the xsecurelock screen saver if we are running x window system.
+ bash "$FEISTY_MEOW_SCRIPTS/core/start_xwin_screensaver.sh"
+
##############
#hmmm: abstract this to a twiddle shell options method.
--- /dev/null
+#!/usr/bin/env bash
+
+# sets up a screen lock with the xsecurelock program, and assumes
+# that it will use the xscreensaver utility for the screen saving.
+
+source "$FEISTY_MEOW_SCRIPTS/core/functions.sh"
+source "$FEISTY_MEOW_SCRIPTS/processes/process_manager.sh"
+
+if ! test_for_xwin; then
+ if [ ! -z "$DEBUG_FEISTY_MEOW" ]; then
+ echo "X windows is not running; will not start up xsecurelock."
+ fi
+ exit 1
+fi
+
+xss_running="$(psa xss-lock)"
+if [ ! -z "$xss_running" ]; then
+ if [ ! -z "$DEBUG_FEISTY_MEOW" ]; then
+ echo "The xss-lock application is already running, so a screensaver is already hooked in."
+ fi
+ exit 0
+fi
+
+DIMMER="/usr/libexec/xsecurelock/dimmer"
+if [ ! -x "$DIMMER" ]; then
+ if [ ! -z "$DEBUG_FEISTY_MEOW" ]; then
+ echo "Could not find the dimmer app for xsecurelock; assuming xsecurelock is not installed and giving up."
+ fi
+ exit 1
+fi
+
+xset s 300 5
+exit_on_error "setting the x window inactivity timeout"
+
+start_background_action \
+ "xss-lock -n "$DIMMER" -l -- xsecurelock"
+exit_on_error "installing xsecurelock as the screensaver when inactive"
+
+if [ ! -z "$DEBUG_FEISTY_MEOW" ]; then
+ echo xsecurelock has been started.
+fi
+