fix: firefox desktop entry offload patch

This commit is contained in:
DACHXY 2025-01-08 14:23:03 +08:00
parent 5a0f9f2992
commit 6f4a849ddb
8 changed files with 66 additions and 2 deletions

View file

@ -12,6 +12,7 @@
./hyprland.nix
./swaync.nix
./neovim.nix
./desktop.nix
inputs.hyprland.homeManagerModules.default
];

50
home/user/desktop.nix Normal file
View file

@ -0,0 +1,50 @@
{
nvidia-offload-enabled,
lib,
pkgs,
...
}:
let
offloadScript = import ../../system/modules/offload.nix { inherit pkgs; };
launcher = "${offloadScript}/bin/offload firefox";
in
with lib;
{
xdg.desktopEntries = lib.mkIf nvidia-offload-enabled {
firefox = {
actions = {
"new-private-window" = {
exec = "${launcher} --private-window %U";
name = "New Private Window";
};
"new-window" = {
exec = "${launcher} --new-window %U";
name = "New Window";
};
"profile-manager-window" = {
exec = "${launcher} --ProfileManager";
name = "Profile Manager";
};
};
exec = "${launcher} --name firefox %U";
categories = [
"Network"
"WebBrowser"
];
genericName = "Web Browser";
name = "Firefox";
startupNotify = true;
terminal = false;
type = "Application";
icon = "firefox";
mimeType = [
"text/html"
"text/xml"
"application/xhtml+xml"
"application/vnd.mozilla.xul+xml"
"x-scheme-handler/http"
"x-scheme-handler/https"
];
};
};
}

View file

@ -53,6 +53,7 @@ in
pyright
hadolint
yaml-language-server
nodePackages_latest.typescript
];
programs.neovim = {

View file

@ -55,5 +55,4 @@ in
};
};
};
}