From d57c65efb9d6ed063733eb4611e74fa2ca8d1cbe Mon Sep 17 00:00:00 2001 From: Mohammad Rafiq Date: Sun, 18 May 2025 18:11:01 +0800 Subject: [PATCH] feat(hyprland): add autostart for hyprland --- homes/x86_64-linux/rafiq/programs/hyprland.nix | 1 + modules/nixos/desktop/windowManager.nix | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/homes/x86_64-linux/rafiq/programs/hyprland.nix b/homes/x86_64-linux/rafiq/programs/hyprland.nix index 9186ac2..5d9bd8c 100644 --- a/homes/x86_64-linux/rafiq/programs/hyprland.nix +++ b/homes/x86_64-linux/rafiq/programs/hyprland.nix @@ -1,5 +1,6 @@ {config, lib, osConfig, ...}: { + xdg.configFile."uwsm/env".text = # sh '' diff --git a/modules/nixos/desktop/windowManager.nix b/modules/nixos/desktop/windowManager.nix index 20498c0..2421d70 100644 --- a/modules/nixos/desktop/windowManager.nix +++ b/modules/nixos/desktop/windowManager.nix @@ -2,6 +2,14 @@ { config = lib.mkMerge [ (lib.mkIf (config.desktop.windowManager == "hyprland") { + environment.loginShellInit = # sh + '' + if [[ -z "$SSH_CLIENT" && -z "$SSH_CONNECTION" ]]; then + if uwsm check may-start; then + exec uwsm start hyprland-uwsm.desktop + fi + fi + ''; environment.variables = { ELECTRON_OZONE_PLATFORM_HINT = "auto"; NIXOS_OZONE_WL = "1";