firefox: Rudimentary config, tridactyl support
This commit is contained in:
parent
1dbfd6cf88
commit
6cee16924c
5 changed files with 169 additions and 104 deletions
162
hm/desktop/browser/default.nix
Normal file
162
hm/desktop/browser/default.nix
Normal file
|
@ -0,0 +1,162 @@
|
|||
{ pkgs, lib, config, ... }:
|
||||
{
|
||||
config = lib.mkIf config.frogeye.desktop.xorg {
|
||||
home.sessionVariables = {
|
||||
BROWSER = "qutebrowser";
|
||||
};
|
||||
programs = {
|
||||
firefox = {
|
||||
enable = true;
|
||||
package = pkgs.firefox.override {
|
||||
nativeMessagingHosts = [
|
||||
pkgs.tridactyl-native
|
||||
];
|
||||
};
|
||||
|
||||
profiles.hm = {
|
||||
extensions = with config.nur.repos.rycee.firefox-addons;
|
||||
[
|
||||
(buildFirefoxXpiAddon {
|
||||
|
||||
pname = "onetab";
|
||||
version = "0.1.0";
|
||||
addonId = "onetab@nated";
|
||||
url = "https://addons.mozilla.org/firefox/downloads/file/4118712/one_tab_per_window-0.1.0.xpi";
|
||||
sha256 = "sha256-64DeL2xgXpqz32LJWDx4jhS2Fvbld8re3z8fdwnNTw0=";
|
||||
meta = with lib;
|
||||
{
|
||||
homepage = "https://git.sr.ht/~nated/onetab";
|
||||
description = "When a new tab is opened, redirects it to a new window instead.";
|
||||
license = licenses.unfree;
|
||||
mozPermissions = [ "tabs" ];
|
||||
platforms = platforms.all;
|
||||
};
|
||||
})
|
||||
tridactyl
|
||||
ublock-origin
|
||||
];
|
||||
search = {
|
||||
default = "DuckDuckGo";
|
||||
engines = {
|
||||
# TODO Harmonize with qutebrowser search engines
|
||||
"Nix Packages" = {
|
||||
urls = [
|
||||
{
|
||||
template = "https://search.nixos.org/packages";
|
||||
params = [
|
||||
{ name = "type"; value = "packages"; }
|
||||
{ name = "query"; value = "{searchTerms}"; }
|
||||
];
|
||||
}
|
||||
];
|
||||
icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg";
|
||||
definedAliases = [ "@np" ];
|
||||
};
|
||||
"NixOS Wiki" = {
|
||||
urls = [{ template = "https://nixos.wiki/index.php?search={searchTerms}"; }];
|
||||
iconUpdateURL = "https://nixos.wiki/favicon.png";
|
||||
updateInterval = 24 * 60 * 60 * 1000; # every day
|
||||
definedAliases = [ "@nw" ];
|
||||
};
|
||||
"Bing".metaData.hidden = true;
|
||||
"Google".metaData.alias = "@g"; # builtin engines only support specifying one additional alias
|
||||
};
|
||||
force = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
qutebrowser = {
|
||||
enable = true;
|
||||
keyBindings = {
|
||||
normal = {
|
||||
# Match tab behaviour to i3. Not that I use tabs.
|
||||
"H" = "tab-prev";
|
||||
"J" = "back";
|
||||
"K" = "forward";
|
||||
"L" = "tab-next";
|
||||
# "T" = null;
|
||||
"af" = "spawn --userscript freshrss"; # TODO Broken?
|
||||
"as" = "spawn --userscript shaarli"; # TODO I don't use shaarli anymore
|
||||
# "d" = null;
|
||||
"u" = "undo --window";
|
||||
# TODO Unbind d and T (?)
|
||||
};
|
||||
};
|
||||
loadAutoconfig = true;
|
||||
searchEngines = rec {
|
||||
DEFAULT = ecosia;
|
||||
alpinep = "https://pkgs.alpinelinux.org/packages?name={}&branch=edge";
|
||||
ampwhat = "http://www.amp-what.com/unicode/search/{}";
|
||||
arch = "https://wiki.archlinux.org/?search={}";
|
||||
archp = "https://www.archlinux.org/packages/?q={}";
|
||||
aur = "https://aur.archlinux.org/packages/?K={}";
|
||||
aw = ampwhat;
|
||||
ddg = duckduckgo;
|
||||
dockerhub = "https://hub.docker.com/search/?isAutomated=0&isOfficial=0&page=1&pullCount=0&q={}&starCount=0";
|
||||
duckduckgo = "https://duckduckgo.com/?q={}&ia=web";
|
||||
ecosia = "https://www.ecosia.org/search?q={}";
|
||||
gfr = "https://www.google.fr/search?hl=fr&q={}";
|
||||
g = google;
|
||||
gh = github;
|
||||
gi = "http://images.google.com/search?q={}";
|
||||
giphy = "https://giphy.com/search/{}";
|
||||
github = "https://github.com/search?q={}";
|
||||
google = "https://www.google.fr/search?q={}";
|
||||
hm = homemanager;
|
||||
homemanager = "https://mipmip.github.io/home-manager-option-search/?query={}";
|
||||
invidious = "https://invidious.frogeye.fr/search?q={}";
|
||||
inv = invidious;
|
||||
nixos = "https://search.nixos.org/options?channel=${config.home.version.release}&query={}";
|
||||
nixpkgs = "https://search.nixos.org/packages?channel=${config.home.version.release}&query={}";
|
||||
npm = "https://www.npmjs.com/search?q={}";
|
||||
os = nixos;
|
||||
pkgs = nixpkgs;
|
||||
q = qwant;
|
||||
qwant = "https://www.qwant.com/?t=web&q={}";
|
||||
wolfram = "https://www.wolframalpha.com/input/?i={}";
|
||||
youtube = "https://www.youtube.com/results?search_query={}";
|
||||
yt = youtube;
|
||||
};
|
||||
settings = {
|
||||
downloads.location.prompt = false;
|
||||
tabs = {
|
||||
show = "never";
|
||||
tabs_are_windows = true;
|
||||
};
|
||||
url = rec {
|
||||
open_base_url = true;
|
||||
start_pages = lib.mkDefault "https://geoffrey.frogeye.fr/blank.html";
|
||||
default_page = start_pages;
|
||||
};
|
||||
content = {
|
||||
# I had this setting below, not sure if it did something special
|
||||
# config.set("content.cookies.accept", "no-3rdparty", "chrome://*/*")
|
||||
cookies.accept = "no-3rdparty";
|
||||
prefers_reduced_motion = true;
|
||||
headers.accept_language = "fr-FR, fr;q=0.9, en-GB;q=0.8, en-US;q=0.7, en;q=0.6";
|
||||
tls.certificate_errors = "ask-block-thirdparty";
|
||||
};
|
||||
editor.command = [ "${pkgs.neovide}/bin/neovide" "--" "-f" "{file}" "-c" "normal {line}G{column0}l" ];
|
||||
# TODO Doesn't work on Arch. Does it even load the right profile on Nix?
|
||||
# TODO spellcheck.languages = ["fr-FR" "en-GB" "en-US"];
|
||||
};
|
||||
};
|
||||
};
|
||||
xdg = {
|
||||
configFile."tridactyl/tridactylrc".source = ./tridactylrc; # TODO Improve that :)
|
||||
mimeApps = {
|
||||
enable = true;
|
||||
defaultApplications = {
|
||||
"text/html" = "org.qutebrowser.qutebrowser.desktop";
|
||||
"x-scheme-handler/http" = "org.qutebrowser.qutebrowser.desktop";
|
||||
"x-scheme-handler/https" = "org.qutebrowser.qutebrowser.desktop";
|
||||
"x-scheme-handler/about" = "org.qutebrowser.qutebrowser.desktop";
|
||||
"x-scheme-handler/unknown" = "org.qutebrowser.qutebrowser.desktop";
|
||||
};
|
||||
};
|
||||
};
|
||||
xsession.windowManager.i3.config.keybindings = {
|
||||
"${config.xsession.windowManager.i3.config.modifier}+m" = "exec ${config.programs.qutebrowser.package}/bin/qutebrowser --override-restore";
|
||||
};
|
||||
};
|
||||
}
|
105
hm/desktop/browser/tridactylrc
Normal file
105
hm/desktop/browser/tridactylrc
Normal file
|
@ -0,0 +1,105 @@
|
|||
" Trydactyl (vim-like keybindings for Firefox) configuration file
|
||||
" Make sure to have the native messenger installed (:native)
|
||||
|
||||
" Fair part took from https://gist.github.com/BurntSushi/393546a65db38d57cedcfd72c6d89bf3
|
||||
|
||||
" Reset parameters to tridactyl's default
|
||||
" so there's nothing being kept when :source ing
|
||||
sanitise tridactyllocal tridactylsync
|
||||
|
||||
colors dark
|
||||
" For when https://github.com/bezmi/base16-tridactyl/issues/2 will be closed
|
||||
" colors theme
|
||||
|
||||
" I use H and L for moving accross windows,
|
||||
" so I'd rather use those for tabs too
|
||||
bind H tabprev
|
||||
bind L tabnext
|
||||
bind J back
|
||||
bind K forward
|
||||
|
||||
" I prefer the qutebrowser-style keybindings for opening stuff in a new tab
|
||||
" Also it is consistent with f/F p/P s/S... in tridactyl itself
|
||||
bind o fillcmdline open
|
||||
bind O fillcmdline tabopen
|
||||
" Let's reuse t/T to use that useful feature of editing the current URL before
|
||||
" opening
|
||||
" bind t current_url open
|
||||
" bint T current_url tabopen
|
||||
bind t composite url2args | fillcmdline open
|
||||
bind T composite url2args | fillcmdline tabopen
|
||||
" We will let the w/W the same, as in my case tab=window
|
||||
|
||||
" Add to ...
|
||||
unbind a
|
||||
unbind A
|
||||
|
||||
" Reorder bookmarks/quickmarks
|
||||
bind M current_url bmark
|
||||
|
||||
" Activate the rudimentary search feature
|
||||
" Not activated by default because `incsearch` is not implemented,
|
||||
" so since I don't know what it is I don't care about it
|
||||
bind / fillcmdline find
|
||||
bind ? fillcmdline find -?
|
||||
bind n findnext 1
|
||||
bind N findnext -1
|
||||
" Remove search highlighting
|
||||
bind ,<Space> nohlsearch
|
||||
|
||||
" Ctrl-F should use the browser's native 'find' functionality.
|
||||
unbind <C-f>
|
||||
|
||||
" Subscribe to RSS
|
||||
bind af rssexec
|
||||
set rsscmd tabopen add_rss %u
|
||||
set searchurls.add_rss https://rss.frogeye.fr/i/?c=feed&a=add&url_rss=%s
|
||||
|
||||
bind as composite get_current_url | tabopen add_links
|
||||
set searchurls.add_links https://links.frogeye.fr/?post=%s
|
||||
|
||||
" New tab page (this link won't work for you :P)
|
||||
set newtab https://geoffrey.frogeye.fr/home.php
|
||||
|
||||
" Search engines
|
||||
set searchengine qwant
|
||||
|
||||
set searchurls.arch https://wiki.archlinux.org/?search=%s
|
||||
set searchurls.archp https://www.archlinux.org/packages/?q=%s
|
||||
set searchurls.aur https://aur.archlinux.org/packages/?K=%s
|
||||
set searchurls.aw http://www.amp-what.com/unicode/search/%s
|
||||
set searchurls.bulbapedia https://bulbapedia.bulbagarden.net/w/index.php?title=Special:Search&search=%s&go=Go
|
||||
set searchurls.fdroid https://search.f-droid.org/?q=%s
|
||||
set searchurls.gfr https://www.google.fr/search?hl=fr&q=%s
|
||||
set searchurls.g https://www.google.fr/search?q=%s
|
||||
set searchurls.gihpy https://giphy.com/search/%s
|
||||
set searchurls.gi http://images.google.com/search?q=%s
|
||||
set searchurls.github https://github.com/search?q=%s
|
||||
set searchurls.npm https://www.npmjs.com/search?q=%s
|
||||
set searchurls.pypi https://pypi.org/search/?q=%s
|
||||
set searchurls.python https://docs.python.org/3/search.html?q=%s
|
||||
set searchurls.qwant https://www.qwant.com/?t=web&q=%s
|
||||
set searchurls.invidious https://invidious.frogeye.fr/search?q=%s
|
||||
set searchurls.id https://invidious.drycat.fr/search?q=%s
|
||||
set searchurls.wa https://www.wolframalpha.com/input/?i=%s
|
||||
set searchurls.yt https://www.youtube.com/results?search_query=%s
|
||||
|
||||
" Firefox GUI
|
||||
" This can still be shown with F6!
|
||||
guiset_quiet gui none
|
||||
|
||||
" Never autofocus
|
||||
set allowautofocus false
|
||||
|
||||
" Hide the mode indicator in the lower right corner
|
||||
set modeindicator false
|
||||
|
||||
" Hint chars
|
||||
" As I take more time finding the key I need to type (even if it's on the home
|
||||
" row) than moving my fingers to get it, I prefer to reduce the number of keys
|
||||
" to type rather than the movement of my fingers, hence the big amount of
|
||||
" hint chars
|
||||
set hintchars asdfhjklgqweryuioptzxcbnmv1234678905
|
||||
|
||||
" This will have to do until someone writes us a nice syntax file :)
|
||||
" vim: set filetype=vim:
|
|
@ -8,12 +8,12 @@ in
|
|||
./audio
|
||||
./autorandr
|
||||
./background
|
||||
./browser
|
||||
./frobar
|
||||
./i3.nix
|
||||
./lock
|
||||
./mpd
|
||||
./presentation
|
||||
./qutebrowser.nix
|
||||
./redness
|
||||
./screenshots
|
||||
./terminal
|
||||
|
@ -67,7 +67,6 @@ in
|
|||
};
|
||||
};
|
||||
};
|
||||
qutebrowser.enable = true;
|
||||
};
|
||||
|
||||
xdg = {
|
||||
|
@ -143,9 +142,7 @@ in
|
|||
# data management
|
||||
freefilesync
|
||||
|
||||
# browsers
|
||||
firefox
|
||||
|
||||
# misc
|
||||
gnome.gedit
|
||||
feh
|
||||
zbar
|
||||
|
|
|
@ -1,96 +0,0 @@
|
|||
{ pkgs, lib, config, ... }:
|
||||
{
|
||||
config = lib.mkIf config.programs.qutebrowser.enable {
|
||||
home.sessionVariables = {
|
||||
BROWSER = "qutebrowser";
|
||||
};
|
||||
programs.qutebrowser = {
|
||||
keyBindings = {
|
||||
normal = {
|
||||
# Match tab behaviour to i3. Not that I use tabs.
|
||||
"H" = "tab-prev";
|
||||
"J" = "back";
|
||||
"K" = "forward";
|
||||
"L" = "tab-next";
|
||||
# "T" = null;
|
||||
"af" = "spawn --userscript freshrss"; # TODO Broken?
|
||||
"as" = "spawn --userscript shaarli"; # TODO I don't use shaarli anymore
|
||||
# "d" = null;
|
||||
"u" = "undo --window";
|
||||
# TODO Unbind d and T (?)
|
||||
};
|
||||
};
|
||||
loadAutoconfig = true;
|
||||
searchEngines = rec {
|
||||
DEFAULT = ecosia;
|
||||
alpinep = "https://pkgs.alpinelinux.org/packages?name={}&branch=edge";
|
||||
ampwhat = "http://www.amp-what.com/unicode/search/{}";
|
||||
arch = "https://wiki.archlinux.org/?search={}";
|
||||
archp = "https://www.archlinux.org/packages/?q={}";
|
||||
aur = "https://aur.archlinux.org/packages/?K={}";
|
||||
aw = ampwhat;
|
||||
ddg = duckduckgo;
|
||||
dockerhub = "https://hub.docker.com/search/?isAutomated=0&isOfficial=0&page=1&pullCount=0&q={}&starCount=0";
|
||||
duckduckgo = "https://duckduckgo.com/?q={}&ia=web";
|
||||
ecosia = "https://www.ecosia.org/search?q={}";
|
||||
gfr = "https://www.google.fr/search?hl=fr&q={}";
|
||||
g = google;
|
||||
gh = github;
|
||||
gi = "http://images.google.com/search?q={}";
|
||||
giphy = "https://giphy.com/search/{}";
|
||||
github = "https://github.com/search?q={}";
|
||||
google = "https://www.google.fr/search?q={}";
|
||||
hm = homemanager;
|
||||
homemanager = "https://mipmip.github.io/home-manager-option-search/?query={}";
|
||||
invidious = "https://invidious.frogeye.fr/search?q={}";
|
||||
inv = invidious;
|
||||
nixos = "https://search.nixos.org/options?channel=${config.home.version.release}&query={}";
|
||||
nixpkgs = "https://search.nixos.org/packages?channel=${config.home.version.release}&query={}";
|
||||
npm = "https://www.npmjs.com/search?q={}";
|
||||
os = nixos;
|
||||
pkgs = nixpkgs;
|
||||
q = qwant;
|
||||
qwant = "https://www.qwant.com/?t=web&q={}";
|
||||
wolfram = "https://www.wolframalpha.com/input/?i={}";
|
||||
youtube = "https://www.youtube.com/results?search_query={}";
|
||||
yt = youtube;
|
||||
};
|
||||
settings = {
|
||||
downloads.location.prompt = false;
|
||||
tabs = {
|
||||
show = "never";
|
||||
tabs_are_windows = true;
|
||||
};
|
||||
url = rec {
|
||||
open_base_url = true;
|
||||
start_pages = lib.mkDefault "https://geoffrey.frogeye.fr/blank.html";
|
||||
default_page = start_pages;
|
||||
};
|
||||
content = {
|
||||
# I had this setting below, not sure if it did something special
|
||||
# config.set("content.cookies.accept", "no-3rdparty", "chrome://*/*")
|
||||
cookies.accept = "no-3rdparty";
|
||||
prefers_reduced_motion = true;
|
||||
headers.accept_language = "fr-FR, fr;q=0.9, en-GB;q=0.8, en-US;q=0.7, en;q=0.6";
|
||||
tls.certificate_errors = "ask-block-thirdparty";
|
||||
};
|
||||
editor.command = [ "${pkgs.neovide}/bin/neovide" "--" "-f" "{file}" "-c" "normal {line}G{column0}l" ];
|
||||
# TODO Doesn't work on Arch. Does it even load the right profile on Nix?
|
||||
# TODO spellcheck.languages = ["fr-FR" "en-GB" "en-US"];
|
||||
};
|
||||
};
|
||||
xdg.mimeApps = {
|
||||
enable = true;
|
||||
defaultApplications = {
|
||||
"text/html" = "org.qutebrowser.qutebrowser.desktop";
|
||||
"x-scheme-handler/http" = "org.qutebrowser.qutebrowser.desktop";
|
||||
"x-scheme-handler/https" = "org.qutebrowser.qutebrowser.desktop";
|
||||
"x-scheme-handler/about" = "org.qutebrowser.qutebrowser.desktop";
|
||||
"x-scheme-handler/unknown" = "org.qutebrowser.qutebrowser.desktop";
|
||||
};
|
||||
};
|
||||
xsession.windowManager.i3.config.keybindings = {
|
||||
"${config.xsession.windowManager.i3.config.modifier}+m" = "exec ${config.programs.qutebrowser.package}/bin/qutebrowser --override-restore";
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue