diff --git a/platforms/home-manager/modules/nmasur/presets/programs/aerc.nix b/platforms/home-manager/modules/nmasur/presets/programs/aerc.nix index ac3ecdc..7fb8f8e 100644 --- a/platforms/home-manager/modules/nmasur/presets/programs/aerc.nix +++ b/platforms/home-manager/modules/nmasur/presets/programs/aerc.nix @@ -199,19 +199,25 @@ in exec = "${lib.getExe config.nmasur.presets.services.i3.terminal} aerc %u"; }; xsession.windowManager.i3.config.keybindings = lib.mkIf pkgs.stdenv.isLinux { - "${config.xsession.windowManager.i3.config.modifier}+Shift+e" = "exec ${ - # Don't name the script `aerc` or it will affect grep - builtins.toString ( - pkgs.writeShellScript "focus-mail.sh" '' - count=$(ps aux | grep -c aerc) - if [ "$count" -eq 1 ]; then - i3-msg "exec --no-startup-id ${lib.getExe config.nmasur.presets.services.i3.terminal} start --class aerc -- aerc" - sleep 0.25 - fi - i3-msg "[class=aerc] focus" - '' - ) - }"; + "${config.xsession.windowManager.i3.config.modifier}+Shift+e" = + let + terminal = config.nmasur.presets.services.i3.terminal; + startupCommand = + if terminal == pkgs.wezterm then "start --class aerc -- aerc" else "--class=aerc --command=aerc"; + in + "exec ${ + # Don't name the script `aerc` or it will affect grep + builtins.toString ( + pkgs.writeShellScript "focus-mail.sh" '' + count=$(ps aux | grep -c aerc) + if [ "$count" -eq 1 ]; then + i3-msg "exec --no-startup-id ${lib.getExe terminal} ${startupCommand}" + sleep 0.25 + fi + i3-msg "[class=aerc] focus" + '' + ) + }"; }; programs.fish.shellAbbrs = { diff --git a/platforms/home-manager/modules/nmasur/presets/programs/ghostty.nix b/platforms/home-manager/modules/nmasur/presets/programs/ghostty.nix index d27b687..6b2ab35 100644 --- a/platforms/home-manager/modules/nmasur/presets/programs/ghostty.nix +++ b/platforms/home-manager/modules/nmasur/presets/programs/ghostty.nix @@ -14,6 +14,10 @@ in options.nmasur.presets.programs.ghostty.enable = lib.mkEnableOption "Ghostty terminal"; config = lib.mkIf cfg.enable { + + # Set the i3 terminal + nmasur.presets.services.i3.terminal = config.programs.ghostty.package; + programs.ghostty = { enable = true; @@ -29,7 +33,7 @@ in macos-titlebar-style = "hidden"; window-decoration = false; macos-non-native-fullscreen = true; - fullscreen = true; + fullscreen = if pkgs.stdenv.isDarwin then true else false; keybind = [ "super+t=unbind" # Pass super-t to underlying tool (e.g. zellij tabs) "super+shift+]=unbind" diff --git a/platforms/home-manager/modules/nmasur/presets/services/i3.nix b/platforms/home-manager/modules/nmasur/presets/services/i3.nix index caecc0c..7bb7501 100644 --- a/platforms/home-manager/modules/nmasur/presets/services/i3.nix +++ b/platforms/home-manager/modules/nmasur/presets/services/i3.nix @@ -94,7 +94,7 @@ in ws10 = "10:X"; in { - terminal = cfg.terminal.meta.mainProgram; + # terminal = cfg.terminal.meta.mainProgram; modifier = modifier; assigns = { "${ws1}" = [ { class = "Firefox"; } ]; @@ -103,6 +103,7 @@ in { class = "kitty"; } { class = "obsidian"; } { class = "wezterm"; } + { class = "ghostty"; } ]; "${ws3}" = [ { class = "discord"; } ]; "${ws4}" = [ @@ -213,9 +214,9 @@ in cfg.commands.lockScreen != null ) "exec ${cfg.commands.lockScreen}"; "${modifier}+Mod1+h" = - "exec --no-startup-id ${lib.getExe cfg.terminal} -e sh -c '${pkgs.home-manager}/bin/home-manager switch --flake ${config.nmasur.presets.programs.dotfiles.path} || read'"; + "exec --no-startup-id ${lib.getExe cfg.terminal} --command sh -c '${pkgs.home-manager}/bin/home-manager switch --flake ${config.nmasur.presets.programs.dotfiles.path} || read'"; "${modifier}+Mod1+r" = - "exec --no-startup-id ${lib.getExe cfg.terminal} -e sh -c 'doas nixos-rebuild switch --flake ${config.nmasur.presets.programs.dotfiles.path} || read'"; + "exec --no-startup-id ${lib.getExe cfg.terminal} --command sh -c 'doas nixos-rebuild switch --flake ${config.nmasur.presets.programs.dotfiles.path} || read'"; # Window options "${modifier}+q" = "kill"; diff --git a/platforms/home-manager/modules/nmasur/presets/services/polybar.nix b/platforms/home-manager/modules/nmasur/presets/services/polybar.nix index 23cec37..063466e 100644 --- a/platforms/home-manager/modules/nmasur/presets/services/polybar.nix +++ b/platforms/home-manager/modules/nmasur/presets/services/polybar.nix @@ -136,7 +136,15 @@ in fi '' ); - click-left = "i3-msg 'exec --no-startup-id kitty --class aerc aerc'; sleep 0.15; i3-msg '[class=aerc] focus'"; + click-left = + let + startupCommand = + if config.nmasur.presets.services.i3.terminal == pkgs.wezterm then + "start --class aerc -- aerc" + else + "--class=aerc --command=aerc"; + in + "i3-msg 'exec --no-startup-id ${config.nmasur.presets.services.i3.terminal} ${startupCommand}'; sleep 0.15; i3-msg '[class=aerc] focus'"; }; "module/network" = { type = "internal/network"; diff --git a/platforms/home-manager/modules/nmasur/profiles/linux-gui.nix b/platforms/home-manager/modules/nmasur/profiles/linux-gui.nix index 50c5a18..50c289b 100644 --- a/platforms/home-manager/modules/nmasur/profiles/linux-gui.nix +++ b/platforms/home-manager/modules/nmasur/profiles/linux-gui.nix @@ -24,13 +24,13 @@ in discord.enable = lib.mkDefault true; dotfiles.enable = lib.mkDefault true; firefox.enable = lib.mkDefault true; + ghostty.enable = lib.mkDefault true; mpv.enable = lib.mkDefault true; nautilus.enable = lib.mkDefault true; notmuch.enable = lib.mkDefault true; nsxiv.enable = lib.mkDefault true; obsidian.enable = lib.mkDefault true; rofi.enable = lib.mkDefault true; - wezterm.enable = lib.mkDefault true; xclip.enable = lib.mkDefault true; zathura.enable = lib.mkDefault true; }; diff --git a/platforms/home-manager/modules/nmasur/profiles/work.nix b/platforms/home-manager/modules/nmasur/profiles/work.nix index e81eb8c..0e24224 100644 --- a/platforms/home-manager/modules/nmasur/profiles/work.nix +++ b/platforms/home-manager/modules/nmasur/profiles/work.nix @@ -55,6 +55,7 @@ in firefox.enable = lib.mkDefault true; fish.enable = lib.mkDefault true; fzf.enable = lib.mkDefault true; + ghostty.enable = lib.mkDefault true; git-work.enable = lib.mkDefault true; git.enable = lib.mkDefault true; github.enable = lib.mkDefault true; @@ -67,7 +68,6 @@ in starship.enable = lib.mkDefault true; terraform.enable = lib.mkDefault true; weather.enable = lib.mkDefault true; - wezterm.enable = lib.mkDefault true; }; };