dc69317ddf
- redbear-sessiond: add Manager.Inhibit (pipe FD), CanPowerOff/CanReboot/ CanSuspend/CanHibernate/CanHybridSleep/CanSleep (return na), PowerOff/ Reboot/Suspend stubs, GetSessionByPID, ListUsers, ListSeats, ListInhibitors, ActivateSession/LockSession/UnlockSession/TerminateSession - redbear-sessiond: add Session SetIdleHint, SetLockedHint, SetType, Terminate methods; wire PauseDevice/ResumeDevice/Lock/Unlock signal emission via SignalEmitter injection; add dynamic device enumeration scanning /scheme/drm/card* and /dev/input/event* at startup - redbear-sessiond: replace infinite pending() with stoppable shutdown via tokio watch channel + control socket shutdown command - redbear-upower: add Changed signal emission with 30s periodic polling and power state snapshot comparison - redbear-notifications: add ActionInvoked signal, expand capabilities to body + body-markup + actions - redbear-polkit, redbear-udisks: replace pending() with stoppable shutdown via signal handling + watch channel - Add redbear-statusnotifierwatcher: new session bus service implementing org.freedesktop.StatusNotifierWatcher for KDE system tray - Add D-Bus activation file for StatusNotifierWatcher - KWin session.cpp: try LogindSession before NoopSession fallback - Consolidate config profiles: remove obsolete redbear-desktop, redbear-kde, redbear-live-*, redbear-minimal-*, redbear-wayland configs; simplify to three supported targets (redbear-full, redbear-mini, redbear-grub) - Update DBUS-INTEGRATION-PLAN.md and DESKTOP-STACK-CURRENT-STATUS.md with Phase 3/4 fragility assessment, KWin readiness matrix, and completeness gap analysis
55 lines
1.3 KiB
Rust
55 lines
1.3 KiB
Rust
use std::sync::{Arc, RwLock};
|
|
|
|
#[derive(Clone, Debug)]
|
|
pub struct InhibitorEntry {
|
|
pub what: String,
|
|
pub who: String,
|
|
pub why: String,
|
|
pub mode: String,
|
|
pub pid: u32,
|
|
pub uid: u32,
|
|
}
|
|
|
|
#[derive(Clone, Debug)]
|
|
pub struct SessionRuntime {
|
|
pub session_id: String,
|
|
pub seat_id: String,
|
|
pub username: String,
|
|
pub uid: u32,
|
|
pub vt: u32,
|
|
pub leader: u32,
|
|
pub state: String,
|
|
pub active: bool,
|
|
pub preparing_for_shutdown: bool,
|
|
pub idle_hint: bool,
|
|
pub locked_hint: bool,
|
|
pub session_type: String,
|
|
pub inhibitors: Vec<InhibitorEntry>,
|
|
}
|
|
|
|
impl Default for SessionRuntime {
|
|
fn default() -> Self {
|
|
Self {
|
|
session_id: String::from("c1"),
|
|
seat_id: String::from("seat0"),
|
|
username: String::from("root"),
|
|
uid: 0,
|
|
vt: 3,
|
|
leader: std::process::id(),
|
|
state: String::from("online"),
|
|
active: true,
|
|
preparing_for_shutdown: false,
|
|
idle_hint: false,
|
|
locked_hint: false,
|
|
session_type: String::from("wayland"),
|
|
inhibitors: Vec::new(),
|
|
}
|
|
}
|
|
}
|
|
|
|
pub type SharedRuntime = Arc<RwLock<SessionRuntime>>;
|
|
|
|
pub fn shared_runtime() -> SharedRuntime {
|
|
Arc::new(RwLock::new(SessionRuntime::default()))
|
|
}
|