Debian -- better screen locking

Eli retracile at gmail.com
Mon Aug 25 03:19:30 CEST 2008


All,

When the screen goes blank, and you tap it, the tap is not swallowed... it is 
seen by the application you were running, and that app may do something you 
didn't intend.

Here's how I got around that for now:

Installed wmctrl with apt-get.

Modified zhone to rise to the top and kill the keyboard when it locks.  This 
will make zhone get the tap that wakes up the FR and show it's lock screen.  
(Hit the AUX to get your keyboard, and alt-tab as normal)

--- /usr/bin/zhone.orig	2008-08-24 12:03:33.000000000 +0000
+++ /usr/bin/zhone	2008-08-24 23:47:34.000000000 +0000
@@ -1417,6 +1417,10 @@
         for id in range( 1, 5 ):
             self.signal_emit( "deactivate_%i" % id, "" )
         self.signal_emit( "visible", "" )
+	# and close the keyboard if it's running
+	os.system("kill -s KILL `pidof /usr/bin/matchbox-keyboard`")
+	# Bring us to the top of the stack
+	os.system("wmctrl -a zhone")
 
     def deactivate( self ):
         self.signal_emit( "invisible", "" )

Then, modified the idle timeouts (the timeout for lock in particular):
--- /etc/frameworkd.conf.orig	2008-08-23 18:59:39.000000000 +0000
+++ /etc/frameworkd.conf	2008-08-24 12:29:10.000000000 +0000
@@ -17,9 +17,9 @@
 # configure timeouts (in seconds) here. A value of 0
 # means 'never fall into this state' (except programatically)
 idle = 10
-idle_dim = 20
-idle_prelock = 12
-lock = 2
+idle_dim = 30
+idle_prelock = 10
+lock = 1
 suspend = 0
 
 [odeviced.input]

Since zhone is now killing the keyboard, the matchbox-keyboard-toggle utility 
needs to be more robust and detect if the keyboard is running or not, so I 
patched it like this:
--- /usr/bin/matchbox-keyboard-toggle.orig	2008-08-24 12:15:20.000000000 +0000
+++ /usr/bin/matchbox-keyboard-toggle	2008-08-24 14:36:22.000000000 +0000
@@ -8,17 +8,9 @@
 
 import os
 
-keyboard_shown=False
-
 def signal_handler(name, action, seconds):
-    global keyboard_shown
-
     if name == "AUX" and action == "pressed":
-        if keyboard_shown:
-            os.system("kill -s KILL `pidof /usr/bin/matchbox-keyboard`")
-        else:
-            os.system("matchbox-keyboard &")
-        keyboard_shown = not keyboard_shown
+	os.system("pidof /usr/bin/matchbox-keyboard >/dev/null || (matchbox-keyboard 
&) && kill -s KILL `pidof /usr/bin/matchbox-keyboard`")
 
 
 bus = dbus.SystemBus()


Feedback welcome and appreciated.  Also, if there's an upstream that wants 
these, let me know where to send them.

Eli
-- 
------------------. "If it ain't broke now,
Eli Carter         \                  it will be soon." -- crypto-gram
retracile at gmail.com `-------------------------------------------------




More information about the community mailing list