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:
@@ -16,7 +16,7 @@
|
|||||||
];
|
];
|
||||||
|
|
||||||
workspace = [
|
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 = [
|
windowrulev2 = [
|
||||||
@@ -39,8 +39,9 @@
|
|||||||
bind K tabprev
|
bind K tabprev
|
||||||
unbind <C-e>
|
unbind <C-e>
|
||||||
|
|
||||||
" Set newtab from environment variable if available (provided by native messenger)
|
" Modular NewTab: Set from environment variable if provided by launch command
|
||||||
js tri.native.run("printenv TRIDACTYL_NEWTAB").then(r => { if (r.stdout.trim()) tri.config.set("newtab", r.stdout.trim()) })
|
" 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 = {
|
programs.firefox = {
|
||||||
|
|||||||
@@ -7,6 +7,8 @@
|
|||||||
...
|
...
|
||||||
}: {
|
}: {
|
||||||
inherit id name;
|
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.force = true;
|
||||||
search.default = "ddg";
|
search.default = "ddg";
|
||||||
extensions.force = true;
|
extensions.force = true;
|
||||||
|
|||||||
Reference in New Issue
Block a user