Package: lockout
Version: 0.2.3-2
Severity: wishlist
Tags: patch

Hi Thomer,

I like the natural feel of the lockout status countdown timer, but I
recently added the countdown timer as a variable-width taskbar applet in
my window manager and I find the applet's frequent shifting distracting.
For example, between 10 minutes 10 seconds and 9 minutes 0 seconds, the
timer has all the following widths:

    10m 10s to go
    10m to go
    10m 9s to go
    9m 9s to go
    9m to go

Making my applet fixed-width failed to adequately solve my problem: I
still get distracted when a width change occurs.  The following patch
retains most of the countdown timer's natural feel but greatly reduces
width changes.

--- tmp/lockout.orig    2008-11-30 09:55:18.000000000 -0500
+++ /usr/bin/lockout    2008-11-30 09:58:04.000000000 -0500
@@ -355,8 +355,8 @@
     my $s = ($time - time)%60;
     print "Locked until: " . localtime($time) . ". ";
     $h and print $h . "h ";
-    ($m || ($h && $s)) and print $m . "m ";
-    $s and print $s . "s ";
+    ($m || $h) and printf "%02dm %02ds ", $m, $s;
+    (!$h && !$m && $s) and print $s, "s ";
     print "to go.\n";
   } elsif(time - $time <= 10) {
     print "System is being unlocked now.\n";


I'm not sure reducing width changes helps anyone besides me, but I thank
you for considering this patch anyway.

-Dave
-- 
David A. Harding            Website:  http://dtrt.org/
1 (609) 997-0765              Email:  [EMAIL PROTECTED]
                        Jabber/XMPP:  [EMAIL PROTECTED]



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to