From 270b9976fc5d731f73bc0e94693e1e9800f7b8a7 Mon Sep 17 00:00:00 2001 From: Patrick Date: Fri, 25 Oct 2024 18:18:30 +0200 Subject: [PATCH] feat: autostart hyprland on tty1 --- users/patrick/patrick.nix | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/users/patrick/patrick.nix b/users/patrick/patrick.nix index 076872d..1155aec 100644 --- a/users/patrick/patrick.nix +++ b/users/patrick/patrick.nix @@ -58,4 +58,11 @@ lib.escapeShellArg nixosConfig.age.secrets."my-gpg-yubikey-keygrip.tar".path } -C "$HOME/.gnupg/private-keys-v1.d/" ''; + # Autostart hyprland if on tty1 (once, don't restart after logout) + programs.zsh.initExtra = lib.mkOrder 9999 '' + if [[ -t 0 && "$(tty || true)" == /dev/tty1 && -z "$DISPLAY" && -z "$WAYLAND_DISPLAY" ]]; then + echo "Login shell detected. Starting hyprland..." + dbus-run-session Hyprland + fi + ''; }