Saturday, September 8, 2012

Re: Setting WM_CLASS

On 08/09/12 23:02, Benjamin R. Haskell wrote:
> On Sat, 8 Sep 2012, Marco wrote:
>
>> Hi,
>>
>> is it possible to set the WM_CLASS of gVim to a custom value?
>
> If you're using a GTK version of gvim, you should be able to pass the
> '--class' commandline argument.
>
> e.g.:
>
> $ gvim --class yay
> $ xprop WM_CLASS
> ## ...then click on the window...
> WM_CLASS(STRING) = "gvim", "yay"
>
>
> Not sure this is documented anywhere. Found it by source-diving.
> There's a large set of:
>
> /* Arguments handled by GTK (and GNOME) internally. */
>
> starting at line 333 of src/gui_gtk_x11.c
>

It is not documented in the Vim help AFAICT. But looking down that list
suggests (and experiment shows) that typing

vim -?

at a Unix-like shell prompt will give the help for GTK and GNOME
command-line arguments if your "vim" binary was compiled with GNOME GUI
support. However Vim still starts the editor in that case, so

vim -? -cq

is better. You will still get an E852 error and a hit-Enter prompt after
the help; just hit Enter to go back to the shell prompt.

Or else,

vim --help
or
vim --help |less

will give _both_ the Vim command-line help and the GTK/GNOME
command-line help (if compiled-in). That's quite a lot of console
output, hence the |less redirection.


Best regards,
Tony.
--
Broad-mindedness, n.:
The result of flattening high-mindedness out.

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

No comments: