From owner-freebsd-mobile Sun Nov 9 18:27:36 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id SAA25010 for mobile-outgoing; Sun, 9 Nov 1997 18:27:36 -0800 (PST) (envelope-from owner-freebsd-mobile) Received: from rover.village.org (rover.village.org [204.144.255.49]) by hub.freebsd.org (8.8.7/8.8.7) with SMTP id SAA24977 for ; Sun, 9 Nov 1997 18:27:29 -0800 (PST) (envelope-from imp@village.org) Received: from harmony [10.0.0.6] by rover.village.org with esmtp (Exim 1.71 #1) id 0xUjZS-00040T-00; Sun, 9 Nov 1997 19:27:22 -0700 Received: from harmony.village.org (localhost [127.0.0.1]) by harmony.village.org (8.8.7/8.8.3) with ESMTP id TAA20649 for ; Sun, 9 Nov 1997 19:27:47 -0700 (MST) Message-Id: <199711100227.TAA20649@harmony.village.org> To: mobile@freebsd.org Subject: A little tk program Date: Sun, 09 Nov 1997 19:27:46 -0700 From: Warner Losh Sender: owner-freebsd-mobile@freebsd.org X-Loop: FreeBSD.org Precedence: bulk ok. I have a small tcl/tk prorgam that works under tk 4.2 (since I have ical installed). It displays the current battary level. It should work with 8.0 as well. Enjoy. Comments welcome. Only about 1M of memory is needed :-(. Warner P.S. You need to run this as root, or have apm be setuid root. P.P.S. Mike Smith: now I understand why you like tk so much.... #! /usr/local/bin/wish4.2 proc updateBattery {} { global batteryLevel set batteryLevel [exec apm -l] wm iconname . [format "%d%%" $batteryLevel] after 30000 updateBattery } label .label -text "Battery Level" pack .label scale .scale -from 0 -to 100 \ -length 100 \ -variable batteryLevel \ -orient horizontal \ -showvalue true pack .scale updateBattery