I’ve rewritten cpumon from Seiichi SATO to send the percent CPU values via SendString to Fvwm-script. It sends the following string every second:FvwmCommand "SendToModule $[fvwm_script]/FvwmScript-CPU SendString 1 1 <cpu value>%"If I use it alone in the script all works fine. But if I put xosview in a second widget the communication to the FvwmCommand FIFO will gone after a while (10 or 15 seconds later)
Here’s the script:[code]WindowTitle {FvwmScript-CPU}
WindowSize 64 46
Widget 1
Property
Size 64 14
Position 0 32
Colorset 21
Font “xft:Arial:pixelsize=12”
Type ItemDraw
Flags NoReliefString
Main
Case message of
1 :
Begin
Set $cpu = (LastString)
ChangeTitle 1 $cpu
End
End
Widget 2
Property
Size 64 30
Position 0 0
Type SwallowExec
Title {xosview}
Value 0
SwallowExec {exec xosview -title cpumon +cpu &}
End
[/code]The error in .xsession-errors:No such file or directory FvwmCommand error in opening message fifo
This message repeats every second (the time cpumon sends the string to the script).I think the problem is related to the locking mechanism of the FvwmCommand FIFO cause other scripts sending also strings over this FIFO.
I’ve red in the FvwmCommand help that I can use an alternative FIFO with -S. My questions:
Do I need a second FvwmCommandS module loaded via startup?
If so, is it correct to write:+ I module FvwmCommandS <alternative_name>3)If 2) is correct cpumon should send then this:FvwmCommand -S <alternative_name> "SendToModule $[fvwm_script]/FvwmScript-CPU SendString 1 1 <cpu value>%"
Another question is:
To find out the real problem the FvwmCommand help says to use -m in the FvwmCommand line. But if I send thisFvwmCommand -mi3 | grep 'iconify'over the shell or the FvwmConsole for testing I get the following errors:
shell:No such file or directory FvwmCommand error in opening message fifo Fvwm-Console:[FVWM][__execute_function]: <<ERROR>> No such command 'FvwmCommand'But FvwmCommandS module is running:tf 13444 20670 0 01:43 ? 00:00:00 /usr/libexec/fvwm/2.5.22/FvwmCommandS 11 4 none 0 8
Could anybody help me
How can I restart FvwmCommandS? As I restart Fvwm the FIFO files ${FVWM_USERDIR}/FvwmCommand-${DISPLAY} will be created and it works only once … Have I kill the old FvwmCommandS process before?
Can I set FvwmCommandS with extra parameters like -m for monitoring?
I’ve fixed the FvwmCommand issue more or less now. The bottom line was that two processes got in the way of each other:
the mountcheck shell script running periodically via cron every minute (changes the mount/unmount icons of the device buttons)
the cpumon executable sending the cpu percent string every second to the Fvwm script.
I am starting for the mountcheck script its own FvwmCommand server in the StartFunction:+ I module FvwmCommandS mountcheck
and adding to the FvwmCommandline in the mountcheck.sh the -f parameter (example for the usb device): FvwmCommand -f mountcheck "SendToModule MountBar ChangeButton "U" Icon usbpendrive_mount2.svg:$[inactive_icon_pixel]x$[inactive_icon_pixel]"
I know that only one FvwmCommandS is needed normally (as Thomas said) but now all works well excepted if I restart Fvwm. Then two pipe queues are created in the $[FVWM_USERDIR] and sometimes - not always - the second server (FvwmCommandS mountcheck) lost the connections and the sh** error messageNo such file or directory FvwmCommand error in opening message fifo occurs in the .xsession-errors again.
But until I find a better solution I have to live with it
Well, I guess a solution would be to just have a script that periodically checks your logs for the error you get (since it occurs that frequently tail -n 1 should do) and then either use yet another FvwmCommand instance or one that keeps running to restart the faulty one.
Thanks for this hint, but I’ve dropped back to the standard. My main problem was to get two buttons among each other - first xosview to show cpu usage and second the percent value. This doesn’t work in one script. I’ve tried many issues without success. Then I tried it with container. And now It works 8): *DockApps: ($[cpumon_width]x$[sunken_bar_height]+$[cpumon_start_x]+$[cpumon_start_y], Container(Frame 0))
*DockApps: (1x1, Swallow(UseOld,NoKill) "FvwmScript-Cpumon" `FvwmScript $[fvwm_script]/FvwmScript-Cpumon`)
*DockApps: (1x1, Swallow(UseOld,NoKill) "FvwmScript-CPU-value" `FvwmScript $[fvwm_script]/FvwmScript-CPU-value`)
*DockApps: (End)I’ve splitted the first script into two and now - no FIFO errors after restart.