Watch
1
0
Fork
You've already forked souveraine
0
souveraine/surfaces/quickshell/services/LockContentPolicy.qml

31 lines
1.2 KiB
QML
Raw Normal View History

quickshell: first-party lock/nav/session layer, retire the pill Grows Souveraine's own surfaces on top of the borrowed ii shell and drops the separate pill shell in favor of one integrated navigation rail. Session arbiter (functions/Session.qml): probe logind's Can* methods over busctl instead of guessing from installed binaries -- the answer carries the polkit tier (yes/challenge/na), so a swapless phone reports hibernate as na and refuses honestly rather than firing a verb that no-ops. Verbs run through a Process that logs exit codes and tracks lastAction; refusals log too. The busctl output is parsed with awk, not a sed regex buried under four escaping layers -- the sed version returned nothing on the phone and left every capability stuck at "unknown" (invisible on the laptop, where timing masked it). Every structured result is JSON-over-string; quickshell maps a var return to void. Lock trust: screenLocked (the shell's lock request) is now distinct from screenLockSecure (WlSessionLock.secure, the compositor's acknowledgement, mirrored from LockScreen). Cards that disclose personal data gate on secure, not on a button press. LockContentPolicy centralizes the ambient/personal/ step-up tiers so no card grows its own private rule. New first-party namespace modules/souveraine/: LockMediaCard, LockSurfaceHost, SystemGestureRail -- owned surfaces, not ii patches. IdleCoordinator gives one staged idle vocabulary (dim/lock) gated behind nativeCoordinatorEnabled, off until the native Wayland idle-notify is verified on the Pixel compositor; hypridle stays the adapter. WallpaperAssets selects aspect-aware variants for phone-vs-laptop display shapes. Pill retired: pill/shell.qml and PillConfig gone, replaced by NavigationConfig and the gesture rail. Hyprland starts qs -c souveraine directly; no secondary shell, no qsConfig flip. Verified on the phone: session.* reports challenge/na correctly, hibernate and unlock refuse, inhibit round-trips with its reason.
2026-07-14 20:00:57 -04:00
// Lock-surface information policy. Every card asks this singleton instead of
// growing an accidental privacy rule of its own.
pragma Singleton
import QtQuick
import Quickshell
import qs.modules.common
Singleton {
id: root
readonly property string ambient: "ambient"
readonly property string personal: "personal"
readonly property string stepUp: "step-up"
function allowsOnLock(tier, promotedAmbient = false) {
if (tier === root.ambient) return true;
// Promotion is intentionally field-specific (for example media title)
// and never applies to credentials, memories, agent output, or actions.
return tier === root.personal && promotedAmbient;
}
readonly property bool mediaControlsVisible: Config.options.lock.content.showMediaControls
readonly property bool mediaMetadataVisible: root.allowsOnLock(
root.personal, Config.options.lock.content.mediaMetadataAmbient)
readonly property bool batteryVisible: Config.options.lock.content.showBattery
readonly property bool notificationsVisible: Config.options.lock.content.showNotifications
readonly property bool notificationContentVisible: root.allowsOnLock(
root.personal, Config.options.lock.content.notificationContentAmbient)
quickshell: first-party lock/nav/session layer, retire the pill Grows Souveraine's own surfaces on top of the borrowed ii shell and drops the separate pill shell in favor of one integrated navigation rail. Session arbiter (functions/Session.qml): probe logind's Can* methods over busctl instead of guessing from installed binaries -- the answer carries the polkit tier (yes/challenge/na), so a swapless phone reports hibernate as na and refuses honestly rather than firing a verb that no-ops. Verbs run through a Process that logs exit codes and tracks lastAction; refusals log too. The busctl output is parsed with awk, not a sed regex buried under four escaping layers -- the sed version returned nothing on the phone and left every capability stuck at "unknown" (invisible on the laptop, where timing masked it). Every structured result is JSON-over-string; quickshell maps a var return to void. Lock trust: screenLocked (the shell's lock request) is now distinct from screenLockSecure (WlSessionLock.secure, the compositor's acknowledgement, mirrored from LockScreen). Cards that disclose personal data gate on secure, not on a button press. LockContentPolicy centralizes the ambient/personal/ step-up tiers so no card grows its own private rule. New first-party namespace modules/souveraine/: LockMediaCard, LockSurfaceHost, SystemGestureRail -- owned surfaces, not ii patches. IdleCoordinator gives one staged idle vocabulary (dim/lock) gated behind nativeCoordinatorEnabled, off until the native Wayland idle-notify is verified on the Pixel compositor; hypridle stays the adapter. WallpaperAssets selects aspect-aware variants for phone-vs-laptop display shapes. Pill retired: pill/shell.qml and PillConfig gone, replaced by NavigationConfig and the gesture rail. Hyprland starts qs -c souveraine directly; no secondary shell, no qsConfig flip. Verified on the phone: session.* reports challenge/na correctly, hibernate and unlock refuse, inhibit round-trips with its reason.
2026-07-14 20:00:57 -04:00
}