about summary refs log tree commit diff
path: root/home
diff options
context:
space:
mode:
Diffstat (limited to 'home')
-rw-r--r--home/fish/default.nix14
1 files changed, 8 insertions, 6 deletions
diff --git a/home/fish/default.nix b/home/fish/default.nix
index bbaddce..5556ed2 100644
--- a/home/fish/default.nix
+++ b/home/fish/default.nix
@@ -1,5 +1,7 @@
 { config, lib, pkgs, ... }:
-let cfg = config.my.home.fish;
+let
+  cfg = config.my.home.fish;
+  swayEnabled = config.my.home.wm.windowManager == "sway";
 in {
   options.my.home.fish = with lib; {
     enable = mkEnableOption "fish configuration";
@@ -9,16 +11,16 @@ in {
     interactiveShellInit = ''
       set fish_greeting
 
-      # Execute sway on login on tty1
-      if [ -z $DISPLAY ] && [ "$(tty)" == "/dev/tty1" ]; then
-        exec sway
-      fi
-
       # Tmux on terminal start
       if status is-interactive
       and not set -q TMUX
           exec tmux
       end
     '';
+    loginShellInit = lib.mkIf swayEnabled ''
+      if test -z "$DISPLAY"; and test (tty) = "/dev/tty1"
+        exec sway
+      end
+    '';
   };
 }