From e8a46ae2487a6289946076aa0b9f6d0c860489e3 Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Sun, 12 Feb 2023 17:33:45 +0000 Subject: [PATCH] home: firefox: tridactyl: use preferred terminal Thankfully, alacritty and termite both use the same command line arguments for this. If I ever want to use another one, I might have to make the logic a bit more robust. --- home/firefox/tridactyl/default.nix | 15 +++++++++++++-- home/firefox/tridactyl/tridactylrc | 3 +-- 2 files changed, 14 insertions(+), 4 deletions(-) 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 4dbf7bb..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 '+normal!%lGzv%c|'" +set editorcmd @editorcmd@ " }}} " Binds {{{