From 6a9daeae2f8564a23db2ca9d8e4fcad1686daa51 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luis=20Qui=C3=B1ones?= Date: Mon, 14 Apr 2025 21:03:55 -0500 Subject: [PATCH] fix: manually install .desktop file(#46) Might fix: https://github.com/0xc000022070/zen-browser-flake/issues/45 This commit addresses the problem where the .desktop file was not being installed properly. In my case, since the rewrite the URLs sent me to Brave instead of Zen. Are you dumb, sir? --- assets/desktop/zen.desktop | 25 +++++++++++++++++++++++++ assets/desktop/zen_twilight.desktop | 25 +++++++++++++++++++++++++ package.nix | 4 +++- 3 files changed, 53 insertions(+), 1 deletion(-) create mode 100644 assets/desktop/zen.desktop create mode 100644 assets/desktop/zen_twilight.desktop diff --git a/assets/desktop/zen.desktop b/assets/desktop/zen.desktop new file mode 100644 index 0000000..d3eed1d --- /dev/null +++ b/assets/desktop/zen.desktop @@ -0,0 +1,25 @@ +[Desktop Entry] +Name=Zen Browser +Exec=zen-beta %u +Icon=zen-beta +Type=Application +MimeType=text/html;text/xml;application/xhtml+xml;x-scheme-handler/http;x-scheme-handler/https;application/x-xpinstall;application/pdf;application/json; +StartupWMClass=zen-beta +Categories=Network;WebBrowser; +StartupNotify=true +Terminal=false +X-MultipleArgs=false +Keywords=Internet;WWW;Browser;Web;Explorer; +Actions=new-window;new-private-window;profilemanager; + +[Desktop Action new-window] +Name=Open a New Window +Exec=zen-beta %u + +[Desktop Action new-private-window] +Name=Open a New Private Window +Exec=zen-beta --private-window %u + +[Desktop Action profilemanager] +Name=Open the Profile Manager +Exec=zen-beta --ProfileManager %u \ No newline at end of file diff --git a/assets/desktop/zen_twilight.desktop b/assets/desktop/zen_twilight.desktop new file mode 100644 index 0000000..b382954 --- /dev/null +++ b/assets/desktop/zen_twilight.desktop @@ -0,0 +1,25 @@ +[Desktop Entry] +Name=Zen Browser (Twilight) +Exec=zen-twilight %u +Icon=zen-twilight +Type=Application +MimeType=text/html;text/xml;application/xhtml+xml;x-scheme-handler/http;x-scheme-handler/https;application/x-xpinstall;application/pdf;application/json; +StartupWMClass=zen-twilight +Categories=Network;WebBrowser; +StartupNotify=true +Terminal=false +X-MultipleArgs=false +Keywords=Internet;WWW;Browser;Web;Explorer; +Actions=new-window;new-private-window;profilemanager; + +[Desktop Action new-window] +Name=Open a New Window +Exec=zen-twilight %u + +[Desktop Action new-private-window] +Name=Open a New Private Window +Exec=zen-twilight --private-window %u + +[Desktop Action profilemanager] +Name=Open the Profile Manager +Exec=zen-twilight --ProfileManager %u \ No newline at end of file diff --git a/package.nix b/package.nix index 3702902..5a99fbd 100644 --- a/package.nix +++ b/package.nix @@ -52,7 +52,7 @@ in inherit (variant) version; src = builtins.fetchTarball {inherit (variant) url sha256;}; - desktopSrc = ./.; + desktopSrc = ./assets/desktop; nativeBuildInputs = [ wrapGAppsHook3 @@ -92,6 +92,8 @@ in # ! twilight and beta could collide if both are installed ln -s "$out/bin/${binaryName}" "$out/bin/zen" + install -D $desktopSrc/${desktopFile} $out/share/applications/${desktopFile} + mkdir -p "$out/lib/zen-${variant.version}/distribution" ln -s ${policiesJson} "$out/lib/zen-${variant.version}/distribution/policies.json"