From db024c02d592023f9f9d90f4bf1d41c9c4d75466 Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Thu, 29 Jul 2021 12:17:41 +0200 Subject: [PATCH] home: tridactyl: setup config --- home/default.nix | 2 ++ home/firefox.nix | 20 ++++++++++++++++++++ home/tridactyl.nix | 13 +++++++++++++ home/tridactylrc | 31 +++++++++++++++++++++++++++++++ 4 files changed, 66 insertions(+) create mode 100644 home/firefox.nix create mode 100644 home/tridactyl.nix create mode 100644 home/tridactylrc diff --git a/home/default.nix b/home/default.nix index d914eb7..75a2ac4 100644 --- a/home/default.nix +++ b/home/default.nix @@ -5,6 +5,7 @@ ./bat.nix ./emacs.nix ./env.nix + ./firefox.nix ./fish ./flameshot.nix ./git.nix @@ -14,6 +15,7 @@ ./ssh.nix ./themes ./tmux.nix + ./tridactyl.nix ./x ]; diff --git a/home/firefox.nix b/home/firefox.nix new file mode 100644 index 0000000..15a40ad --- /dev/null +++ b/home/firefox.nix @@ -0,0 +1,20 @@ +{ config, lib, pkgs, ... }: +let + cfg = config.my.home.firefox; +in +{ + options.my.home.firefox = with lib; { + enable = (mkEnableOption "firefox config") // { default = config.my.home.x.enable; }; + }; + + config = lib.mkIf cfg.enable { + programs.firefox = { + enable = true; + package = pkgs.unstable.firefox.override { + cfg = { + enableTridactylNative = true; + }; + }; + }; + }; +} diff --git a/home/tridactyl.nix b/home/tridactyl.nix new file mode 100644 index 0000000..b179812 --- /dev/null +++ b/home/tridactyl.nix @@ -0,0 +1,13 @@ +{ config, lib, ... }: +let + cfg = config.my.home.tridactyl; +in +{ + options.my.home.tridactyl = with lib; { + enable = (mkEnableOption "tridactyl code display tool") // { default = config.my.home.firefox.enable; }; + }; + + config = lib.mkIf cfg.enable { + xdg.configFile."tridactyl/tridactylrc".source = ./tridactylrc; + }; +} diff --git a/home/tridactylrc b/home/tridactylrc new file mode 100644 index 0000000..2b756e3 --- /dev/null +++ b/home/tridactylrc @@ -0,0 +1,31 @@ +" This wipes all existing settings. This means that if a setting in this file is +" removed, then it will return to default. In other words, this file serves as +" as an enforced single point of truth for Tridactyl's configuration. +sanitize tridactyllocal tridactylsync + +" Ctrl-F should use the browser's native 'find' functionality. +unbind + +" Tridactyl has an incomplete find mode +bind / fillcmdline find +bind ? fillcmdline find -? +bind n findnext 1 +bind N findnext -1 +bind , nohlsearch + +" case insensitive if lowercase, case sensitive if using some uppercase letters +set findcase smart + +" New reddit is bad +autocmd DocStart ^http(s?)://www.reddit.com js tri.excmds.urlmodify("-t", "www", "old") + +" Orange site / Reddit / Lobste.rs specific hints to toggle comments +bind ;c hint -Jc [class*="expand"],[class="togg"],[class="comment_folder"] + +" Use emacs as editor +set editorcmd emacsclient -c + +" copy all the things +set yankto both + +blacklistadd netflix.com