qutebrowser: Own file

This commit is contained in:
Geoffrey Frogeye 2024-01-07 22:38:42 +01:00
parent 597b50ebef
commit ecc6cb983d
Signed by: geoffrey
GPG key ID: C72403E7F82E6AD8
21 changed files with 103 additions and 95 deletions

View file

@ -334,11 +334,11 @@
}, },
"nixos-hardware": { "nixos-hardware": {
"locked": { "locked": {
"lastModified": 1704458188, "lastModified": 1704632650,
"narHash": "sha256-f6BYEuIqnbrs6J/9m1/1VdkJ6d63hO9kUC09kTPuOqE=", "narHash": "sha256-83J/nd/NoLqo3vj0S0Ppqe8L+ijIFiGL6HNDfCCUD/Q=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixos-hardware", "repo": "nixos-hardware",
"rev": "172385318068519900a7d71c1024242fa6af75f0", "rev": "c478b3d56969006e015e55aaece4931f3600c1b2",
"type": "github" "type": "github"
}, },
"original": { "original": {

View file

@ -63,8 +63,11 @@ in
# TODO Maybe we can do something about node-gyp # TODO Maybe we can do something about node-gyp
]; ];
commonShellAliases = { commonShellAliases = {
# Completion for existing commands # Replacement commands
ls = "lsd"; ls = "lsd";
cat = "bat -pp";
# Completion for existing commands
mkdir = "mkdir -v"; mkdir = "mkdir -v";
# cp = "cp -i"; # Disabled because conflicts with the ZSH/Bash one. This separation is confusing I swear. # cp = "cp -i"; # Disabled because conflicts with the ZSH/Bash one. This separation is confusing I swear.
mv = "mv -iv"; mv = "mv -iv";
@ -76,6 +79,7 @@ in
numbat = "numbat --intro-banner off"; numbat = "numbat --intro-banner off";
insect = "numbat"; insect = "numbat";
ipython = "ipython --no-confirm-exit --pdb"; ipython = "ipython --no-confirm-exit --pdb";
bat = "bat -A";
# Frequent mistakes # Frequent mistakes
sl = "ls"; sl = "ls";
@ -525,7 +529,6 @@ in
} // lib.optionalAttrs config.frogeye.desktop.xorg { } // lib.optionalAttrs config.frogeye.desktop.xorg {
# Favourite commands # Favourite commands
VISUAL = "nvim"; VISUAL = "nvim";
BROWSER = "${config.programs.qutebrowser.package}/bin/qutebrowser";
# Extra config # Extra config
RXVT_SOCKET = "${config.xdg.stateHome}/urxvtd"; # Used to want -$HOME suffix, hopefullt this isn't needed RXVT_SOCKET = "${config.xdg.stateHome}/urxvtd"; # Used to want -$HOME suffix, hopefullt this isn't needed

View file

@ -3,7 +3,7 @@
imports = [ imports = [
../options.nix ../options.nix
./common.nix ./common.nix
./desktop.nix ./desktop
./dev.nix ./dev.nix
./extra.nix ./extra.nix
./gaming ./gaming

View file

@ -6,6 +6,7 @@ in
{ {
imports = [ imports = [
./frobar ./frobar
./qutebrowser.nix
]; ];
config = lib.mkIf config.frogeye.desktop.xorg { config = lib.mkIf config.frogeye.desktop.xorg {
frogeye.shellAliases = { frogeye.shellAliases = {
@ -129,8 +130,6 @@ in
}"; }";
"${mod}+Shift+Return" = "exec ${config.programs.urxvt.package}/bin/urxvt"; "${mod}+Shift+Return" = "exec ${config.programs.urxvt.package}/bin/urxvt";
"${mod}+p" = "exec ${pkgs.xfce.thunar}/bin/thunar"; "${mod}+p" = "exec ${pkgs.xfce.thunar}/bin/thunar";
"${mod}+m" = "exec ${config.programs.qutebrowser.package}/bin/qutebrowser --override-restore --backend=webengine";
# TODO --backend not useful anymore
# Volume control # Volume control
"XF86AudioRaiseVolume" = "${pactl} set-sink-mute @DEFAULT_SINK@ false; ${pactl} set-sink-volume @DEFAULT_SINK@ +5%"; "XF86AudioRaiseVolume" = "${pactl} set-sink-mute @DEFAULT_SINK@ false; ${pactl} set-sink-volume @DEFAULT_SINK@ +5%";
"XF86AudioLowerVolume" = "${pactl} set-sink-mute @DEFAULT_SINK@ false; ${pactl} set-sink-volume @DEFAULT_SINK@ -5%"; "XF86AudioLowerVolume" = "${pactl} set-sink-mute @DEFAULT_SINK@ false; ${pactl} set-sink-volume @DEFAULT_SINK@ -5%";
@ -310,8 +309,6 @@ in
titlebar = false; # So that single-container screens are basically almost fullscreen titlebar = false; # So that single-container screens are basically almost fullscreen
commands = [ commands = [
# Open specific applications in floating mode # Open specific applications in floating mode
{ criteria = { class = "Firefox"; }; command = "layout tabbed"; } # Doesn't seem to work anymore
{ criteria = { class = "qutebrowser"; }; command = "layout tabbed"; }
{ criteria = { title = "^pdfpc.*"; window_role = "presenter"; }; command = "move to output left, fullscreen"; } { criteria = { title = "^pdfpc.*"; window_role = "presenter"; }; command = "move to output left, fullscreen"; }
{ criteria = { title = "^pdfpc.*"; window_role = "presentation"; }; command = "move to output right, fullscreen"; } { criteria = { title = "^pdfpc.*"; window_role = "presentation"; }; command = "move to output right, fullscreen"; }
# switch to workspace with urgent window automatically # switch to workspace with urgent window automatically
@ -356,79 +353,6 @@ in
}; };
programs = { programs = {
# Browser
qutebrowser = {
enable = true;
keyBindings = {
normal = {
# Match tab behaviour to i3. Not that I use them.
"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={}";
invidious = "https://invidious.frogeye.fr/search?q={}";
inv = invidious;
npm = "https://www.npmjs.com/search?q={}";
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"];
};
};
# Terminal # Terminal
alacritty = { alacritty = {
# TODO Emojis. Or maybe they work on NixOS? # TODO Emojis. Or maybe they work on NixOS?
@ -540,16 +464,6 @@ in
}; };
xdg = { 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";
};
};
userDirs = { userDirs = {
enable = true; # TODO Which ones do we want? enable = true; # TODO Which ones do we want?
createDirectories = true; createDirectories = true;

View file

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 22 KiB

View file

@ -0,0 +1,91 @@
{ pkgs, lib, config, ... }:
{
config = lib.mkIf config.frogeye.desktop.xorg {
home.sessionVariables = {
BROWSER = "qutebrowser";
};
programs.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={}";
invidious = "https://invidious.frogeye.fr/search?q={}";
inv = invidious;
npm = "https://www.npmjs.com/search?q={}";
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";
};
};
}

View file

@ -7,7 +7,6 @@ in
home.packages = [ home.packages = [
(pkgs.writeShellApplication { (pkgs.writeShellApplication {
name = "rb"; name = "rb";
runtimeInputs = [ pkgs.brightnessctl ];
text = '' text = ''
verb="switch" verb="switch"
if [ "$#" -ge 1 ] if [ "$#" -ge 1 ]

View file

@ -26,7 +26,8 @@ def process_flake(flake: str) -> None:
dep_url = dep["url"] dep_url = dep["url"]
# if not local path, continue # if not local path, continue
if not ( if not (
dep_url.startswith("path:") or dep_url.startswith("git+file:") dep_url.startswith("path:")
or dep_url.startswith("git+file:")
): ):
continue continue
if dep.get("flake", True): if dep.get("flake", True):