Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Option to set window name #65

Closed
rudism opened this issue Jan 5, 2017 · 4 comments · Fixed by #67
Closed

Option to set window name #65

rudism opened this issue Jan 5, 2017 · 4 comments · Fixed by #67

Comments

@rudism
Copy link
Contributor

rudism commented Jan 5, 2017

xterm, for example, supports launching with -name SomeWindowName to set the window title to a custom string. Some window managers allow for custom rules to be applied to different windows depending on their title, so being able to set the window title differently depending on how the terminal was launched can be very useful.

@jwilm
Copy link
Contributor

jwilm commented Jan 5, 2017

Sounds completely reasonable

@Munksgaard
Copy link

I don't believe that the --title argument as implemented in alacritty corresponds correctly to the -name argument that xterm supports. Specifically, xterm's -name SomeWindowName sets the WM_CLASS property of the window, whereas alacritty's --title SomeWindowName sets WM_NAME, which is not the same.

Compare the two following examples. First is an example xprop output from xterm -name SomeWindowName window:

_NET_WM_STATE(ATOM) =
WM_STATE(WM_STATE):
		window state: Normal
		icon window: 0x0
WM_PROTOCOLS(ATOM): protocols  WM_DELETE_WINDOW
_NET_WM_PID(CARDINAL) = 32716
WM_CLIENT_LEADER(WINDOW): window id # 0x3c00024
WM_LOCALE_NAME(STRING) = "en_US.UTF-8"
WM_CLASS(STRING) = "SomeWindowName", "XTerm"
WM_HINTS(WM_HINTS):
		Client accepts input or input focus: True
		Initial state is Normal State.
		bitmap id # to use for icon: 0x3c00030
		bitmap id # of mask for icon: 0x3c00032
WM_NORMAL_HINTS(WM_SIZE_HINTS):
		program specified size: 484 by 316
		program specified minimum size: 10 by 17
		program specified resize increment: 6 by 13
		program specified base size: 4 by 4
		window gravity: NorthWest
WM_CLIENT_MACHINE(STRING) = "turing"
WM_COMMAND(STRING) = { "xterm", "-name", "SomeWindowName" }
WM_ICON_NAME(STRING) = "munksgaard@turing: ~"
WM_NAME(STRING) = "munksgaard@turing: ~"

Then an example xprop output from alacritty --title SomeWindowName:

WM_HINTS(WM_HINTS):
WM_LOCALE_NAME(STRING) = "en_US.UTF-8"
_NET_WM_STATE(ATOM) =
WM_STATE(WM_STATE):
		window state: Normal
		icon window: 0x0
WM_PROTOCOLS(ATOM): protocols  WM_DELETE_WINDOW
_NET_WM_ICON(CARDINAL) =
WM_NORMAL_HINTS(WM_SIZE_HINTS):
		program specified size: 1024 by 768
WM_CLIENT_MACHINE(STRING) = "turing"
_NET_WM_PID(CARDINAL) = 32364
WM_CLASS(STRING) = "Alacritty", "Alacritty"
XdndAware(ATOM) = BITMAP
_MOTIF_WM_HINTS(_MOTIF_WM_HINTS) = 0x2, 0x0, 0x1, 0x0, 0x0
_NET_WM_NAME(UTF8_STRING) = "SomeWindowName"
WM_NAME(STRING) = "SomeWindowName"

I rely on the WM_CLASS for my xmonad config (it's required by scratchpad), so it would be nice to have the title flag fixed, or an alternative flag added that sets the WM_CLASS.

@Munksgaard
Copy link

Ah, I see that the functionality I'm requesting has already been implemented in the form of a --class argument. Nevermind me!

@ixzh
Copy link

ixzh commented Sep 20, 2021

I rely on the WM_CLASS for my xmonad config

in gridselect, all alacritty terminal windows are called Alacritty, as most terminal apps don't change WM_NAME. is there a way to force it so I can differentiate various Alacritty windows?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging a pull request may close this issue.

4 participants