Set XDG_SESSION_DESKTOP

This commit is contained in:
Jeremy Soller 2024-06-05 11:05:11 -06:00
parent faf6d33aa8
commit e5d859a902
No known key found for this signature in database
GPG key ID: D02FD439211AF56F

View file

@ -228,6 +228,9 @@ pub fn main() -> Result<(), Box<dyn Error>> {
if let Some(desktop_names) = entry.section("Desktop Entry").attr("DesktopNames") { if let Some(desktop_names) = entry.section("Desktop Entry").attr("DesktopNames") {
env.push(format!("XDG_CURRENT_DESKTOP={desktop_names}")); env.push(format!("XDG_CURRENT_DESKTOP={desktop_names}"));
if let Some(name) = desktop_names.split(':').next() {
env.push(format!("XDG_SESSION_DESKTOP={name}"));
}
} }
// Session exec may contain environmental variables // Session exec may contain environmental variables