WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Flit: an FLTK-native "tray" with clock, sound control, and battery monitor  (Read 40630 times)

Offline roberts

  • Retired Admins
  • Hero Member
  • *****
  • Posts: 7361
  • Founder Emeritus
Re: Flit: an FLTK-native "tray" with clock, sound control, and battery monitor
« Reply #75 on: September 13, 2009, 03:11:39 PM »
Posted in repository. See announcement.
10+ Years Contributing to Linux Open Source Projects.

Offline jpeters

  • Restricted
  • Hero Member
  • *****
  • Posts: 1017
Re: Flit: an FLTK-native "tray" with clock, sound control, and battery monitor
« Reply #76 on: September 13, 2009, 05:11:14 PM »
What would be really useful is for the battery monitor to "beep" when it's down to, say, 10 minutes left. Ever lose documents when the laptop becomes unplugged?

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11049
Re: Flit: an FLTK-native "tray" with clock, sound control, and battery monitor
« Reply #77 on: September 13, 2009, 05:21:38 PM »
What would be really useful is for the battery monitor to "beep" when it's down to, say, 10 minutes left. Ever lose documents when the laptop becomes unplugged?
Isn't that acpid's business?
The only barriers that can stop you are the ones you create yourself.

Offline gerald_clark

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 4254
Re: Flit: an FLTK-native "tray" with clock, sound control, and battery monitor
« Reply #78 on: September 13, 2009, 05:57:17 PM »
My laptop has a dead battery, so I run it off AC.  I certainly don't want it beeping.

Offline jpeters

  • Restricted
  • Hero Member
  • *****
  • Posts: 1017
Re: Flit: an FLTK-native "tray" with clock, sound control, and battery monitor
« Reply #79 on: September 13, 2009, 06:08:08 PM »
It would only beep if disconnected from power. Actually, I like the idea of a popup better. I don't think my ACPI setup is currently handling this. (the "alarm" seems to be just for wakeup/sleep ...but no "beep"  )


Here was a script from dsl that issues a popup:
http://www.damnsmalllinux.org/f/topic-3-2-18266-0.html

Code: [Select]
simple battery script called from torsmo

# modprobe battery needs to be done somewhere 1st
# installing beep is one way to make a noise from the background

MAXCAP=$(awk '/^last full capacity:/ {print $4}' /proc/acpi/battery/BAT0/info)

REMAINING=$(awk '/^remaining capacity:/ {print $3}' /proc/acpi/battery/BAT0/state)

CHARGING=$(awk '/^charging state:/ {print $3}' /proc/acpi/battery/BAT0/state)

(( TEST = REMAINING * 5 ))

if [ $CHARGING = discharging ]; then

echo "$REMAINING/$MAXCAP mAh"

if [ $TEST -le $MAXCAP ]; then
beep -l 400 -r 2
popup.lua "LOW BATTERY ALERT! Charge remaining = $REMAINING mAh Less than 20 per cent full.   Recharge now
« Last Edit: September 13, 2009, 06:14:43 PM by jpeters »

Offline MikeLockmoore

  • Hero Member
  • *****
  • Posts: 525
  • Good software needn't be big!
Re: Flit: an FLTK-native "tray" with clock, sound control, and battery monitor
« Reply #80 on: September 13, 2009, 09:00:19 PM »
I think all of the versions I have posted so far will slowly flash the battery icon with a red outline (5 sec red outline, 5 sec normal, ...) , so it draws some attention without inteferring a lot in what you are trying to do. A beep and/or pop-up warning might be nice, but for now, I think I'd like to freeze the features as-is, fix any significant bugs, and call it version 1.0.0.  For the versions leading up to 2.0, we can experiment with some different alert features.  Maybe some new applets too. 
--
Mike L.

Offline MikeLockmoore

  • Hero Member
  • *****
  • Posts: 525
  • Good software needn't be big!
Re: Flit: an FLTK-native "tray" with clock, sound control, and battery monitor
« Reply #81 on: September 13, 2009, 09:01:11 PM »
roberts: Thanks for posting the latest in the repository! -- Mike

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14849
Re: Flit: an FLTK-native "tray" with clock, sound control, and battery monitor
« Reply #82 on: September 14, 2009, 06:37:40 AM »
Juanito: Sorry I misunderstood.  I have added the '%' above the icon when the battery is discharging.

Looks good now  :)

Offline jemimah

  • Newbie
  • *
  • Posts: 6
Re: Flit: an FLTK-native "tray" with clock, sound control, and battery monitor
« Reply #83 on: September 14, 2009, 12:09:14 PM »
Mike, I

 tried .9.7 on puppy (yes it has /dev/mixer) but it just says "no sound found". 

Also quick question for you.  Have you posted source for your flwm bug fixes anywhere?  It would save me the trouble of fixing all that stuff again for my puppy version.

Offline jls

  • Hero Member
  • *****
  • Posts: 2135
Re: Flit: an FLTK-native "tray" with clock, sound control, and battery monitor
« Reply #84 on: September 14, 2009, 06:40:43 PM »
would it be possible to add support 4 alsa?
dCore user

Offline MikeLockmoore

  • Hero Member
  • *****
  • Posts: 525
  • Good software needn't be big!
Re: Flit: an FLTK-native "tray" with clock, sound control, and battery monitor
« Reply #85 on: September 14, 2009, 07:19:30 PM »
Jemimah: If you can compile it, try it with the "#define DIAG" enabled (un-comment it).  You may get a bit more info on why it does not work for you.  But if your sound system is ALSA and not OSS, it will not work currently.

I guess the current "lightly" modified flwm is not posted with the 2.3.1 release of TC.  Maybe roberts can post it soon.

jls_legalize: I'd like to add an ALSA option during the pre-2.0 levels.

Offline jpeters

  • Restricted
  • Hero Member
  • *****
  • Posts: 1017
Re: Flit: an FLTK-native "tray" with clock, sound control, and battery monitor
« Reply #86 on: September 21, 2009, 01:46:06 AM »
Any way to get rid of the hotkeys?  They can be a real nuisance (I have a lot of keys that involve ctr-alt)..This is just a utility, not a word-processor or editor.  :)

Offline MikeLockmoore

  • Hero Member
  • *****
  • Posts: 525
  • Good software needn't be big!
Re: Flit: an FLTK-native "tray" with clock, sound control, and battery monitor
« Reply #87 on: September 21, 2009, 12:51:05 PM »
jpeters:  If you click on something else (give input focus to another app), Flit should no longer respond to the Ctrl-key press.  Maybe I can try to make Flit forfeit the input focus on startup so it is not an issue most of the time.
--
Mike

Offline jpeters

  • Restricted
  • Hero Member
  • *****
  • Posts: 1017
Re: Flit: an FLTK-native "tray" with clock, sound control, and battery monitor
« Reply #88 on: September 21, 2009, 02:03:40 PM »
jpeters:  If you click on something else (give input focus to another app), Flit should no longer respond to the Ctrl-key press.  Maybe I can try to make Flit forfeit the input focus on startup so it is not an issue most of the time.
--
Mike

Flit continues to respond with focus on desktop.  That's where all my jwm hotkeys work.  Fact is, how often does someone need to hotkey Flit? You can get rid of all the hotkeys, IMHO. 

Offline jpeters

  • Restricted
  • Hero Member
  • *****
  • Posts: 1017
Re: Flit: an FLTK-native "tray" with clock, sound control, and battery monitor
« Reply #89 on: September 21, 2009, 10:50:53 PM »
Where is the Alt Ctrl  keybinding in the source code .....It must be there somewhere  ??

Edit: found it; comment out line 846. Now I can use it again  :)
« Last Edit: September 22, 2009, 12:00:19 AM by jpeters »