Keep Chrome launcher new-window action

This commit is contained in:
2026-05-31 23:51:00 -07:00
parent 3e14320f36
commit 38d57d1c0e
3 changed files with 11 additions and 1 deletions

View File

@@ -59,6 +59,9 @@ in
cp "${prev.google-chrome}/share/applications/$desktopName" "$desktopFile"
substituteInPlace "$desktopFile" \
--replace-fail "${prev.google-chrome}/bin/google-chrome-stable" "$out/bin/google-chrome-stable"
${final.gnused}/bin/sed -i \
'/^\[Desktop Action new-window\]/,/^\[Desktop Action / s#^Exec=\(.*google-chrome-stable\)$#Exec=\1 --new-window#' \
"$desktopFile"
substituteInPlace "$desktopFile" \
--replace-fail "image/gif;" "" \
--replace-fail "image/jpeg;" "" \

View File

@@ -42,6 +42,9 @@
--replace-fail \
"Exec=${pkgs.google-chrome}/bin/google-chrome-stable" \
"Exec=$out/bin/google-chrome-stable"
${pkgs.gnused}/bin/sed -i \
'/^\[Desktop Action new-window\]/,/^\[Desktop Action / s#^Exec=\(.*google-chrome-stable\)$#Exec=\1 --new-window#' \
"$desktop_file"
'';
};
rlruPackages = inputs.rlru.packages.${pkgs.stdenv.hostPlatform.system};

View File

@@ -238,7 +238,7 @@ in {
inherit defaultApplications;
};
home.activation.refreshChromeDesktopMimeCache = lib.hm.dag.entryAfter ["writeBoundary"] ''
home.activation.refreshChromeDesktopLaunchers = lib.hm.dag.entryAfter ["writeBoundary"] ''
applications_dir="$HOME/.local/share/applications"
if [ -d "$applications_dir" ]; then
@@ -254,6 +254,10 @@ in {
-e 's,image/png;,,g' \
-e 's,image/webp;,,g' \
"$desktop_file"
${pkgs.gnused}/bin/sed -i \
'/^\[Desktop Action new-window\]/,/^\[Desktop Action / s#^Exec=\(.*google-chrome-stable\)$#Exec=\1 --new-window#' \
"$desktop_file"
fi
done