Subject: FVWM: FvwmTaskBar clock feature suggestion

From: Kyle Graehl <[email-masked]>
Date: Fri, 24 Dec 2004 09:59:38 -0800

I am setting up an old laptop computer with FVWM for my mother and it
works great. In the current unstable there is a ClockFormat option.

*FvwmTaskBar: ClockFormat <strftime format>

I am not sure if FVWM functions can return values, but I think it
would be great to allow something like this:

*FvwmTaskBar: ExtendedClockText <some function that gets called at
each UpdateInterval>

This way I could get my battery level percentage down there by the
clock. I'm sure others could find more creative uses for this. I tried
to hack this in myself but I don't really understand C and I honestly
couldn't see how the current system works. (Goodies.c?)

Kyle

--
Visit the official FVWM web page at <URL: http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm" in the body of a
message to [email-masked].
To report problems, send mail to [email-masked].

---

From: "George \"Nephrite\" Potapov" <[email-masked]>
Date: Mon, 27 Dec 2004 10:31:52 +0300

> couldn't see how the current system works. (Goodies.c?)

A better idea would be to make FvwmTaskBar able to swallow arbitrary windows
like FvwmButtons does. Writing a string into clock looks too "ad hoc" to me.

-- 
wbr,
George 'Nephrite' Potapov
Inline Technologies

---

From: Roeland Moors <[email-masked]>
Date: Mon, 27 Dec 2004 10:31:06 +0100

> like FvwmButtons does. Writing a string into clock looks too "ad hoc" to me.
I'm just using FvwmButtons and FvwmScript to display my battery
level. Not really what your asking, but here is the code what I'm
using if you need it.
( the output is something like 'AC 99% 43.0°')

This is a ruby script to get the battery level and the degrees:
------------------------------------------------------------------
#!/usr/bin/env ruby
online = false
degree = '??'
procent = '??'
status = `acpi -atc`
status.each_line do |line|
    line.chomp!
    online = (line =~ /.*on-line.*/) if line =~ /.*AC Adapter.*/
    if line =~ /.*Thermal.*/
        degree = line.gsub!(/.*,/, '')
        degree.gsub!(/degrees.*/, '')
        degree.strip!
    end
    if line =~ /.*Battery.*/
        procent = line.gsub(/.*ing,/, '')
        procent.gsub!(/, .*/, '')
        procent.strip!
    end
end

if online; print 'AC' else print 'DC' end
print " #{procent}" 
puts " #{degree}°"
------------------------------------------------------------------
And here is the FvwmAcpi script:
------------------------------------------------------------------
WindowTitle {FvwmAcpi}
WindowSize 88 23

Init
 Begin
  Set $MainColorset=(GetScriptArgument 1)
  If $MainColorset <> {} Then
  Begin
   ChangeColorset 0 $MainColorset
   ChangeColorset 1 $MainColorset
  End
  Set $tmp = (GetOutput {exec ./.fvwm/scripts/acpi.rb} 1 -1)
  ChangeTitle 1 $tmp
End

PeriodicTasks
 Begin 
  If (RemainderOfDiv (GetTime) 30)==0 Then
  Begin
    Set $tmp = (GetOutput {exec ./.fvwm/scripts/acpi.rb} 1 -1)
    ChangeTitle  1 $tmp
  End
End

Widget 1
Property
 Position 0 0
 Size 88 23
 Type ItemDraw
 Flags NoReliefString
 Title {}
Main
 Case message of
  SingleClic :
  Begin
  End
End
------------------------------------------------------------------

-- 
Roeland