From 3f6f3fbed73476adbfa2cc59a3d8c8f92c381d02 Mon Sep 17 00:00:00 2001 From: Swarsel Date: Tue, 15 Oct 2024 11:33:13 +0200 Subject: [PATCH] fix: stop links opening in wrong profile --- SwarselSystems.org | 30 ++++++++--- profiles/common/home/firefox.nix | 3 +- profiles/common/home/packages.nix | 1 + profiles/common/home/sway.nix | 2 +- profiles/optional/home/work.nix | 87 ++++++++++++++++++++++++++++++- programs/emacs/init.el | 10 ++-- 6 files changed, 117 insertions(+), 16 deletions(-) diff --git a/SwarselSystems.org b/SwarselSystems.org index 92cb070..1edc590 100644 --- a/SwarselSystems.org +++ b/SwarselSystems.org @@ -7919,6 +7919,7 @@ This holds packages that I can use as provided, or with small modifications (as picard-tools audacity sox + feishin # printing cups @@ -9684,11 +9685,12 @@ I used to build the firefox addon =bypass-paywalls-clean= myself here, but the m enable = true; package = pkgs.firefox; # uses overrides policies = { - CaptivePortal = false; + # CaptivePortal = false; DisableFirefoxStudies = true; DisablePocket = true; DisableTelemetry = true; DisableFirefoxAccounts = false; + DisplayBookmarksToolbar = "always"; NoDefaultBookmarks = true; OfferToSaveLogins = false; OfferToSaveLoginsDefault = false; @@ -9938,7 +9940,7 @@ Currently, I am too lazy to explain every option here, but most of it is very se lib.recursiveUpdate { "${modifier}+q" = "kill"; - "${modifier}+f" = "exec firefox"; + "${modifier}+f" = "exec firefox -p cl_adm"; "${modifier}+Shift+f" = "exec swaymsg fullscreen"; "${modifier}+Space" = "exec fuzzel"; "${modifier}+Shift+Space" = "floating toggle"; @@ -10359,6 +10361,11 @@ The rest of the settings is at [[#h:bbf2ecb6-c8ff-4462-b5d5-d45b28604ddf][work]] id = 3; <> }; + # i need this profile because xdg-open uses cl_adm profile no matter what i do + cl_adm_real = { + id = 4; + <> + }; }; }; @@ -10403,11 +10410,18 @@ The rest of the settings is at [[#h:bbf2ecb6-c8ff-4462-b5d5-d45b28604ddf][work]] }; firefox_cl = { - name = "Firefox (cl_adm)"; + name = "Firefox (Main)"; genericName = "Firefox cl"; exec = "firefox -p cl_adm"; inherit terminal categories icon; }; + + firefox_cl_real = { + name = "Firefox (cl_adm)"; + genericName = "Firefox"; + exec = "firefox -p cl_adm_real"; + inherit terminal categories icon; + }; }; @@ -12929,12 +12943,12 @@ I am not completely sure on electric-pair-mode yet, sometimes it is very helpful (setq highlight-parentheses-background-colors '("magenta" "blue" "cyan" "green" "yellow" "orange" "red")) (global-highlight-parentheses-mode t)) - (electric-pair-mode 1) - (setq electric-pair-preserve-balance t) - (setq electric-pair-skip-self nil) - (setq electric-pair-delete-adjacent-pairs t) + ;; (electric-pair-mode 1) + ;; (setq electric-pair-preserve-balance t) + ;; (setq electric-pair-skip-self nil) + ;; (setq electric-pair-delete-adjacent-pairs t) ;; don't skip newline when auto-pairing parenthesis - (setq electric-pair-skip-whitespace-chars '(9 32)) + ;; (setq electric-pair-skip-whitespace-chars '(9 32)) ;; in org-mode buffers, do not pair < and > in order not to interfere with org-tempo (add-hook 'org-mode-hook (lambda () diff --git a/profiles/common/home/firefox.nix b/profiles/common/home/firefox.nix index c1bf323..1f7deeb 100644 --- a/profiles/common/home/firefox.nix +++ b/profiles/common/home/firefox.nix @@ -4,11 +4,12 @@ enable = true; package = pkgs.firefox; # uses overrides policies = { - CaptivePortal = false; + # CaptivePortal = false; DisableFirefoxStudies = true; DisablePocket = true; DisableTelemetry = true; DisableFirefoxAccounts = false; + DisplayBookmarksToolbar = "always"; NoDefaultBookmarks = true; OfferToSaveLogins = false; OfferToSaveLoginsDefault = false; diff --git a/profiles/common/home/packages.nix b/profiles/common/home/packages.nix index 97de800..53c1b41 100644 --- a/profiles/common/home/packages.nix +++ b/profiles/common/home/packages.nix @@ -12,6 +12,7 @@ picard-tools audacity sox + feishin # printing cups diff --git a/profiles/common/home/sway.nix b/profiles/common/home/sway.nix index 33476ab..25d88f9 100644 --- a/profiles/common/home/sway.nix +++ b/profiles/common/home/sway.nix @@ -34,7 +34,7 @@ in lib.recursiveUpdate { "${modifier}+q" = "kill"; - "${modifier}+f" = "exec firefox"; + "${modifier}+f" = "exec firefox -p cl_adm"; "${modifier}+Shift+f" = "exec swaymsg fullscreen"; "${modifier}+Space" = "exec fuzzel"; "${modifier}+Shift+Space" = "floating toggle"; diff --git a/profiles/optional/home/work.nix b/profiles/optional/home/work.nix index 796f34f..4f3599d 100644 --- a/profiles/optional/home/work.nix +++ b/profiles/optional/home/work.nix @@ -269,6 +269,84 @@ search.force = true; # this is required because otherwise the search.json.mozlz4 symlink gets replaced on every firefox restart }; + # i need this profile because xdg-open uses cl_adm profile no matter what i do + cl_adm_real = { + id = 4; + + isDefault = false; + userChrome = builtins.readFile ../../../programs/firefox/chrome/userChrome.css; + extensions = with pkgs.nur.repos.rycee.firefox-addons; [ + tridactyl + browserpass + clearurls + darkreader + enhancer-for-youtube + istilldontcareaboutcookies + translate-web-pages + ublock-origin + reddit-enhancement-suite + sponsorblock + web-archives + onepassword-password-manager + single-file + widegithub + enhanced-github + unpaywall + don-t-fuck-with-paste + plasma-integration + ]; + + 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" ]; + }; + + "NixOS Options" = { + urls = [{ + template = "https://search.nixos.org/options"; + params = [ + { name = "query"; value = "{searchTerms}"; } + ]; + }]; + + icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg"; + definedAliases = [ "@no" ]; + }; + + "Home Manager Options" = { + urls = [{ + template = "https://home-manager-options.extranix.com/"; + params = [ + { name = "query"; value = "{searchTerms}"; } + ]; + }]; + + icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg"; + definedAliases = [ "@hm" "@ho" "@hmo" ]; + }; + + "Google".metaData.alias = "@g"; + }; + search.force = true; # this is required because otherwise the search.json.mozlz4 symlink gets replaced on every firefox restart + + }; }; }; @@ -313,11 +391,18 @@ }; firefox_cl = { - name = "Firefox (cl_adm)"; + name = "Firefox (Main)"; genericName = "Firefox cl"; exec = "firefox -p cl_adm"; inherit terminal categories icon; }; + + firefox_cl_real = { + name = "Firefox (cl_adm)"; + genericName = "Firefox"; + exec = "firefox -p cl_adm_real"; + inherit terminal categories icon; + }; }; diff --git a/programs/emacs/init.el b/programs/emacs/init.el index ea465a8..dfc06bb 100644 --- a/programs/emacs/init.el +++ b/programs/emacs/init.el @@ -1275,12 +1275,12 @@ create a new one." (setq highlight-parentheses-background-colors '("magenta" "blue" "cyan" "green" "yellow" "orange" "red")) (global-highlight-parentheses-mode t)) -(electric-pair-mode 1) -(setq electric-pair-preserve-balance t) -(setq electric-pair-skip-self nil) -(setq electric-pair-delete-adjacent-pairs t) +;; (electric-pair-mode 1) +;; (setq electric-pair-preserve-balance t) +;; (setq electric-pair-skip-self nil) +;; (setq electric-pair-delete-adjacent-pairs t) ;; don't skip newline when auto-pairing parenthesis -(setq electric-pair-skip-whitespace-chars '(9 32)) +;; (setq electric-pair-skip-whitespace-chars '(9 32)) ;; in org-mode buffers, do not pair < and > in order not to interfere with org-tempo (add-hook 'org-mode-hook (lambda ()