diff --git a/nix-shared/overlays/default.nix b/nix-shared/overlays/default.nix index 87989b25..5a3fb895 100644 --- a/nix-shared/overlays/default.nix +++ b/nix-shared/overlays/default.nix @@ -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;" "" \ diff --git a/nixos/desktop.nix b/nixos/desktop.nix index 7693fe85..3207c27b 100644 --- a/nixos/desktop.nix +++ b/nixos/desktop.nix @@ -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}; diff --git a/nixos/home-manager.nix b/nixos/home-manager.nix index 40ce8082..0302f9ab 100644 --- a/nixos/home-manager.nix +++ b/nixos/home-manager.nix @@ -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