use dbus-run-session and set XDG_CURRENT_DESKTOP
This commit is contained in:
parent
df9f2092e8
commit
1b13865ea0
2 changed files with 28 additions and 20 deletions
1
debian/control
vendored
1
debian/control
vendored
|
|
@ -21,6 +21,7 @@ Depends:
|
||||||
bash,
|
bash,
|
||||||
cosmic-comp,
|
cosmic-comp,
|
||||||
cosmic-greeter-daemon,
|
cosmic-greeter-daemon,
|
||||||
|
dbus,
|
||||||
greetd,
|
greetd,
|
||||||
${misc:Depends},
|
${misc:Depends},
|
||||||
${shlibs:Depends}
|
${shlibs:Depends}
|
||||||
|
|
|
||||||
|
|
@ -133,10 +133,9 @@ pub fn main() -> Result<(), Box<dyn Error>> {
|
||||||
.map(|dir| (dir, SessionType::Wayland))
|
.map(|dir| (dir, SessionType::Wayland))
|
||||||
.chain(
|
.chain(
|
||||||
xdg::BaseDirectories::with_prefix("xsessions")
|
xdg::BaseDirectories::with_prefix("xsessions")
|
||||||
.map_or(
|
.map_or(vec![PathBuf::from("/usr/share/xsessions")], |xdg_dirs| {
|
||||||
vec![PathBuf::from("/usr/share/xsessions")],
|
xdg_dirs.get_data_dirs()
|
||||||
|xdg_dirs| xdg_dirs.get_data_dirs(),
|
})
|
||||||
)
|
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.map(|dir| (dir, SessionType::X11)),
|
.map(|dir| (dir, SessionType::X11)),
|
||||||
);
|
);
|
||||||
|
|
@ -207,6 +206,8 @@ pub fn main() -> Result<(), Box<dyn Error>> {
|
||||||
SessionType::X11 => {
|
SessionType::X11 => {
|
||||||
//TODO: xinit may be better, but more complicated to set up
|
//TODO: xinit may be better, but more complicated to set up
|
||||||
vec![
|
vec![
|
||||||
|
"dbus-run-session".to_string(),
|
||||||
|
"--".to_string(),
|
||||||
"startx".to_string(),
|
"startx".to_string(),
|
||||||
"/usr/bin/env".to_string(),
|
"/usr/bin/env".to_string(),
|
||||||
"XDG_SESSION_TYPE=x11".to_string(),
|
"XDG_SESSION_TYPE=x11".to_string(),
|
||||||
|
|
@ -214,12 +215,18 @@ pub fn main() -> Result<(), Box<dyn Error>> {
|
||||||
}
|
}
|
||||||
SessionType::Wayland => {
|
SessionType::Wayland => {
|
||||||
vec![
|
vec![
|
||||||
|
"dbus-run-session".to_string(),
|
||||||
|
"--".to_string(),
|
||||||
"/usr/bin/env".to_string(),
|
"/usr/bin/env".to_string(),
|
||||||
"XDG_SESSION_TYPE=wayland".to_string(),
|
"XDG_SESSION_TYPE=wayland".to_string(),
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if let Some(desktop_names) = entry.section("Desktop Entry").attr("DesktopNames") {
|
||||||
|
command.push(format!("XDG_CURRENT_DESKTOP={desktop_names}"));
|
||||||
|
}
|
||||||
|
|
||||||
match shlex::split(exec) {
|
match shlex::split(exec) {
|
||||||
Some(args) => {
|
Some(args) => {
|
||||||
for arg in args {
|
for arg in args {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue