feat(firefox): set i18n settings
This commit is contained in:
parent
3918ea6548
commit
25bc0fbf3a
|
@ -4,7 +4,8 @@ with lib;
|
|||
let
|
||||
firefox-addons = pkgs.nur.repos.rycee.firefox-addons;
|
||||
|
||||
prefer-dark-theme = config.gtk.gtk3.extraConfig.gtk-application-prefer-dark-theme;
|
||||
prefer-dark-theme =
|
||||
config.gtk.gtk3.extraConfig.gtk-application-prefer-dark-theme;
|
||||
|
||||
sharedSettings = {
|
||||
# Privacy recommendations from https://www.privacytools.io/browsers/#about_config
|
||||
|
@ -29,14 +30,16 @@ let
|
|||
|
||||
# Theme
|
||||
"ui.systemUsesDarkTheme" = prefer-dark-theme;
|
||||
"extensions.activeThemeID" = concatStrings
|
||||
[ "firefox-compact-"
|
||||
(if prefer-dark-theme then "dark" else "light")
|
||||
"@mozilla.org"
|
||||
];
|
||||
"devtools.theme" = if prefer-dark-theme
|
||||
then "dark"
|
||||
else "light";
|
||||
"extensions.activeThemeID" = concatStrings [
|
||||
"firefox-compact-"
|
||||
(if prefer-dark-theme then "dark" else "light")
|
||||
"@mozilla.org"
|
||||
];
|
||||
"devtools.theme" = if prefer-dark-theme then "dark" else "light";
|
||||
|
||||
# i18n
|
||||
"intl.accept_languages" = "en-GB, en";
|
||||
"intl.regional_prefs.use_os_locales" = true;
|
||||
|
||||
# Other
|
||||
"browser.startup.page" = 3;
|
||||
|
@ -46,18 +49,14 @@ let
|
|||
"signon.rememberSignons" = false;
|
||||
"services.sync.engine.passwords" = false;
|
||||
"browser.newtabpage.activity-stream.asrouter.userprefs.cfr.addons" = false;
|
||||
"browser.newtabpage.activity-stream.asrouter.userprefs.cfr.features" = false;
|
||||
"browser.newtabpage.activity-stream.asrouter.userprefs.cfr.features" =
|
||||
false;
|
||||
"browser.newtabpage.activity-stream.feeds.snippets" = false;
|
||||
};
|
||||
in
|
||||
{
|
||||
in {
|
||||
programs.firefox = {
|
||||
enable = true;
|
||||
package = pkgs.firefox.override {
|
||||
cfg = {
|
||||
enableFXCastBridge = true;
|
||||
};
|
||||
};
|
||||
package = pkgs.firefox.override { cfg = { enableFXCastBridge = true; }; };
|
||||
profiles = {
|
||||
private = {
|
||||
id = 0;
|
||||
|
@ -86,52 +85,54 @@ in
|
|||
};
|
||||
|
||||
home.packages = let
|
||||
escapeDesktopArg = arg: replaceStrings ["\""] ["\"\\\"\""] (toString arg);
|
||||
escapeDesktopArg = arg:
|
||||
replaceStrings [ ''"'' ] [ ''"\""'' ] (toString arg);
|
||||
makeFirefoxProfileDesktopItem = attrs:
|
||||
let
|
||||
mkExec = with lib; { name, profile, ... }: ''
|
||||
firefox -p "${ escapeDesktopArg profile }" --class="firefox-${ escapeDesktopArg name }"
|
||||
'';
|
||||
in
|
||||
pkgs.makeDesktopItem ((removeAttrs attrs [ "profile" ]) // {
|
||||
exec = mkExec attrs;
|
||||
extraEntries = ''
|
||||
StartupWMClass="${ escapeDesktopArg attrs.name }"
|
||||
mkExec = with lib;
|
||||
{ name, profile, ... }: ''
|
||||
firefox -p "${escapeDesktopArg profile}" --class="firefox-${
|
||||
escapeDesktopArg name
|
||||
}"
|
||||
'';
|
||||
});
|
||||
in pkgs.makeDesktopItem ((removeAttrs attrs [ "profile" ]) // {
|
||||
exec = mkExec attrs;
|
||||
extraEntries = ''
|
||||
StartupWMClass="${escapeDesktopArg attrs.name}"
|
||||
'';
|
||||
});
|
||||
makeFirefoxWebAppDesktopItem = attrs:
|
||||
let
|
||||
# --class not yet respected: https://bugzilla.mozilla.org/show_bug.cgi?id=1606247
|
||||
mkExec = with lib; { app, name, profile ? "private", ... }: ''
|
||||
firefox -p "${ escapeDesktopArg profile }" --ssb="${ escapeDesktopArg app }" --class="${ escapeDesktopArg name }"
|
||||
'';
|
||||
in
|
||||
pkgs.makeDesktopItem ((removeAttrs attrs [ "app" "profile" ]) // {
|
||||
exec = mkExec attrs;
|
||||
extraEntries = ''
|
||||
StartupWMClass="${ escapeDesktopArg attrs.name }"
|
||||
mkExec = with lib;
|
||||
{ app, name, profile ? "private", ... }: ''
|
||||
firefox -p "${escapeDesktopArg profile}" --ssb="${
|
||||
escapeDesktopArg app
|
||||
}" --class="${escapeDesktopArg name}"
|
||||
'';
|
||||
});
|
||||
in
|
||||
(with pkgs; [
|
||||
(tor-browser-bundle-bin.override { pulseaudioSupport = true; })
|
||||
])
|
||||
++ [
|
||||
(makeFirefoxProfileDesktopItem {
|
||||
name = "firefox-work";
|
||||
desktopName = "Firefox (Work)";
|
||||
icon = "firefox"; # TODO looks different
|
||||
profile = "work";
|
||||
})
|
||||
(makeFirefoxWebAppDesktopItem {
|
||||
name = "element";
|
||||
desktopName = "Element";
|
||||
app = "https://app.element.io";
|
||||
})
|
||||
(makeFirefoxWebAppDesktopItem {
|
||||
name = "youtube-music";
|
||||
desktopName = "YouTube Music";
|
||||
app = "https://music.youtube.com";
|
||||
})
|
||||
];
|
||||
in pkgs.makeDesktopItem ((removeAttrs attrs [ "app" "profile" ]) // {
|
||||
exec = mkExec attrs;
|
||||
extraEntries = ''
|
||||
StartupWMClass="${escapeDesktopArg attrs.name}"
|
||||
'';
|
||||
});
|
||||
in (with pkgs;
|
||||
[ (tor-browser-bundle-bin.override { pulseaudioSupport = true; }) ]) ++ [
|
||||
(makeFirefoxProfileDesktopItem {
|
||||
name = "firefox-work";
|
||||
desktopName = "Firefox (Work)";
|
||||
icon = "firefox"; # TODO looks different
|
||||
profile = "work";
|
||||
})
|
||||
(makeFirefoxWebAppDesktopItem {
|
||||
name = "element";
|
||||
desktopName = "Element";
|
||||
app = "https://app.element.io";
|
||||
})
|
||||
(makeFirefoxWebAppDesktopItem {
|
||||
name = "youtube-music";
|
||||
desktopName = "YouTube Music";
|
||||
app = "https://music.youtube.com";
|
||||
})
|
||||
];
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue