feat(firefox): implement robust modular newtab logic

Uses a shell-based environment check in tridactylrc to set the newtab URL dynamically, allowing per-profile overrides without hardcoding URLs.
This commit is contained in:
kenji
2026-01-05 15:31:58 -06:00
parent 683ceefae3
commit eec7fe5808
2 changed files with 6 additions and 3 deletions
+4 -3
View File
@@ -16,7 +16,7 @@
];
workspace = [
"special:youtube, on-created-empty:uwsm app -- env TRIDACTYL_NEWTAB=https://youtube.com firefox -P YouTube --name youtube"
"special:youtube, on-created-empty:env TRIDACTYL_NEWTAB=https://youtube.com firefox -P YouTube --name youtube"
];
windowrulev2 = [
@@ -39,8 +39,9 @@
bind K tabprev
unbind <C-e>
" Set newtab from environment variable if available (provided by native messenger)
js tri.native.run("printenv TRIDACTYL_NEWTAB").then(r => { if (r.stdout.trim()) tri.config.set("newtab", r.stdout.trim()) })
" Modular NewTab: Set from environment variable if provided by launch command
" Note: Uses 'r.content' for native command output
js tri.native.run("sh -c 'echo $TRIDACTYL_NEWTAB'").then(r => { let url = r.content.trim(); if (url) { tri.config.set("newtab", url); console.log("Tridactyl: Set newtab to " + url); } }).catch(e => console.error("Tridactyl NewTab Env Error:", e))
'';
programs.firefox = {
+2
View File
@@ -7,6 +7,8 @@
...
}: {
inherit id name;
# Note: This profile relies on the global tridactylrc logic in default.nix
# to dynamically set 'newtab' via the TRIDACTYL_NEWTAB environment variable.
search.force = true;
search.default = "ddg";
extensions.force = true;