Re: Date time problem bookworm, fvwm....

2023-10-22 Thread tomas
On Sun, Oct 22, 2023 at 01:51:41PM +0200, Thomas Schmitt wrote:

[...]

> Originally it did only put out text in an xterm, but then i shamelessly
> exploited code from the exploitation chain xpppload <- xisdnload <- xload
> to give it a histogram in ain additional separate window.

Now this one beats my weirdness by a stretch :-)

Cheers
-- 
t


signature.asc
Description: PGP signature


Re: Date time problem bookworm, fvwm....

2023-10-22 Thread tomas
On Sun, Oct 22, 2023 at 07:50:54AM -0400, The Wanderer wrote:
> On 2023-10-22 at 07:24, to...@tuxteam.de wrote:
> 
> > I better not tell. My clock is a... shell script in a tiny Xterm
> > which also shows my battery status.
> 
> Ooo, that sounds interesting. I don't currently have a laptop, so the
> battery-status part wouldn't currently apply, but this sounds like
> something I might like to try when that changes; any chance of sharing
> the specific details?

Glad to oblige.

The date part is the smallest, down there in the lower right
corner :-)


tomas@trotzki:~$ cat ~/bin/bat
#!/bin/bash
# Notes:
# for colors:
# tput setaf 1 ; tput bold ; echo -n 123 ; tput setaf 7 ; tput sgr0 ; echo 456
# cf tput(1) terminfo(5)
# do continuous mode with watch -c, possibly t

BAT='/sys/class/power_supply/BAT0'
AC='/sys/class/power_supply/AC'
FULL=$(cat $BAT/energy_full)
NOW=$(cat $BAT/energy_now)
case $(cat $AC/online) in
  0) online="BAT" ;;
  1) online="AC " ;;
  *) online="???" ;;
esac
echo -ne "$online " ; dc -e "5k $NOW $FULL / p" ; date +"%F%a%n  %T"


The fun part is convincing fvwm  to do its thing:


# Style for bat, clock:
Style bat !Borders,!Handles,!Title

# NOTES if text too big, nothing to be seen;
#   watch -t: no title;
#   the -geometry is there to place the window off screen while it's
#   not yet swallowed.
#   Can we change colors? Yeah: watch lets 'em through with option -c
*FvwmButtons: (2x1, Frame 2, \
  Swallow bat "Exec exec xterm -class bat -bg black -fg white \
  -geometry +5000+5000 \
  -fn 'xft:DejaVu Sans Mono Book:pixelsize=7' \
  -e watch -tn 10 bat" )


Enjoy :)

I've been mulling around whether to switch to Tcl/Tk: I like the
unobtrusiveness of the thing, but some more noise when the battery
is on its last legs would be desirable :-)

> > But I'm weird.
> 
> I literally used to go by "Weird" as a nickname, though (sadly?) it
> never became as commonly used as with Al. Weird doesn't bother me at
> all.

A good feeling not to be alone around here ;-)

Cheers
-- 
t


signature.asc
Description: PGP signature


Re: Date time problem bookworm, fvwm....

2023-10-22 Thread The Wanderer
On 2023-10-22 at 07:24, to...@tuxteam.de wrote:

> I better not tell. My clock is a... shell script in a tiny Xterm
> which also shows my battery status.

Ooo, that sounds interesting. I don't currently have a laptop, so the
battery-status part wouldn't currently apply, but this sounds like
something I might like to try when that changes; any chance of sharing
the specific details?

> But I'm weird.

I literally used to go by "Weird" as a nickname, though (sadly?) it
never became as commonly used as with Al. Weird doesn't bother me at
all.

-- 
   The Wanderer

The reasonable man adapts himself to the world; the unreasonable one
persists in trying to adapt the world to himself. Therefore all
progress depends on the unreasonable man. -- George Bernard Shaw



signature.asc
Description: OpenPGP digital signature


Re: Date time problem bookworm, fvwm....

2023-10-22 Thread Thomas Schmitt
Hi,

to...@tuxteam.de wrote:
> My clock is a... shell script in a tiny Xterm which
> also shows my battery status.

My digital clock with date display is a C program which mainly watches the
network traffic. It even has an own date format ("A0" = 2000, now is "C3")
which has an odd history beginning in 1987, when nobody expected to live
to see year 2000.
  http://scdbackup.webframe.org/pppoem

Originally it did only put out text in an xterm, but then i shamelessly
exploited code from the exploitation chain xpppload <- xisdnload <- xload
to give it a histogram in ain additional separate window.


Have a nice day :)

Thomas



Re: Date time problem bookworm, fvwm....

2023-10-22 Thread tomas
On Sun, Oct 22, 2023 at 11:16:25AM +0200, Thomas Schmitt wrote:
> Hi,
> 
> Charlie wrote:
> > I removed the clock from the
> > FVWM task bar and Gkrellm now dis[pays the right time. So a fix
> > of sorts with which I can live.
> 
> Congrats. :))
> 
> 
> > being a bit long in
> > the tooth to start relearning another window manager.
> 
> I'm using fvwm since the last century. It's configured by a ~/.fvwm2rc
> which is at least 20 years old with minor changes to adapt to changed
> paths and to avoid some unwanted behavior from 10 years ago.

I came back to it some time last century, after a very instructive
travel which encompassed Gnome (Metacity), Xfce, Awesome and other
exotica (olwm, GWM...)

> My clock is FvwmXclock. It's an analog-style 12 hours without date
> display.

I better not tell. My clock is a... shell script in a tiny Xterm which
also shows my battery status.

But I'm weird.

> Have a nice day :)

Likewise :)

Cheers
-- 
t


signature.asc
Description: PGP signature


Re: Date time problem bookworm, fvwm....

2023-10-22 Thread Thomas Schmitt
Hi,

Charlie wrote:
> I removed the clock from the
> FVWM task bar and Gkrellm now dis[pays the right time. So a fix
> of sorts with which I can live.

Congrats. :))


> being a bit long in
> the tooth to start relearning another window manager.

I'm using fvwm since the last century. It's configured by a ~/.fvwm2rc
which is at least 20 years old with minor changes to adapt to changed
paths and to avoid some unwanted behavior from 10 years ago.

My clock is FvwmXclock. It's an analog-style 12 hours without date
display.


Have a nice day :)

Thomas



Re: Date time problem bookworm, fvwm....

2023-10-22 Thread Charlie
On Sun, 22 Oct 2023 10:13:59 +0200
"Thomas Schmitt"  wrote:

> Hi,
> 
> Charlie wrote:
> > The date on that system is one day in advance and one hour late. Not
> > terrible,
> > However after a short period 100% of one of the CPU cores is used,
> > noisy running, and top -c shows this as the user:
> > /usr/libexe/fvwm2/2.7.0/FvwmScript 17 4 none 0 8 FvwmScript
> > DateTime  
> 
> Looking at
>   
> https://raw.githubusercontent.com/fvwmorg/fvwm3/main/default-config/FvwmScript-DateTime
> and reading "man FvwmScript" i'd say that the promised 1-second
> waiting period of "PeriodicTasks" is heavily shortened by the clock
> peculiarity.
> 
> 
> > Managed to get date and time right with the ntp commands, set
> > location etc., on Gkrellm at least. But the fvwm clock had frozen
> > up and stopped.  
> 
> That's quite normal with periodic jobs when the system time gets
> changed backward. Possibly the clock would come back to life after
> the last shown time is reached again 23 hours later.
> 
> 
> > Then tried to set the date manually with hwclock but no joy.  
> 
> Please detail "no joy":
> Does hwclock show the future time after rebooting if you have set it
> to the right time before rebooting ?
> (Or is it only the system clock which hops ahead ?)
> Does hwclock get changed to the future time without rebooting ?
> 
> 
> > Removing FvwmScript which I can't open to edit removes the clock
> > from the FVWM taskbar,  
> 
> Does this solve the problem with the future time ?
> 
> 
> > And haven't tried to
> > but Gkrellm is now using the same time?  
> 
> (I don't understand this statement. Maybe it's important for finding
> the explanation.)
> 
> 
> > It would appear to be an fvwm problem  
> 
> The fast running CPU might be related to poor handling of weird times
> by FvwmScript.
> 
> But for now i doubt that fvwm sets the system date on its own.
> 
> 
> Have a nice day :)
> 
> Thomas
> 

Thank you for the link Thomas. I removed the clock from the
FVWM task bar and Gkrellm now dis[pays the right time. So a fix
of sorts with which I can live.

I was going to install fluxbox, which I used many years ago before FVWM
just to see what that clock said. Luckily didn't need to because the
clock came up correct. Dreaded doing that anyway, being a bit long in
the tooth to start relearning another window manager.

So thank you for your help.
Charlie



Re: Date time problem bookworm, fvwm....

2023-10-22 Thread Thomas Schmitt
Hi,

Charlie wrote:
> The date on that system is one day in advance and one hour late. Not
> terrible,
> However after a short period 100% of one of the CPU cores is used,
> noisy running, and top -c shows this as the user:
> /usr/libexe/fvwm2/2.7.0/FvwmScript 17 4 none 0 8 FvwmScript DateTime

Looking at
  
https://raw.githubusercontent.com/fvwmorg/fvwm3/main/default-config/FvwmScript-DateTime
and reading "man FvwmScript" i'd say that the promised 1-second waiting
period of "PeriodicTasks" is heavily shortened by the clock peculiarity.


> Managed to get date and time right with the ntp commands, set location
> etc., on Gkrellm at least. But the fvwm clock had frozen up and stopped.

That's quite normal with periodic jobs when the system time gets changed
backward. Possibly the clock would come back to life after the last shown
time is reached again 23 hours later.


> Then tried to set the date manually with hwclock but no joy.

Please detail "no joy":
Does hwclock show the future time after rebooting if you have set it to
the right time before rebooting ?
(Or is it only the system clock which hops ahead ?)
Does hwclock get changed to the future time without rebooting ?


> Removing FvwmScript which I can't open to edit removes the clock from
> the FVWM taskbar,

Does this solve the problem with the future time ?


> And haven't tried to
> but Gkrellm is now using the same time?

(I don't understand this statement. Maybe it's important for finding the
explanation.)


> It would appear to be an fvwm problem

The fast running CPU might be related to poor handling of weird times
by FvwmScript.

But for now i doubt that fvwm sets the system date on its own.


Have a nice day :)

Thomas