From 76f5015549ec825b577447679a141253cf635b77 Mon Sep 17 00:00:00 2001 From: Emmet Date: Fri, 29 Sep 2023 22:14:00 -0500 Subject: [PATCH] Added qute-containers to qutebrowser --- user/app/browser/qute-containers.nix | 32 ++ user/app/browser/qutebrowser.nix | 663 ++++++++++++++++++++++++++- 2 files changed, 693 insertions(+), 2 deletions(-) create mode 100644 user/app/browser/qute-containers.nix diff --git a/user/app/browser/qute-containers.nix b/user/app/browser/qute-containers.nix new file mode 100644 index 00000000..526a1c64 --- /dev/null +++ b/user/app/browser/qute-containers.nix @@ -0,0 +1,32 @@ +{ lib, stdenv, fetchFromGitHub, pkgs, dmenuCmd ? "rofi -dmenu", ... }: + +let name = "qute-containers"; + version = "unstable"; + dmenu = dmenuCmd; +in + stdenv.mkDerivation { + inherit name version; + + src = fetchFromGitHub { + owner = "s-praveen-kumar"; + repo = "qute-containers"; + rev = "c6164b94104fa8565200b87bfc87a2e08ca15ac7"; + sha256 = "sha256-g684sPSEJTRSk2V8LVrQsNeRIYtaQueRpZeREWtmQKw="; + }; + + phases = "installPhase"; + + installPhase = '' + mkdir -p $out $out/bin + cp $src/* $out/bin + sed -i 's/DMENU=\"rofi -dmenu\"/DMENU=\"''+dmenu+''\"/g' $out/bin/containers_config + sed -i 's/DMENU_FLAGS//g' $out/bin/container-open + ''; + + meta = { + homepage = "https://github.com/s-praveen-kumar/qute-containers"; + description = "Browser Containers for Qutebrowser"; + license = lib.licenses.mit; + maintainers = []; + }; + } diff --git a/user/app/browser/qutebrowser.nix b/user/app/browser/qutebrowser.nix index 70169e1d..fb6ed62e 100644 --- a/user/app/browser/qutebrowser.nix +++ b/user/app/browser/qutebrowser.nix @@ -1,8 +1,12 @@ -{ config, lib, pkgs, font, ... }: +{ config, lib, pkgs, font, qute-containers, ... }: { - home.packages = [ pkgs.qutebrowser ]; + home.packages = [ pkgs.qutebrowser + (pkgs.callPackage ./qute-containers.nix { dmenuCmd = "fuzzel -d"; }) + ]; home.sessionVariables = { DEFAULT_BROWSER = "${pkgs.qutebrowser}/bin/qutebrowser"; }; + home.file.".config/qutebrowser/userscripts/container-open".source = "${(pkgs.callPackage ./qute-containers.nix { dmenuCmd = "fuzzel -d"; })}/bin/container-open"; + home.file.".config/qutebrowser/userscripts/containers_config".source = "${(pkgs.callPackage ./qute-containers.nix { dmenuCmd = "fuzzel -d"; })}/bin/containers_config"; programs.qutebrowser.enable = true; programs.qutebrowser.extraConfig = '' @@ -65,6 +69,8 @@ config.bind('t', 'open -t') config.bind('x', 'tab-close') config.bind('yf', 'hint links yank') config.bind(',m', 'hint links spawn freetube {hint-url}') +config.bind(',co', 'spawn container-open') +config.bind(',cf', 'hint links userscript container-open') #config.bind(',s', 'set content.user_stylesheets \'\' ') #config.bind(',S', 'set content.user_stylesheets '+current_stylesheet_path) @@ -268,4 +274,657 @@ c.colors.webpage.bg = base00 ''; + + home.file.".config/qutebrowser/containers".text = '' +Personal +Teaching +Tech +Finances +Gaming +Gamedev + ''; + + # TODO make this final section more efficient... + home.file.".browser/Personal/config/qute-home.html".text = '' + + + + + Home + + + + + + +
+ ..--------.. + .`` "'. + .` _.---.. /--| '. + /`` || | + /` /--| || | + / / | || `/----\, + | | | .-`.-/- __. \ + | \ `-.`` ..-` \ | + \ ```` ~.^` | | | + \.____.-``'|| | / / + | || |_.- / + | || / + . |_-` `------~``. + `.. ..` + ``--______-'` +
+
+ +

Welcome to Qutebrowser

+
+

Personal Profile

+
+ +
+

[o] [Search]

+

[b] [Quickmarks]

+

[S h] [History]

+

[t] [New tab]

+

[x] [Close tab]

+
+ + + + + ''; + + home.file.".browser/Teaching/config/qute-home.html".text = '' + + + + + Home + + + + + + +
+ ..--------.. + .`` "'. + .` _.---.. /--| '. + /`` || | + /` /--| || | + / / | || `/----\, + | | | .-`.-/- __. \ + | \ `-.`` ..-` \ | + \ ```` ~.^` | | | + \.____.-``'|| | / / + | || |_.- / + | || / + . |_-` `------~``. + `.. ..` + ``--______-'` +
+
+ +

Welcome to Qutebrowser

+
+

Teaching Profile

+
+ +
+

[o] [Search]

+

[b] [Quickmarks]

+

[S h] [History]

+

[t] [New tab]

+

[x] [Close tab]

+
+ + + + + ''; + + home.file.".browser/Tech/config/qute-home.html".text = '' + + + + + Home + + + + + + +
+ ..--------.. + .`` "'. + .` _.---.. /--| '. + /`` || | + /` /--| || | + / / | || `/----\, + | | | .-`.-/- __. \ + | \ `-.`` ..-` \ | + \ ```` ~.^` | | | + \.____.-``'|| | / / + | || |_.- / + | || / + . |_-` `------~``. + `.. ..` + ``--______-'` +
+
+ +

Welcome to Qutebrowser

+
+

Tech Profile

+
+ +
+

[o] [Search]

+

[b] [Quickmarks]

+

[S h] [History]

+

[t] [New tab]

+

[x] [Close tab]

+
+ + + + + ''; + + home.file.".browser/Finances/config/qute-home.html".text = '' + + + + + Home + + + + + + +
+ ..--------.. + .`` "'. + .` _.---.. /--| '. + /`` || | + /` /--| || | + / / | || `/----\, + | | | .-`.-/- __. \ + | \ `-.`` ..-` \ | + \ ```` ~.^` | | | + \.____.-``'|| | / / + | || |_.- / + | || / + . |_-` `------~``. + `.. ..` + ``--______-'` +
+
+ +

Welcome to Qutebrowser

+
+

Finances Profile

+
+ +
+

[o] [Search]

+

[b] [Quickmarks]

+

[S h] [History]

+

[t] [New tab]

+

[x] [Close tab]

+
+ + + + + ''; + + home.file.".browser/Gamedev/config/qute-home.html".text = '' + + + + + Home + + + + + + +
+ ..--------.. + .`` "'. + .` _.---.. /--| '. + /`` || | + /` /--| || | + / / | || `/----\, + | | | .-`.-/- __. \ + | \ `-.`` ..-` \ | + \ ```` ~.^` | | | + \.____.-``'|| | / / + | || |_.- / + | || / + . |_-` `------~``. + `.. ..` + ``--______-'` +
+
+ +

Welcome to Qutebrowser

+
+

Gamedev Profile

+
+ +
+

[o] [Search]

+

[b] [Quickmarks]

+

[S h] [History]

+

[t] [New tab]

+

[x] [Close tab]

+
+ + + + + ''; + + home.file.".browser/Gaming/config/qute-home.html".text = '' + + + + + Home + + + + + + +
+ ..--------.. + .`` "'. + .` _.---.. /--| '. + /`` || | + /` /--| || | + / / | || `/----\, + | | | .-`.-/- __. \ + | \ `-.`` ..-` \ | + \ ```` ~.^` | | | + \.____.-``'|| | / / + | || |_.- / + | || / + . |_-` `------~``. + `.. ..` + ``--______-'` +
+
+ +

Welcome to Qutebrowser

+
+

Gaming Profile

+
+ +
+

[o] [Search]

+

[b] [Quickmarks]

+

[S h] [History]

+

[t] [New tab]

+

[x] [Close tab]

+
+ + + + + ''; + }