aboutsummaryrefslogtreecommitdiff
path: root/src/main.rs
diff options
context:
space:
mode:
authorIvan Molodetskikh <yalterz@gmail.com>2024-02-20 13:40:09 +0400
committerIvan Molodetskikh <yalterz@gmail.com>2024-02-21 07:27:49 +0400
commit9f1b4ee2996bc75ba521e9d80f001c98e379b231 (patch)
tree6ba9e0837300e7e5415e4607efb7edebb47cbc88 /src/main.rs
parentf0a5e9c9332624aa7ea201c8c83f4f20b0a9775f (diff)
downloadniri-9f1b4ee2996bc75ba521e9d80f001c98e379b231.tar.gz
niri-9f1b4ee2996bc75ba521e9d80f001c98e379b231.tar.bz2
niri-9f1b4ee2996bc75ba521e9d80f001c98e379b231.zip
Set XDG_CURRENT_DESKTOP and XDG_SESSION_TYPE from niri itself
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/main.rs b/src/main.rs
index dc491cb8..275d747b 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -61,6 +61,11 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
debug!("running as a session but WAYLAND_DISPLAY is set, removing it");
env::remove_var("WAYLAND_DISPLAY");
}
+
+ // Set the current desktop for xdg-desktop-portal.
+ env::set_var("XDG_CURRENT_DESKTOP", "niri");
+ // Ensure the session type is set to Wayland for xdg-autostart and Qt apps.
+ env::set_var("XDG_SESSION_TYPE", "wayland");
}
let _client = tracy_client::Client::start();
@@ -236,7 +241,13 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
}
fn import_environment() {
- let variables = ["WAYLAND_DISPLAY", niri_ipc::SOCKET_PATH_ENV].join(" ");
+ let variables = [
+ "WAYLAND_DISPLAY",
+ "XDG_CURRENT_DESKTOP",
+ "XDG_SESSION_TYPE",
+ niri_ipc::SOCKET_PATH_ENV,
+ ]
+ .join(" ");
let rv = Command::new("/bin/sh")
.args([