feat(launch): start desktops without the login screen
The greeter only starts the session its own selector points at, so an installed environment with no open session could not be reached from the tool. Starting one needs a one-shot autologin drop-in, a display manager restart and a guaranteed cleanup, all as root: keep that in a small pkexec helper so the CLI and the GTK window stay unprivileged.
This commit is contained in:
11 files changed
+709
-38
No files matched your search
+24
-5
@@ -32,15 +32,34 @@ bool targetInstalled(const std::string& target) {
|
||||
|
||||
const std::vector<DesktopProfile>& supportedDesktops() {
|
||||
static const std::vector<DesktopProfile> desktops = {
|
||||
{"xfce", "XFCE", {"xfce4"}, {"xfce", "xfce4"}},
|
||||
{"gnome", "GNOME", {"gnome"}, {"gnome"}},
|
||||
{"plasma", "KDE Plasma", {"plasma-meta"}, {"kde", "plasma"}},
|
||||
{"hyprland", "Hyprland", {"hyprland"}, {"hyprland"}},
|
||||
{"i3", "i3", {"i3"}, {"i3"}},
|
||||
{"xfce", "XFCE", {"xfce4"}, {"xfce", "xfce4"}, {"xfce", "xfce4-session"}},
|
||||
{"gnome", "GNOME", {"gnome"}, {"gnome"}, {"gnome", "gnome-xorg"}},
|
||||
// Plasma 6 renamed its session files; the Wayland entry comes first.
|
||||
{"plasma",
|
||||
"KDE Plasma",
|
||||
{"plasma-meta"},
|
||||
{"kde", "plasma"},
|
||||
{"plasma", "plasmawayland", "plasmax11", "plasmadesktop"}},
|
||||
{"hyprland", "Hyprland", {"hyprland"}, {"hyprland"}, {"hyprland"}},
|
||||
{"i3", "i3", {"i3"}, {"i3"}, {"i3"}},
|
||||
};
|
||||
return desktops;
|
||||
}
|
||||
|
||||
const DesktopProfile* findDesktopProfile(const std::string& name) {
|
||||
const std::string wanted = lower(name);
|
||||
if (wanted.empty()) {
|
||||
return nullptr;
|
||||
}
|
||||
for (const DesktopProfile& profile : supportedDesktops()) {
|
||||
if (lower(profile.id) == wanted || lower(profile.name) == wanted ||
|
||||
lower(profile.name).rfind(wanted, 0) == 0) {
|
||||
return &profile;
|
||||
}
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
bool isDesktopInstalled(const DesktopProfile& profile) {
|
||||
return std::all_of(profile.packages.begin(), profile.packages.end(), targetInstalled);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user