You are not logged in.

#1 2024-09-11 15:20:41

nschloe
Member
Registered: 2023-06-28
Posts: 11

[sway] How to set WLR_RENDERER env variable before starting sway?

I'm using SDDM as a display manager, starting my sway environment. Before starting sway, I'd like to set WLR_RENDERER="vulkan". I don't know how to do this right now. Any hints?

Offline

#2 2024-09-11 16:03:22

jl2
Member
From: 47° 18' N 8° 34' E
Registered: 2022-06-01
Posts: 566
Website

Re: [sway] How to set WLR_RENDERER env variable before starting sway?

You can try doing the steps described here on /usr/share/wayland-sessions/sway.desktop


Why I run Arch? To "BTW I run Arch" the guy one grade younger.
And to let my siblings and cousins laugh at Arsch Linux...

Offline

#3 2024-09-11 16:33:43

nschloe
Member
Registered: 2023-06-28
Posts: 11

Re: [sway] How to set WLR_RENDERER env variable before starting sway?

Are you sure that this sets environment variables _before_ starting the application, not within the application?

Offline

#4 2024-09-11 16:53:33

jl2
Member
From: 47° 18' N 8° 34' E
Registered: 2022-06-01
Posts: 566
Website

Re: [sway] How to set WLR_RENDERER env variable before starting sway?

Yes, it will do it before.

Last edited by jl2 (2024-09-11 16:53:52)


Why I run Arch? To "BTW I run Arch" the guy one grade younger.
And to let my siblings and cousins laugh at Arsch Linux...

Offline

#5 2024-09-11 17:01:43

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 23,880

Re: [sway] How to set WLR_RENDERER env variable before starting sway?

You could just test it, but generally, environment variables are always defined before running the thing that reacts to them, so yes using that adjustment will pass that environment specifically to the started wayland session assuming you're actually using the desktop/session file (which SDDM will)

General further information on environment variables and how they work can be found in: https://wiki.archlinux.org/title/Environment_variables -- with a couple of suggestions for global spots that are basically guaranteed to be parsed when you log in, before something else is started

Offline

#6 2024-09-11 20:47:42

nschloe
Member
Registered: 2023-06-28
Posts: 11

Re: [sway] How to set WLR_RENDERER env variable before starting sway?

Indeed, I put

```
Exec=env WLR_RENDERER=vulkan sway
```

into `/usr/share/wayland-sessions/sway.desktop` and sway does indeed use vulkan to render.

Offline

#7 2024-09-13 02:36:37

once
Member
From: Taiwan
Registered: 2006-09-12
Posts: 270

Re: [sway] How to set WLR_RENDERER env variable before starting sway?

set  WLR_RENDERER=vulkan to /etc/environment

Offline

Board footer

Powered by FluxBB