diff --git a/modules/common/applications/wezterm.nix b/modules/common/applications/wezterm.nix index ea10c4c..6d2273b 100644 --- a/modules/common/applications/wezterm.nix +++ b/modules/common/applications/wezterm.nix @@ -30,6 +30,7 @@ }; terminal = "${pkgs.wezterm}/bin/wezterm"; + terminalLaunchCommand = "${config.terminal} start --"; home-manager.users.${config.user} = { diff --git a/modules/common/mail/aerc.nix b/modules/common/mail/aerc.nix index 2f24792..e41a3ed 100644 --- a/modules/common/mail/aerc.nix +++ b/modules/common/mail/aerc.nix @@ -169,7 +169,8 @@ filters = { "text/plain" = "${pkgs.aerc}/libexec/aerc/filters/colorize"; "text/calendar" = "${pkgs.gawk}/bin/awk -f ${pkgs.aerc}/libexec/aerc/filters/calendar"; - "text/html" = "${pkgs.aerc}/libexec/aerc/filters/html | ${pkgs.aerc}/libexec/aerc/filters/colorize"; # Requires w3m, dante + "text/html" = + "${pkgs.aerc}/libexec/aerc/filters/html | ${pkgs.aerc}/libexec/aerc/filters/colorize"; # Requires w3m, dante # "text/*" = # ''${pkgs.bat}/bin/bat -fP --file-name="$AERC_FILENAME "''; "message/delivery-status" = "${pkgs.aerc}/libexec/aerc/filters/colorize"; @@ -192,26 +193,23 @@ xdg.desktopEntries.aerc = lib.mkIf (pkgs.stdenv.isLinux && config.gui.enable) { name = "aerc"; - exec = "${config.terminal} aerc %u"; + exec = "${config.terminalLaunchCommand} aerc %u"; }; xsession.windowManager.i3.config.keybindings = lib.mkIf pkgs.stdenv.isLinux { - "${ - config.home-manager.users.${config.user}.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 ${ - config.home-manager.users.${config.user}.programs.rofi.terminal - } --class aerc aerc" - sleep 0.25 - fi - i3-msg "[class=aerc] focus" - '' - ) - }"; + "${config.home-manager.users.${config.user}.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 ${config.terminal} start --class aerc -- aerc" + sleep 0.25 + fi + i3-msg "[class=aerc] focus" + '' + ) + }"; }; programs.fish.shellAbbrs = { diff --git a/modules/nixos/graphical/default.nix b/modules/nixos/graphical/default.nix index c1b864c..76705f3 100644 --- a/modules/nixos/graphical/default.nix +++ b/modules/nixos/graphical/default.nix @@ -51,6 +51,11 @@ description = "Path to executable for terminal emulator program."; default = null; }; + terminalLaunchCommand = lib.mkOption { + type = lib.types.nullOr lib.types.str; + description = "Command for using the terminal to launch a new window with a program."; + default = null; + }; wallpaper = lib.mkOption { type = lib.types.path; description = "Wallpaper background image file";