You are not logged in.

#1 2023-05-07 06:41:35

zhaose
Member
Registered: 2022-05-05
Posts: 11

Ways to set different environment variables for Xwayland under Wayland

Under wayland, GTK4 has some problems with the ibus input window position with GTK_IM_MOUDLE=ibus, which can be fixed by setting GTK_IM_MOUDLE=wayland, but this will make those applications running on Xwayland unable to launch, such as discord and other electron applications. So I am wondering are there some methods to set GTK_IM_MOUDLE=ibus only for those applications using Xwayland while GTK_IM_MOUDLE=wayland is set globally?

Last edited by zhaose (2023-05-07 06:49:15)

Offline

#2 2023-05-07 11:53:09

Lone_Wolf
Administrator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 15,256

Re: Ways to set different environment variables for Xwayland under Wayland

Maybe.

archwiki wrote:

XWayland is started via a compositor, so you should check the documentation for your chosen compositor for XWayland compatibility and instructions on how to start XWayland.

Which wayland compositor are you using ?


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.

clean chroot building not flexible enough ?
Try clean chroot manager by graysky

Offline

#3 2023-05-07 12:11:18

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,491
Website

Re: Ways to set different environment variables for Xwayland under Wayland

These are variables used by the clients, right?  So just set it in their environment, e.g.

GTK_IM_MOUDLE=ibus discord

"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#4 2023-05-07 12:48:48

zhaose
Member
Registered: 2022-05-05
Posts: 11

Re: Ways to set different environment variables for Xwayland under Wayland

Trilby wrote:

These are variables used by the clients, right?  So just set it in their environment, e.g.

GTK_IM_MOUDLE=ibus discord

Yeah that's a solution, but I am just wondering if there is a way to set variables for all xwayland applications rather than set it manually for each application.

Offline

#5 2023-05-07 12:50:08

zhaose
Member
Registered: 2022-05-05
Posts: 11

Re: Ways to set different environment variables for Xwayland under Wayland

Lone_Wolf wrote:

Maybe.

archwiki wrote:

XWayland is started via a compositor, so you should check the documentation for your chosen compositor for XWayland compatibility and instructions on how to start XWayland.

Which wayland compositor are you using ?

Mutter is the compositor for gnome.

Offline

#6 2023-05-07 12:52:17

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,491
Website

Re: Ways to set different environment variables for Xwayland under Wayland

No.  They don't share an environment.

GTK may have some trick for conditionally setting the IM_MODULE, but environment variables are set within an environment - hence the name.

But if you know which progams need this setting, what's wrong with setting it for each of them?


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#7 2023-05-07 13:09:26

zhaose
Member
Registered: 2022-05-05
Posts: 11

Re: Ways to set different environment variables for Xwayland under Wayland

Trilby wrote:

No.  They don't share an environment.

GTK may have some trick for conditionally setting the IM_MODULE, but environment variables are set within an environment - hence the name.

But if you know which progams need this setting, what's wrong with setting it for each of them?

I thought when setting a environment for a process, it will be inheritted by its child processes, so...

But it seems that xwayland is not acting as a parent on starting applications but acting just as a server to interact with the screen, I am now awared of that it's kind of impossible.

Offline

Board footer

Powered by FluxBB