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

32 lines
1,017 B
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
// Aspect-aware wallpaper selection for unlike display shapes. This retains the
// original as canonical and selects only explicit local derivatives.
pragma Singleton
import QtQuick
import Quickshell
import qs.modules.common
Singleton {
id: root
function aspectFor(screen) {
if (!screen || !screen.height) return 1;
return screen.width / screen.height;
}
function pathFor(screen) {
const aspect = root.aspectFor(screen);
const portrait = Config.options.background.portraitVariantPath;
const landscape = Config.options.background.landscapeVariantPath;
if (aspect < 0.9 && portrait) return portrait;
if (aspect > 1.1 && landscape) return landscape;
return Config.options.background.wallpaperPath;
}
function focalPoint() {
return {
x: Math.max(0, Math.min(1, Config.options.background.wallpaperFocalX)),
y: Math.max(0, Math.min(1, Config.options.background.wallpaperFocalY))
};
}
}