2022-08-07 23:58:05 -03:00
|
|
|
{ config, pkgs, lib, font, ... }:
|
2023-01-24 11:42:49 -03:00
|
|
|
let
|
2023-01-26 10:20:56 -03:00
|
|
|
inherit (pkgs.uservars) key font browser editor;
|
2023-01-24 11:42:49 -03:00
|
|
|
in
|
|
|
|
{
|
2023-01-26 10:20:56 -03:00
|
|
|
imports = [
|
|
|
|
./colors.nix
|
|
|
|
./fonts.nix
|
|
|
|
];
|
|
|
|
|
2022-08-07 23:58:05 -03:00
|
|
|
config = {
|
|
|
|
programs.qutebrowser = {
|
|
|
|
enable = true;
|
|
|
|
# enableDefaultBindings = false;
|
|
|
|
keyBindings = {
|
|
|
|
normal = {
|
|
|
|
# basic movent
|
|
|
|
"${key.left}" = "scroll left";
|
|
|
|
"${key.down}" = "scroll down";
|
|
|
|
"${key.up}" = "scroll up";
|
|
|
|
"${key.right}" = "scroll right";
|
|
|
|
|
|
|
|
"${lib.toUpper key.up}" = "scroll-px 0 -100";
|
|
|
|
"${lib.toUpper key.down}" = "scroll-px 0 100";
|
|
|
|
"${lib.toUpper key.left}" = "back";
|
|
|
|
"${lib.toUpper key.right}" = "forward";
|
|
|
|
"${lib.toUpper key.tabL}" = "tab-prev";
|
|
|
|
"${lib.toUpper key.tabR}" = "tab-next";
|
|
|
|
|
|
|
|
"${key.next}" = "search-next";
|
|
|
|
"${lib.toUpper key.next}" = "search-prev";
|
|
|
|
|
|
|
|
"${key.insertMode}" = "mode-enter insert";
|
|
|
|
# ":" = "mode-enter command";
|
|
|
|
|
|
|
|
"t" = "hint all";
|
|
|
|
"h" = "set-cmd-text -s :open";
|
|
|
|
"T" = "hint all tab";
|
|
|
|
"H" = "set-cmd-text -s :open -t";
|
2023-02-23 11:46:49 -03:00
|
|
|
|
|
|
|
"<Ctrl-${lib.toLower key.tabL}>" = "tree-tab-promote";
|
|
|
|
"<Ctrl-${lib.toLower key.tabR}>" = "tree-tab-demote";
|
2023-03-11 18:49:17 -03:00
|
|
|
|
|
|
|
"co" = "tab-only --pinned keep";
|
2022-08-07 23:58:05 -03:00
|
|
|
};
|
|
|
|
insert = {
|
|
|
|
# quit insert mode
|
|
|
|
"<Alt-k>" = "mode-enter normal";
|
|
|
|
};
|
|
|
|
caret = {
|
|
|
|
# basic movent
|
|
|
|
"${key.left}" = "move-to-prev-char";
|
2023-03-11 18:49:45 -03:00
|
|
|
"${key.down}" = "move-to-next-line";
|
|
|
|
"${key.up}" = "move-to-prev-line";
|
2022-08-07 23:58:05 -03:00
|
|
|
"${key.right}" = "move-to-next-char";
|
|
|
|
|
|
|
|
"${key.insertMode}" = "mode-enter insert";
|
|
|
|
};
|
|
|
|
|
|
|
|
};
|
|
|
|
settings = {
|
2023-02-23 11:46:49 -03:00
|
|
|
tabs.tree_tabs = true;
|
|
|
|
tabs.position = "right";
|
2023-03-11 18:49:17 -03:00
|
|
|
tabs.pinned.shrink = false;
|
|
|
|
tabs.title.format = "{tree}{collapsed}{audio}{index}: {current_title}";
|
|
|
|
tabs.title.format_pinned = "{tree}{collapsed}{audio}{index} 🔒: {current_title}";
|
|
|
|
|
2023-01-23 16:29:38 -03:00
|
|
|
session.lazy_restore = true;
|
|
|
|
auto_save.session = true;
|
2023-03-11 18:49:17 -03:00
|
|
|
|
2023-01-26 10:20:56 -03:00
|
|
|
hints.chars = key.hints;
|
|
|
|
editor.command = [
|
|
|
|
"terminal"
|
|
|
|
"-e"
|
|
|
|
{
|
|
|
|
kakoune = "kak";
|
|
|
|
helix = "hx";
|
|
|
|
}.${editor}
|
|
|
|
"{file}"
|
|
|
|
"+{line}"
|
|
|
|
];
|
2022-08-07 23:58:05 -03:00
|
|
|
|
2023-03-09 17:57:47 -03:00
|
|
|
input.insert_mode.auto_leave = false;
|
|
|
|
|
2023-02-23 12:27:15 -03:00
|
|
|
content.autoplay = false;
|
2022-08-08 00:29:47 -03:00
|
|
|
content.blocking.adblock.lists = [
|
|
|
|
"https://easylist.to/easylist/easylist.txt"
|
|
|
|
"https://easylist.to/easylist/easyprivacy.txt"
|
|
|
|
"https://easylist-downloads.adblockplus.org/easylistdutch.txt"
|
|
|
|
"https://easylist-downloads.adblockplus.org/abp-filters-anti-cv.txt"
|
|
|
|
"https://www.i-dont-care-about-cookies.eu/abp/"
|
|
|
|
"https://secure.fanboy.co.nz/fanboy-cookiemonster.txt"
|
|
|
|
];
|
2022-08-07 23:58:05 -03:00
|
|
|
};
|
2023-02-23 15:57:30 -03:00
|
|
|
extraConfig = ''
|
|
|
|
config.load_autoconfig()
|
|
|
|
config.set("content.notifications.enabled", True, "https://web.whatsapp.com")
|
|
|
|
'';
|
2022-08-07 23:58:05 -03:00
|
|
|
};
|
2023-01-22 00:10:08 -03:00
|
|
|
systemd.user.services = lib.mkIf (browser == "qutebrowser") {
|
|
|
|
qutebrowser = {
|
|
|
|
Unit = {
|
|
|
|
Description = "Qutebrowser Web client";
|
|
|
|
PartOf = [ "graphical-session.target" ];
|
|
|
|
After = [ "graphical-session.target" ];
|
|
|
|
};
|
|
|
|
Service = {
|
|
|
|
ExecStartPre = "/usr/bin/env sleep 10s";
|
|
|
|
ExecStart = "${pkgs.qutebrowser}/bin/qutebrowser";
|
|
|
|
Restart = "on-failure";
|
|
|
|
};
|
|
|
|
Install = { WantedBy = [ "sway-session.target" ]; };
|
|
|
|
};
|
|
|
|
};
|
2022-08-08 00:29:47 -03:00
|
|
|
home.file = {
|
2022-08-12 22:19:21 -03:00
|
|
|
# For some stupid reason qutebrowser crashes if this dir does not exist
|
|
|
|
".local/share/qutebrowser/greasemonkey/.keep".text = "";
|
2022-08-08 00:29:47 -03:00
|
|
|
".config/qutebrowser/greasemonkey/youtube.js".text = ''
|
|
|
|
// ==UserScript==
|
|
|
|
// @name Auto Skip YouTube Ads
|
|
|
|
// @version 1.0.2
|
|
|
|
// @description Speed up and skip YouTube ads automatically
|
|
|
|
// @author codiac-killer
|
|
|
|
// @match *://*.youtube.com/*
|
|
|
|
// @exclude *://*.youtube.com/subscribe_embed?*
|
|
|
|
// ==/UserScript==
|
|
|
|
|
|
|
|
let main = new MutationObserver(() => {
|
|
|
|
// Get skip button and click it
|
|
|
|
let btn = document.getElementsByClassName("ytp-ad-skip-button ytp-button").item(0)
|
|
|
|
if (btn) {
|
|
|
|
btn.click()
|
|
|
|
}
|
|
|
|
|
|
|
|
// (unskipable ads) If skip button didn't exist / was not clicked speed up video
|
|
|
|
const ad = [...document.querySelectorAll('.ad-showing')][0];
|
|
|
|
if (ad) {
|
|
|
|
// Speed up and mute
|
|
|
|
document.querySelector('video').playbackRate = 16;
|
|
|
|
document.querySelector('video').muted = true;
|
|
|
|
}
|
|
|
|
})
|
|
|
|
|
|
|
|
main.observe(document.getElementsByClassName("video-ads ytp-ad-module").item(0), {attributes: true, characterData: true, childList: true})
|
|
|
|
'';
|
|
|
|
};
|
2022-08-07 23:58:05 -03:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|