2024-02-20 21:16:07 +01:00
---
weight: 15
title: Environment variables
---
2024-11-17 18:24:12 +01:00
{{< callout type = info > }}
[uwsm ](../../Useful-Utilities/Systemd-start ) users should avoid placing environment variables in the `hyprland.conf` file. Instead, use `~/.config/uwsm/env` for theming, xcursor, nvidia and toolkit variables, and `~/.config/uwsm/env-hyprland` for `HYPR*` and `AQ_*` variables. The format is `export KEY=VAL` .
```plain
export XCURSOR_SIZE=24
```
See [uwsm readme ](https://github.com/Vladimir-csp/uwsm?tab=readme-ov-file#4-environments-and-shell-profile ) for additional information.
{{< / callout > }}
2024-02-20 21:16:07 +01:00
You can use the `env` keyword to set environment variables prior to the
initialization of the Display Server, e.g.:
2023-03-05 14:43:30 +01:00
```ini
env = GTK_THEME,Nord
```
2022-10-23 16:26:52 +02:00
2024-02-20 21:16:07 +01:00
{{< callout > }}
Hyprland puts the raw string to the envvar with the `env` keyword. You should
_not_ add quotes around the values.
2023-03-17 17:27:13 +01:00
e.g.:
2024-02-20 21:16:07 +01:00
2023-03-17 17:27:13 +01:00
```ini
env = QT_QPA_PLATFORM,wayland
```
2024-02-20 21:16:07 +01:00
and _**NOT**_
2023-03-17 17:27:13 +01:00
```ini
env = QT_QPA_PLATFORM,"wayland"
```
2024-02-20 21:16:07 +01:00
{{< / callout > }}
Please avoid putting those environment variables in /etc/environment. That will
cause all sessions (including Xorg ones) to pick up your wayland-specific
environment on traditional Linux distros.
## Hyprland Environment Variables
2022-10-23 16:26:52 +02:00
2024-07-21 13:11:03 +02:00
- `HYPRLAND_TRACE=1` - Enables more verbose logging.
2023-12-21 22:29:15 +01:00
- `HYPRLAND_NO_RT=1` - Disables realtime priority setting by Hyprland.
- `HYPRLAND_NO_SD_NOTIFY=1` - If systemd, disables the `sd_notify` calls.
2024-08-16 18:36:16 +02:00
- `HYPRLAND_NO_SD_VARS=1` - Disables management of variables in systemd and dbus activation environments.
2024-09-24 02:04:31 +02:00
- `HYPRLAND_CONFIG` - Specifies where you want your Hyprland configuration.
2023-12-21 22:29:15 +01:00
2024-09-14 16:45:48 +02:00
## Aquamarine Environment Variables <!-- ref https://github.com/hyprwm/aquamarine/blob/main/docs/env.md -->
- `AQ_TRACE=1` - Enables more verbose logging.
- `AQ_DRM_DEVICES=` - Set an explicit list of DRM devices (GPUs) to use. It's a colon-separated list of paths, with the first being the primary.
E.g. `/dev/dri/card1:/dev/dri/card0`
- `AQ_MGPU_NO_EXPLICIT=1` - Disables explicit syncing on mgpu buffers
- `AQ_NO_MODIFIERS=1` - Disables modifiers for DRM buffers
2024-02-20 21:16:07 +01:00
## Toolkit Backend Variables
2024-04-26 13:05:28 +02:00
- `env = GDK_BACKEND,wayland,x11,*` - GTK: Use wayland if available. If not: try x11, then any other GDK backend.
2024-03-30 23:48:01 +01:00
- `env = QT_QPA_PLATFORM,wayland;xcb` - Qt: Use wayland if available, fall back to
2024-02-20 21:16:07 +01:00
x11 if not.
2024-03-30 23:48:01 +01:00
- `env = SDL_VIDEODRIVER,wayland` - Run SDL2 applications on Wayland. Remove or set to
2024-02-20 21:16:07 +01:00
`x11` if games that provide older versions of SDL cause compatibility issues
2024-03-30 23:48:01 +01:00
- `env = CLUTTER_BACKEND,wayland` - Clutter package already has wayland enabled, this
2024-02-20 21:16:07 +01:00
variable will force Clutter applications to try and use the Wayland backend
2023-03-26 20:56:34 +02:00
2024-02-20 21:16:07 +01:00
## XDG Specifications
2022-10-23 16:26:52 +02:00
2024-03-30 23:48:01 +01:00
- `env = XDG_CURRENT_DESKTOP,Hyprland`
- `env = XDG_SESSION_TYPE,wayland`
- `env = XDG_SESSION_DESKTOP,Hyprland`
2022-10-23 16:26:52 +02:00
2024-02-20 21:16:07 +01:00
XDG specific environment variables are often detected through portals and
applications that may set those for you, however it is not a bad idea to set
them explicitly.
2022-10-23 16:26:52 +02:00
2024-09-30 02:01:15 +02:00
If your [desktop portal ](https://wiki.archlinux.org/title/XDG_Desktop_Portal ) is malfunctioning for seemingly
no reason (no errors), it's likely your XDG env isn't set correctly.
2024-11-11 15:53:20 +01:00
{{< callout type = info > }}
2024-11-11 19:31:46 +01:00
[uwsm ](../../Useful-Utilities/Systemd-start ) users don't need to explicitly set XDG environment variables, as uwsm sets them, automatically.
2024-11-11 15:53:20 +01:00
{{< / callout > }}
2024-02-20 21:16:07 +01:00
## Qt Variables
2022-10-23 16:26:52 +02:00
2024-03-30 23:48:01 +01:00
- `env = QT_AUTO_SCREEN_SCALE_FACTOR,1` -
2024-02-20 21:16:07 +01:00
[(From the Qt documentation) ](https://doc.qt.io/qt-5/highdpi.html ) enables
automatic scaling, based on the monitor's pixel density
2024-03-30 23:48:01 +01:00
- `env = QT_QPA_PLATFORM,wayland;xcb` - Tell Qt applications to use the Wayland
2024-02-20 21:16:07 +01:00
backend, and fall back to x11 if Wayland is unavailable
2024-03-30 23:48:01 +01:00
- `env = QT_WAYLAND_DISABLE_WINDOWDECORATION,1` - Disables window decorations on Qt
2024-02-20 21:16:07 +01:00
applications
2024-03-30 23:48:01 +01:00
- `env = QT_QPA_PLATFORMTHEME,qt5ct` - Tells Qt based applications to pick your theme
2024-02-20 21:16:07 +01:00
from qt5ct, use with Kvantum.
2022-10-23 16:26:52 +02:00
2024-02-20 21:16:07 +01:00
## NVIDIA Specific
2022-10-23 16:26:52 +02:00
To force GBM as a backend, set the following environment variables:
2024-03-30 23:48:01 +01:00
- `env = GBM_BACKEND,nvidia-drm`
- `env = __GLX_VENDOR_LIBRARY_NAME,nvidia`
2022-10-23 16:26:52 +02:00
2024-02-20 21:16:07 +01:00
> See
> [Archwiki Wayland Page](https://wiki.archlinux.org/title/Wayland#Requirements)
> for more details on those variables.
2022-10-23 16:26:52 +02:00
2024-03-30 23:48:01 +01:00
- `env = LIBVA_DRIVER_NAME,nvidia` - Hardware acceleration on NVIDIA GPUs
2022-10-23 16:26:52 +02:00
2024-02-20 21:16:07 +01:00
> See
> [Archwiki Hardware Acceleration Page](https://wiki.archlinux.org/title/Hardware_video_acceleration)
2022-10-23 16:26:52 +02:00
> for details and necessary values before setting this variable.
2024-02-20 21:16:07 +01:00
- `__GL_GSYNC_ALLOWED` - Controls if G-Sync capable monitors should use Variable
Refresh Rate (VRR)
2022-10-23 16:26:52 +02:00
2024-02-20 21:16:07 +01:00
> See
> [Nvidia Documentation](https://download.nvidia.com/XFree86/Linux-32bit-ARM/375.26/README/openglenvvariables.html)
> for details.
2022-10-23 16:26:52 +02:00
2024-02-20 21:16:07 +01:00
- `__GL_VRR_ALLOWED` - Controls if Adaptive Sync should be used. Recommended to
set as "0" to avoid having problems on some games.
2022-10-23 16:26:52 +02:00
2024-07-21 13:11:03 +02:00
- `env = AQ_NO_ATOMIC,1` - use legacy DRM interface instead of atomic mode
setting. **NOT** recommended.
2022-10-23 16:26:52 +02:00
2024-02-20 21:16:07 +01:00
## Theming Related Variables
2022-10-23 16:26:52 +02:00
2024-02-20 21:16:07 +01:00
- `GTK_THEME` - Set a GTK theme manually, for those who want to avoid appearance
tools such as lxappearance or nwg-look
- `XCURSOR_THEME` - Set your cursor theme. The theme needs to be installed and
readable by your user.
2024-03-17 13:44:39 +01:00
- `XCURSOR_SIZE` - Set cursor size. See [here ](../../FAQ/ ) for why you might
2024-02-20 21:16:07 +01:00
want this variable set.