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.
31 lines
1018 B
C++
31 lines
1018 B
C++
#pragma once
|
|
|
|
#include <string>
|
|
#include <vector>
|
|
|
|
namespace fws {
|
|
|
|
struct DesktopProfile {
|
|
std::string id;
|
|
std::string name;
|
|
std::vector<std::string> packages; // pacman targets (packages or groups)
|
|
std::vector<std::string> sessionNames; // logind Desktop values to match
|
|
std::vector<std::string> sessionFiles; // installed .desktop stems, most wanted first
|
|
};
|
|
|
|
const std::vector<DesktopProfile>& supportedDesktops();
|
|
|
|
// Looks a profile up by id or name (case-insensitive), nullptr when unknown.
|
|
const DesktopProfile* findDesktopProfile(const std::string& name);
|
|
|
|
// True when every pacman target of the profile is installed.
|
|
bool isDesktopInstalled(const DesktopProfile& profile);
|
|
|
|
// Finds a logind session for the profile, preferring the one on the seat.
|
|
bool findActiveSession(const DesktopProfile& profile, std::string& sessionId);
|
|
|
|
// pkexec + pacman command used to install the profile.
|
|
std::vector<std::string> installArguments(const DesktopProfile& profile);
|
|
|
|
} // namespace fws
|