Make boot greeter frameless and match Gaming display mode

This commit is contained in:
rope 2026-09-14 19:37:31 +01:00
parent 7bc5a4c852
commit 0eaf97d134
4 changed files with 47 additions and 3 deletions

View file

@ -10,6 +10,23 @@ let
{ name = "qmldir"; path = pkgs.writeText "qmldir" "singleton Theme 1.0 Theme.qml\nAuthView 1.0 AuthView.qml\n"; }
];
greeter = bundle "fred-greeter" ./quickshell/Greeter.qml;
# Reuse the desktop's explicit mode instead of keeping a second 180 Hz
# setting here. The MacBook uses automatic/preferred output configuration.
gamingMonitor = builtins.head config.home-manager.users.fred.wayland.windowManager.hyprland.settings.monitor;
greeterClient = pkgs.writeShellScript "fred-greeter-client" ''
${lib.optionalString (config.networking.hostName == "FredOS-Gaming") ''
# Run inside Cage, where its Wayland output-management socket exists.
# A missing connector or unsupported mode must not prevent login.
if ! ${pkgs.coreutils}/bin/timeout -k 1s 5s ${pkgs.wlr-randr}/bin/wlr-randr \
--output ${lib.escapeShellArg gamingMonitor.output} \
--mode ${lib.escapeShellArg gamingMonitor.mode} \
--scale ${lib.escapeShellArg (toString gamingMonitor.scale)}; then
echo "Greeter: desktop display mode unavailable; keeping Cage's current mode" >&2
fi
''}
export QT_WAYLAND_DISABLE_WINDOWDECORATION=1
exec ${pkgs.quickshell}/bin/qs -p ${greeter}
'';
locker = bundle "fred-lock" ./quickshell/SessionLock.qml;
session = pkgs.writeShellScript "hyprland-session" ''
exec ${config.programs.hyprland.package}/bin/start-hyprland >/dev/null 2>&1
@ -25,6 +42,7 @@ in {
{ name = "greeter"; path = greeter; }
{ name = "lock"; path = locker; }
{ name = "bin"; path = "${lockCommand}/bin"; }
{ name = "greeter-client"; path = greeterClient; }
];
services.greetd = {
enable = true;
@ -37,7 +55,7 @@ in {
export QML2_IMPORT_PATH=${pkgs.qt6.qt5compat}/lib/qt-6/qml
export XKB_DEFAULT_LAYOUT=gb,no
export XKB_DEFAULT_OPTIONS=${lib.escapeShellArg ("grp:win_space_toggle" + lib.optionalString (config.networking.hostName == "FredOS-Gaming") ",altwin:swap_lalt_lwin")}
exec ${pkgs.dbus}/bin/dbus-run-session -- ${pkgs.cage}/bin/cage -s -- ${pkgs.quickshell}/bin/qs -p ${greeter}
exec ${pkgs.dbus}/bin/dbus-run-session -- ${pkgs.cage}/bin/cage -s -- ${greeterClient}
'');
};
};

View file

@ -7,6 +7,8 @@ Window {
id: root
visible: true
visibility: Window.FullScreen
flags: Qt.Window | Qt.FramelessWindowHint
onClosing: close => { close.accepted = false; }
color: "black"
property string password: ""
property string errorMessage: ""