diff --git a/home/firefox/tridactyl/default.nix b/home/firefox/tridactyl/default.nix index fd8e3fb..2a37d26 100644 --- a/home/firefox/tridactyl/default.nix +++ b/home/firefox/tridactyl/default.nix @@ -1,9 +1,20 @@ -{ config, lib, ... }: +{ config, lib, pkgs, ... }: let cfg = config.my.home.firefox.tridactyl; in { config = lib.mkIf cfg.enable { - xdg.configFile."tridactyl/tridactylrc".source = ./tridactylrc; + xdg.configFile."tridactyl/tridactylrc".source = pkgs.substituteAll { + src = ./tridactylrc; + + editorcmd = lib.concatStringsSep " " [ + # Use my configured terminal + config.my.home.terminal.program + # Make it easy to pick out with a window class name + "--class tridactyl_editor" + # Open vim with the cursor in the correct position + ''-e "vim %f '+normal!%lGzv%c|'"'' + ]; + }; }; } diff --git a/home/firefox/tridactyl/tridactylrc b/home/firefox/tridactyl/tridactylrc index 711bf6f..200b74e 100644 --- a/home/firefox/tridactyl/tridactylrc +++ b/home/firefox/tridactyl/tridactylrc @@ -5,8 +5,7 @@ colorscheme dark " Make tridactyl open Vim in my prefered terminal -" FIXME: make it follow my prefered terminal -set editorcmd termite --class tridactyl_editor -e 'vim %f' +set editorcmd @editorcmd@ " }}} " Binds {{{ diff --git a/home/packages/default.nix b/home/packages/default.nix index 84c1253..0cfa3b3 100644 --- a/home/packages/default.nix +++ b/home/packages/default.nix @@ -22,6 +22,5 @@ in file mosh ripgrep - termite.terminfo ] ++ cfg.additionalPackages); } diff --git a/home/terminal/alacritty/default.nix b/home/terminal/alacritty/default.nix new file mode 100644 index 0000000..760162a --- /dev/null +++ b/home/terminal/alacritty/default.nix @@ -0,0 +1,52 @@ +{ config, lib, pkgs, ... }: +let + cfg = config.my.home.terminal; +in +{ + config = lib.mkIf (cfg.program == "alacritty") { + programs.alacritty = { + enable = true; + + settings = { + font = { + size = 5.5; + }; + + colors = { + primary = { + background = cfg.colors.background; + foreground = cfg.colors.foreground; + + bright_foreground = cfg.colors.foregroundBold; + }; + + cursor = { + cursor = cfg.colors.cursor; + }; + + normal = { + black = cfg.colors.black; + red = cfg.colors.red; + green = cfg.colors.green; + yellow = cfg.colors.yellow; + blue = cfg.colors.blue; + magenta = cfg.colors.magenta; + cyan = cfg.colors.cyan; + white = cfg.colors.white; + }; + + bright = { + black = cfg.colors.blackBold; + red = cfg.colors.redBold; + green = cfg.colors.greenBold; + yellow = cfg.colors.yellowBold; + blue = cfg.colors.blueBold; + magenta = cfg.colors.magentaBold; + cyan = cfg.colors.cyanBold; + white = cfg.colors.whiteBold; + }; + }; + }; + }; + }; +} diff --git a/home/terminal/default.nix b/home/terminal/default.nix index 68ff44e..20f36b5 100644 --- a/home/terminal/default.nix +++ b/home/terminal/default.nix @@ -10,13 +10,14 @@ let in { imports = [ + ./alacritty ./termite ]; options.my.home = with lib; { terminal = { program = mkOption { - type = with types; nullOr (enum [ "termite" ]); + type = with types; nullOr (enum [ "alacritty" "termite" ]); default = null; example = "termite"; description = "Which terminal to use for home session"; diff --git a/home/zsh/default.nix b/home/zsh/default.nix index bd26903..646b6e3 100644 --- a/home/zsh/default.nix +++ b/home/zsh/default.nix @@ -84,11 +84,8 @@ in reset-agent = "gpg-connect-agent updatestartuptty /bye"; }; - # Enable VTE integration when using one of the affected shells - enableVteIntegration = - builtins.any (name: config.my.home.terminal.program == name) [ - "termite" - ]; + # Enable VTE integration + enableVteIntegration = true; }; # Fuzzy-wuzzy diff --git a/machines/aramis/home.nix b/machines/aramis/home.nix index bac77f4..cdacf04 100644 --- a/machines/aramis/home.nix +++ b/machines/aramis/home.nix @@ -23,8 +23,8 @@ mpv.enable = true; # Network-Manager applet nm-applet.enable = true; - # Termite terminal - terminal.program = "termite"; + # Terminal + terminal.program = "alacritty"; # Zathura document viewer zathura.enable = true; };