WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: FLIT time sound battery applet  (Read 12923 times)

Offline ACRizona

  • Jr. Member
  • **
  • Posts: 61
FLIT time sound battery applet
« on: November 29, 2010, 04:02:48 PM »
FLIT is one of those kind of programs that should have a one-instance-only limit.

The cat walked on the touch-pad.... you know the rest of this story.........

I think ALL programs should have a instance-checker. 

Flit is a great little-applet  !    Perfect for my too-old too-weak batteries.

Offline MikeLockmoore

  • Hero Member
  • *****
  • Posts: 503
  • Good software needn't be big!
Re: FLIT time sound battery applet
« Reply #1 on: November 30, 2010, 10:45:31 AM »
@ACRizona: probably a good idea... although sometimes during development I like to have the old stable version running all the time and then test the new version.  

Maybe the default mode could check for a prior instance and if it sees one, bow out gracefully.  Then I could have a command-line option to allow multiple instances (maybe with a specified alternative config file). OK, that's on the "probable to-do" list.  I'd also like to add a wireless network management applet to Flit soon.  But, shhh. Don't tell anyone yet!   :-X

Offline tinypoodle

  • Hero Member
  • *****
  • Posts: 3857
Re: FLIT time sound battery applet
« Reply #2 on: November 30, 2010, 12:04:44 PM »
 :-X
"Software gets slower faster than hardware gets faster." Niklaus Wirth - A Plea for Lean Software (1995)

Offline ACRizona

  • Jr. Member
  • **
  • Posts: 61
Re: FLIT time sound battery applet
« Reply #3 on: November 30, 2010, 04:00:04 PM »
Laptop battery applet that throttles/stops/starts my "Vampire" wifi card ?.
WOW !!!  what a grand idea !

That sucker saps nearly 50% of my battery power, no matter if I'm using it or not.
I have a script that keeps it alive for 240 seconds, then 240 more, 240 more, etc.
( the assumption is, if I dont use it within 240 seconds, it dies ) at this moment, its dead.

I took a 3-day airtrip over the holidays (with my spare battery in luggage ) and did not have to recharge,,, not once, with nearly six hours use.








Offline tinypoodle

  • Hero Member
  • *****
  • Posts: 3857
Re: FLIT time sound battery applet
« Reply #4 on: November 30, 2010, 04:42:39 PM »
Umm, have you looked into the power management native to iwconfig?
"Software gets slower faster than hardware gets faster." Niklaus Wirth - A Plea for Lean Software (1995)

Offline maro

  • Hero Member
  • *****
  • Posts: 1228
Re: FLIT time sound battery applet
« Reply #5 on: November 30, 2010, 05:17:07 PM »
ACRizona: In my view only few applications (e.g. super-user daemons) will need to check if another instance of them is already running. For the vast majority something similar could be achieved with a little wrapper script like the following:

Code: [Select]
tc@box:~$ cat start_once_in_bg.sh
#!/bin/sh

CMD=$1
shift
ARGS="$@"

if [ -n "$( ps -o args | grep "^${CMD}" )" ] ; then
    echo "$CMD is already running"
    exit 2
else
    [ -n "$ARGS" ] && eval "exec $CMD $ARGS &" || eval "exec $CMD &"
fi
tc@box:~$

It should work if you use 'start_once_in_bg.sh APP OPTIONS' and refuses to start 'APP' if another instance is already running. Mind you the test is not completely "safe" as 'APP' , 'sh APP' and '/bin/sh APP' would be seen as three different things.

Offline ACRizona

  • Jr. Member
  • **
  • Posts: 61
Re: FLIT time sound battery applet
« Reply #6 on: November 30, 2010, 10:39:38 PM »
Umm, have you looked into the power management native to iwconfig?

Along with old batteries, I also have old Athereos cards which do not support all the different power-saving functions.     
But, if someone was to add WiFi control to an applet like FLIT.... it could throttle the WiFi depending on battery condition.
Plus, it would be as simple as the audio-volume-mute.    A slider for time-to-live and on/off button.

Offline ACRizona

  • Jr. Member
  • **
  • Posts: 61
Re: FLIT applet wish list.
« Reply #7 on: December 11, 2010, 05:50:25 PM »
I've said before: FLIT is the must-have applet for laptops.

1. I wish it was invisible to the desk-top-right-click menu.
    Its sorta like Wbar... I know its running !
2. I wish it had a "throttle" for power eating things.  Like the WiFi card.
    Most laptops will slowly dim the LCD as the battery dies.  Shut down disk drives,,,   even go to sleep,,, which TinyCore does rather nicely. But, the WiFi card is still ON  :P    We have a HP laptop that has a WiFi activity light, and a keyboard switch to toggle it ON/OFF.    Nice feature.   

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 13305
Re: FLIT time sound battery applet
« Reply #8 on: December 11, 2010, 07:23:13 PM »
I didn't try it, but laptop-mode-tools might be able to switch off your wifi card?

Offline tinypoodle

  • Hero Member
  • *****
  • Posts: 3857
Re: FLIT time sound battery applet
« Reply #9 on: December 12, 2010, 02:27:35 AM »
2. I wish it had a "throttle" for power eating things.  Like the WiFi card.
    Most laptops will slowly dim the LCD as the battery dies.  Shut down disk drives,,,   even go to sleep,,, which TinyCore does rather nicely. But, the WiFi card is still ON  :P    We have a HP laptop that has a WiFi activity light, and a keyboard switch to toggle it ON/OFF.    Nice feature.   

Such power saving features as you mention may differ depending on hardware and/or BIOS.
Have you been looking into all related settings in your BIOS?
And similar into configuration options of your particular wifi chipsets?
The keyboard switch to toggle builtin wifi cards on/off is equivalent to the removal of external cards.

I doubt that FLIT could be suitable for such purposes, or it would require much more code and possibly several dependencies.
"Software gets slower faster than hardware gets faster." Niklaus Wirth - A Plea for Lean Software (1995)

Offline MikeLockmoore

  • Hero Member
  • *****
  • Posts: 503
  • Good software needn't be big!
Re: FLIT time sound battery applet
« Reply #10 on: December 12, 2010, 09:04:36 AM »
@tinypoodle: I'm thinking about the next significant iteration of Flit now that Jakob has provided all the features added version 1.3.  Here's a little thinking out loud...

1) A future version of Flit (2.0 series?) will include a wireless and wired monitor applets (one instance for each network adapter, but maybe grouped as "show wireless adapters", "show network adapters" in the Flit menu).  The wireless version of the monitor applet would...

  a) Show a graphical representation of signal strength (maybe a 5-bar display)

  b) Indication of traffic volume (and maybe bad packet indication)

  c) Show IP addr. and wireless network name (ESSID) if one hovers the mouse pointer over it

  d) Launch a separate FLTK networking management application  (see below) if you double-click the applet in Flit

2) The wired version of the network applet would...

  a) Show a graphical representation of being enabled or disabled

  b) Indication of traffic volume (and maybe bad packet indication)

  c) Show IP addr. if one hovers the mouse pointer over it

  d) Launch the current networking maintenance app from TinyCore Base if you double-click the applet in Flit


3) The fast, light assistant (for) networking ("Flan", although I briefly considered "fast, light assistant for wireless"... hmm   ::)  ) would...

  a) Allow the user to enable and disable the wireless devices, at least through ifconfig and/or iwconfig; may not be able to fully disable the device (depends on how it responds to these standard tools)

  b) Scan for available wireless networks, and see name, signal strength, encryption requirements, and other parameters

  c) Allow the user to connect to a particular wireless network; at least in the first version(s) this would be accomplished through iwconfig, so some advanced encryption modes may not be accessible

  d) Allow the user to save the settings for a particular network and select it from a list of known network settings to easily re-connect in the future

  e) Allow an "auto connect" flag for each network (or generic class of networks... "free wifi" would be a built-in choice) and allow the user to prioritize the configured connections, so if the first "auto-connect" choice is detected with reasonable signal strength, it is tried; and if not, the next one in the list is tried; and so on.

  f)  Check for prior instances when launched, and if it finds one, send it an "appear" signal and exit  (this way, Flit can just try to launch Flan, if the 2nd instance of Flan discovers there is a 1st instance, the 2nd can tell the 1st instance to un-iconify and present itself, then the 2nd instance can exit early).

  g) Allow each network connection to have either static or DHCP IP numbers

  h) Launch the current networking maintenance app from TinyCore Base.

So for this first step, Flan would only depend on wireless-tools.tcz.  If we find out that Flan is missing some crucial capability, we can consider adding other dependencies (wireless-supplicant?), but I don't have experience with those, since I seem to be able to do what I want 99% of the time with ifconfig, iwconfig, and iwlist (esp. "iwlist scanning").  Maybe we can have a "hook" to invoke extra network startup or shutdown shell commands if your adapter has and needs those to better manage the power.

Seem like a good game plan?  I'm not planning on starting this until the beta 1.3.0 version of Flit is considered complete (no big bugs or convincing change requests) and submitted to the official TC repository, but may have early versions ready for testing within a month or so.
--
Mike Lockmoore


Offline tinypoodle

  • Hero Member
  • *****
  • Posts: 3857
Re: FLIT time sound battery applet
« Reply #11 on: December 12, 2010, 09:14:20 AM »
 :o

FLAN, huh?   ;D
"Software gets slower faster than hardware gets faster." Niklaus Wirth - A Plea for Lean Software (1995)

Offline MikeLockmoore

  • Hero Member
  • *****
  • Posts: 503
  • Good software needn't be big!
Re: FLIT time sound battery applet
« Reply #12 on: December 13, 2010, 07:52:53 AM »
I'm going to run out of FL words.  :P

Offline ACRizona

  • Jr. Member
  • **
  • Posts: 61
Re: FLIT time sound battery applet
« Reply #13 on: December 14, 2010, 02:23:57 PM »
The FLAN PLAN looks great !
I'm a big proponent of the KISS methodology... especially applets like FLIT.
Nearly as simple as the light-dimmer-switch on my wall.

Beyond that, your are talking about a full-function menu-bar application program.
Thats a good idea OK too, but keep in mind, I already own a big AutoDiscover/AutoConnect/slow-noisy-boat-anchor that I'm embarassed to use in an airport.
That's why I carry a TinyCore notebook with a few apps and FLIT !

btw:  I like the name FLAN.  I'm tinkering with wbar-menu-folders with my script called WBARF ;D

Offline Lee

  • Hero Member
  • *****
  • Posts: 645
    • My Core wiki user page
Re: FLIT time sound battery applet
« Reply #14 on: December 15, 2010, 09:31:19 AM »
I put a "Micro Core" button on my JWM tray (like the Windows "Start" button but with a better OS to hold it up) that has submenus, but I kind of like the clean simplicity of the existing wbar... though the term wbarf was a stroke of genius.  :D

As for the fast, light apps - what about putting the "fl" at the end of the name.  You could have apps that are helpfl and usefl.  It would be beautifl.
32 bit core4.7.7, Xprogs, Xorg-7.6, wbar, jwm  |  - Testing -
PPR, data persistence through filetool.sh          |  32 bit core 8.0 alpha 1
USB Flash drive, one partition, ext2, grub4dos  | Otherwise similar