slab: autostart Hyprland on tty1

This commit is contained in:
NullBite 2024-03-17 20:32:45 -04:00
parent 9bd949604b
commit c183023606
Signed by: nullbite
GPG Key ID: 6C4D545385D4925A

View File

@ -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";
};