From c183023606005684a6262e61758c088bf69a26a4 Mon Sep 17 00:00:00 2001 From: NullBite Date: Sun, 17 Mar 2024 20:32:45 -0400 Subject: [PATCH] slab: autostart Hyprland on tty1 --- hosts/slab/home.nix | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/hosts/slab/home.nix b/hosts/slab/home.nix index 0005a89..b850019 100644 --- a/hosts/slab/home.nix +++ b/hosts/slab/home.nix @@ -1,4 +1,4 @@ -{ lib, pkgs, osConfig, ... }: +{ lib, pkgs, osConfig, config, ... }: { imports = [ ../../home @@ -10,6 +10,16 @@ }; home.stateVersion = "23.11"; + # auto start Hyprland on tty1 + programs.zsh.initExtraFirst = let + hyprland="${config.wayland.windowManager.hyprland.finalPackage}/bin/Hyprland"; + tty="${pkgs.coreutils}/bin/tty"; + in lib.mkIf config.wayland.windowManager.hyprland.enable '' + if [[ "$(${tty})" == "/dev/tty1" && -z "''${WAYLAND_DISPLAY:+x}" ]] ; then + ${hyprland} + fi + ''; + wayland.windowManager.hyprland.settings = { monitor = ",preferred,auto,1.25"; };