From 3b1f5eab31b33fb1621ba7823317990951bf45e6 Mon Sep 17 00:00:00 2001 From: Ryan Hendrickson Date: Mon, 15 Aug 2022 12:47:27 -0400 Subject: [PATCH] firefox: add application actions to .desktop file --- .../networking/browsers/firefox/wrapper.nix | 20 +++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/networking/browsers/firefox/wrapper.nix b/pkgs/applications/networking/browsers/firefox/wrapper.nix index 1b8e3c879676..35a98e6c8c60 100644 --- a/pkgs/applications/networking/browsers/firefox/wrapper.nix +++ b/pkgs/applications/networking/browsers/firefox/wrapper.nix @@ -86,6 +86,8 @@ let ++ pkcs11Modules; gtk_modules = [ libcanberra-gtk3 ]; + launcherName = "${applicationName}${nameSuffix}"; + ######################### # # # EXTRA PREF CHANGES # @@ -167,7 +169,7 @@ let desktopItem = makeDesktopItem { name = applicationName; - exec = "${applicationName}${nameSuffix} %U"; + exec = "${launcherName} %U"; inherit icon; desktopName = "${desktopName}${nameSuffix}${lib.optionalString forceWayland " (Wayland)"}"; genericName = "Web Browser"; @@ -182,6 +184,20 @@ let "x-scheme-handler/ftp" ]; startupWMClass = wmClass; + actions = { + new-window = { + name = "New Window"; + exec = "${launcherName} --new-window %U"; + }; + new-private-window = { + name = "New Private Window"; + exec = "${launcherName} --private-window %U"; + }; + profile-manager-window = { + name = "Profile Manager"; + exec = "${launcherName} --ProfileManger"; + }; + }; }; nativeBuildInputs = [ makeWrapper lndir jq ]; @@ -261,7 +277,7 @@ let --suffix-each GTK_PATH ':' "$gtk_modules" \ --prefix PATH ':' "${xdg-utils}/bin" \ --suffix PATH ':' "$out/bin" \ - --set MOZ_APP_LAUNCHER "${applicationName}${nameSuffix}" \ + --set MOZ_APP_LAUNCHER "${launcherName}" \ --set MOZ_SYSTEM_DIR "$out/lib/mozilla" \ --set MOZ_LEGACY_PROFILES 1 \ --set MOZ_ALLOW_DOWNGRADE 1 \