mirror of
https://github.com/YaLTeR/niri.git
synced 2024-09-11 12:35:58 +03:00
Set XDG_CURRENT_DESKTOP and XDG_SESSION_TYPE from niri itself
This commit is contained in:
parent
f0a5e9c933
commit
9f1b4ee299
@ -20,12 +20,6 @@ fi
|
||||
# Reset failed state of all user units.
|
||||
systemctl --user reset-failed
|
||||
|
||||
# Set the current desktop for xdg-desktop-portal.
|
||||
export XDG_CURRENT_DESKTOP=niri
|
||||
|
||||
# Ensure the session type is set to Wayland for xdg-autostart apps.
|
||||
export XDG_SESSION_TYPE=wayland
|
||||
|
||||
# Import the login manager environment.
|
||||
systemctl --user import-environment
|
||||
|
||||
|
13
src/main.rs
13
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([
|
||||
|
Loading…
Reference in New Issue
Block a user