Hi, I wonder if someone might be able to help me with a function i'm trying to create.

I have two fvwmbuttons instances, a taskbar at the top of screen and a dock at the bottom. I don't really want to use both at the same time but I do want to be able to switch between the two.

So, I would like the function to stop the currently open instance and start the other and have that bound to a single key stroke or menu option.

What I've got so far is two functions: one that checks the top taskbar, stops it if it's open and then opens the bottom dock; the other function does the same but for the other fvwmbuttons dock. Here they are:

DestroyFunc OpenDock
AddToFunc   OpenDock
+ I All (Panel) Close
+ I TestRc (NoMatch) KillModule Panel
+ I TestRc (Match) Module FvwmButtons Dock -g +300-0

DestroyFunc OpenPanel
AddToFunc   OpenPanel
+ I All (Dock) Close
+ I TestRc (NoMatch) KillModule Dock
+ I TestRc (Match) Module FvwmButtons Panel -g $[vp.width]x24+0+0

The problem with this approach is I have to have them bound to separate key strokes. When I first create the keybindings it's possible I might forget which one is which and so if I press the wrong one, it doesn't handle that well. I'd much prefer it to be bound to a single key stroke and have it check which instance is open, then close the open fvwmbuttons and start the other, as I mentioned.

I'd be very grateful if anyone could offer a solution or some help.

Best wishes, Jamie.

Reply via email to