sane-open: associate as the default launcher for .desktop files
This commit is contained in:
parent
536eb2154a
commit
eadf85f66d
|
@ -770,21 +770,6 @@ in
|
||||||
|
|
||||||
sane-die-with-parent.sandbox.enable = false; #< it's a launcher; can't sandbox
|
sane-die-with-parent.sandbox.enable = false; #< it's a launcher; can't sandbox
|
||||||
|
|
||||||
sane-open.sandbox.method = "bwrap";
|
|
||||||
sane-open.sandbox.autodetectCliPaths = "existing"; # for when opening a file
|
|
||||||
sane-open.sandbox.whitelistDbus = [ "user" ];
|
|
||||||
sane-open.sandbox.extraConfig = [
|
|
||||||
"--sane-sandbox-keep-namespace" "pid" # to toggle keyboard
|
|
||||||
];
|
|
||||||
sane-open.sandbox.extraHomePaths = [
|
|
||||||
".local/share/applications"
|
|
||||||
];
|
|
||||||
sane-open.sandbox.extraRuntimePaths = [ "sway" ];
|
|
||||||
sane-open.suggestedPrograms = [
|
|
||||||
"gdbus"
|
|
||||||
"xdg-utils"
|
|
||||||
];
|
|
||||||
|
|
||||||
screen.sandbox.enable = false; #< tty; needs to run anything
|
screen.sandbox.enable = false; #< tty; needs to run anything
|
||||||
|
|
||||||
sequoia.sandbox.method = "bwrap"; # TODO:sandbox: untested
|
sequoia.sandbox.method = "bwrap"; # TODO:sandbox: untested
|
||||||
|
|
|
@ -101,6 +101,7 @@
|
||||||
./rtkit.nix
|
./rtkit.nix
|
||||||
./s6-rc.nix
|
./s6-rc.nix
|
||||||
./sane-input-handler
|
./sane-input-handler
|
||||||
|
./sane-open.nix
|
||||||
./sane-sandboxed.nix
|
./sane-sandboxed.nix
|
||||||
./sane-screenshot.nix
|
./sane-screenshot.nix
|
||||||
./sane-scripts.nix
|
./sane-scripts.nix
|
||||||
|
|
21
hosts/common/programs/sane-open.nix
Normal file
21
hosts/common/programs/sane-open.nix
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
{ ... }:
|
||||||
|
{
|
||||||
|
sane.programs.sane-open = {
|
||||||
|
sandbox.method = "bwrap";
|
||||||
|
sandbox.autodetectCliPaths = "existing"; # for when opening a file
|
||||||
|
sandbox.whitelistDbus = [ "user" ];
|
||||||
|
sandbox.extraConfig = [
|
||||||
|
"--sane-sandbox-keep-namespace" "pid" # to toggle keyboard
|
||||||
|
];
|
||||||
|
sandbox.extraHomePaths = [
|
||||||
|
".local/share/applications"
|
||||||
|
];
|
||||||
|
sandbox.extraRuntimePaths = [ "sway" ];
|
||||||
|
suggestedPrograms = [
|
||||||
|
"gdbus"
|
||||||
|
"xdg-utils"
|
||||||
|
];
|
||||||
|
|
||||||
|
mime.associations."application/x-desktop" = "sane-open-application.desktop";
|
||||||
|
};
|
||||||
|
}
|
|
@ -1,6 +1,20 @@
|
||||||
{ static-nix-shell }:
|
{ static-nix-shell
|
||||||
|
, copyDesktopItems
|
||||||
|
, makeDesktopItem
|
||||||
|
}:
|
||||||
static-nix-shell.mkBash {
|
static-nix-shell.mkBash {
|
||||||
pname = "sane-open";
|
pname = "sane-open";
|
||||||
srcRoot = ./.;
|
srcRoot = ./.;
|
||||||
pkgs = [ "glib" "jq" "procps" "sway" "util-linux" "xdg-utils" ];
|
pkgs = [ "glib" "jq" "procps" "sway" "util-linux" "xdg-utils" ];
|
||||||
|
nativeBuildInputs = [
|
||||||
|
copyDesktopItems
|
||||||
|
];
|
||||||
|
desktopItems = [
|
||||||
|
(makeDesktopItem {
|
||||||
|
name = "sane-open-application";
|
||||||
|
exec = "sane-open --application %f";
|
||||||
|
desktopName = ".desktop launcher";
|
||||||
|
noDisplay = true;
|
||||||
|
})
|
||||||
|
];
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user