You are not logged in.
Hello again, Arch community!
Does anybody know if there is a way to make fvwm buttons show definite icons if definite statement is true, e.g.
if
battery_charged = 1
then icon batt.green.png
else if
battery_charged = 0
then icon batt.red
etc.
I can write the script which would return the icon name, but how do I make it interact with FvwmButtons?
//Would be really really great together with shaped icons and conky: 'live' desktop with rather useful buttons.
Last edited by tartan (2010-04-15 16:35:57)
Offline
Hello again, Arch community!
Does anybody know if there is a way to make fvwm buttons show definite icons if definite statement is true, e.g.
if
battery_charged = 1
then icon batt.green.png
else if
battery_charged = 0
then icon batt.redetc.
I can write the script which would return the icon name, but how do I make it interact with FvwmButtons?
You use the SendToModule command.
Let's say you have a FvwmButtons such as this:
*FvwmB: (1x1, Id "SomeButton", Title "Hello", Icon foo.png)
By giving it an id, you are then able to refer to it with SendToModule and change some of its properties. So in your example, your script would have to do something like this (again, contrived):
if charging then:
FvwmCommand 'SendToModule FvwmB Icon charging.png, Title "Charging"'
else:
FvwmCommand 'SendToModule FvwmB Icon charged.png, Title "Charged"'
endif
The important part here are the FvwmCommand lines. In order for this external script to use that, you will need to have:
AddToFunc StartFunction I Module FvwmCommandS
... in your .fvwm2rc file. Then the socket that FvwmCommand uses to talk to FVWM is present.
-- Thomas Adam
Offline
Thank you, Adam!
Thank you!
I keep thinking fvwm is more a library or a programming language than a wm. Damn mighty.
I will share the result if it would worth it.
Offline