[SOLVED] Customizing taskbar buttons: clolors and icons

This is a follow up to my post

viewtopic.php?f=6&t=3087&p=14627#p14627

but since it’s an extension I’m starting a new thread.

It’s also a variant of an ealier post of mine,

viewtopic.php?f=33&t=2966,

but I know about more now what to ask for.

Thanks to Thomas’s help with the first post, I can now assign a custom icon to the taskbar button assocated with certain programs, like xpdf:

Style "Xpdf" EWMHMiniIconOverride, Icon Nop , MiniIcon /home/simon/.fvwm/png/pdf_16icon.png .

But I can only do this for programs like Xpdf which have predesignated classes.

There are certain commands, like vi and matlab, which I would like to call from the command line within an Xterm, for which I would like to do something analogous, i.e., display the mini-icon for matlab in the associated task bar button. But since the class of the window remains Xterm, independent of my command, I can’t assign a custom icon associated with the class of the command that I call.

Obviously, I could open a new xterm each time i call matlab, e.g.,

xterm -hold -class myMatlab  -e "/usr/local/MATLAB/R2015a/bin/matlab -nosplash -nodesktop" &

and write a style command for myMatlab with the icon I want.

But I’d prefer to avoid opening a new xterm each time.

The other thing I’d like to do is set the color of the taskbar button, but cannot for the life of me figure out how to do that.

Thanks very much for any advice.

To change the style of one specific window, rather than collectively all that match the style name, use the WindowStyle command in connection with a selection specification, e.g. like this]
Current () WindowStyle MiniIcon /home/simon/.fvwm/png/pdf_16icon.png
[/code]
FvwmCommand will help you to perform this from the shell, see »man FvwmCommand«: Launch the module FvwmCommandS (with S) from within your config file, maybe in the StartFunction or InitFunction, then FVWM will be willing to obey all commands it receives from a shell invoking FvwmCommand. So you should start xpdf like this]
FvwmCommand 'Current (
) WindowStyle MiniIcon /home/simon/.fvwm/png/pdf_16icon.png’ && xpdf
[/code](Of course, the window in which you type is inevitably the “current” window.)

Perfect, works beautifully. Last question. Could I also use this kind of command to change the color of the task bar button associated with this particular window? I can’t figure out the FvwmCommand that would do this.

I don’t know FvwmTaskBar, but after a quick look at the man page (which you have had too, I’m sure), I think this isn’t possible.
You talk about the area besides the mini icon!? (To change the colour of the mini icon, you must edit the PNG file, of course.)
As far as I understand, the colour carries status information (focused/unfocused etc.), so an individual change is not intended.

Thanks Tronar, I guess you’re right. Too bad, would have been very helpful.

I forgot two small details:

a) The command line I showed above will not change the mini icon of the xpdf window but rather the mini icon of the terminal in which you start xpdf, right? This makes sense for Matlab, but not for xpdf. For xpdf you probably want to use the “normal” way with the Style command.

b) After exiting Matlab you probably want to undo the change using “DestroyWindowStyle”]
FvwmCommand ‘Current () WindowStyle MiniIcon /home/simon/.fvwm/png/matlab.png’; matlab; FvwmCommand 'Current () DestroyWindowStyle’
[/code]You can put this in a simple shell alias or a shell function.

Thanks, Tronar, DestroyWindowsStyle is very useful.

I’d love to mark this thread as SOLVED, but for some reason I’m unable (on every forum) to figure out how to do this.

Go to your first post, klick on ‘Edit’ and set [SOLVED] infront of the subject.

– Thomas –