Add xlock2 command
authorColin Patrick McCabe <cmccabe@alumni.cmu.edu>
Mon, 19 Jul 2010 01:30:00 +0000 (18:30 -0700)
committerColin Patrick McCabe <cmccabe@alumni.cmu.edu>
Mon, 19 Jul 2010 01:30:00 +0000 (18:30 -0700)
.bashrc

diff --git a/.bashrc b/.bashrc
index c3c0e18..0f1c4e7 100644 (file)
--- a/.bashrc
+++ b/.bashrc
@@ -9,6 +9,15 @@ if [ -f ~/.bashrc-local ]; then
        . ~/.bashrc-local
 fi
 
+xlock2() {
+        ps aux | grep -v grep | grep xscreensaver > /dev/null
+        if [ $? -ne 0 ]; then
+                echo "starting xscreensaver..."
+                xscreensaver &
+        fi
+        xscreensaver-command -lock
+}
+
 case $- in
 *i*)
        # interactive shell