rofi: split sane-open-desktop
out as a helper
This commit is contained in:
parent
e7430c41f9
commit
daab5939e7
|
@ -757,6 +757,11 @@ in
|
|||
|
||||
rustc = {};
|
||||
|
||||
sane-open-desktop.sandbox.enable = false; #< trivial script, and all our deps are sandboxed
|
||||
sane-open-desktop.suggestedPrograms = [
|
||||
"gdbus"
|
||||
];
|
||||
|
||||
screen.sandbox.enable = false; #< tty; needs to run anything
|
||||
|
||||
sequoia.sandbox.method = "bwrap"; # TODO:sandbox: untested
|
||||
|
|
|
@ -106,12 +106,12 @@ in
|
|||
packageUnwrapped = pkgs.static-nix-shell.mkBash {
|
||||
pname = "rofi-run-command";
|
||||
srcRoot = ./.;
|
||||
pkgs = [ "glib" "xdg-utils" ];
|
||||
pkgs = [ "sane-open-desktop" "xdg-utils" ];
|
||||
};
|
||||
sandbox.enable = false; #< trivial script, and all our deps are sandboxed
|
||||
|
||||
suggestedPrograms = [
|
||||
"gdbus"
|
||||
"sane-open-desktop"
|
||||
"xdg-utils"
|
||||
];
|
||||
};
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#!/usr/bin/env nix-shell
|
||||
#!nix-shell -i bash -p glib -p xdg-utils
|
||||
#!nix-shell -i bash -p sane-open-desktop -p xdg-utils
|
||||
|
||||
# use:
|
||||
# rofi-run-command <handler>.desktop [cmd [args ...]]
|
||||
|
@ -14,11 +14,7 @@ shift
|
|||
binArgs=("$@")
|
||||
|
||||
if [ "$desktop" != .desktop ]; then
|
||||
exec gdbus call --session --timeout 10 \
|
||||
--dest org.freedesktop.portal.Desktop \
|
||||
--object-path /org/freedesktop/portal/desktop \
|
||||
--method org.freedesktop.portal.DynamicLauncher.Launch \
|
||||
"$desktop" {}
|
||||
exec sane-open-desktop "$desktop"
|
||||
elif [ "$binary" = "xdg-open" ]; then
|
||||
exec xdg-open "$@"
|
||||
fi
|
||||
|
|
6
pkgs/additional/sane-open-desktop/default.nix
Normal file
6
pkgs/additional/sane-open-desktop/default.nix
Normal file
|
@ -0,0 +1,6 @@
|
|||
{ static-nix-shell }:
|
||||
static-nix-shell.mkBash {
|
||||
pname = "sane-open-desktop";
|
||||
srcRoot = ./.;
|
||||
pkgs = [ "glib" ];
|
||||
}
|
12
pkgs/additional/sane-open-desktop/sane-open-desktop
Executable file
12
pkgs/additional/sane-open-desktop/sane-open-desktop
Executable file
|
@ -0,0 +1,12 @@
|
|||
#!/usr/bin/env nix-shell
|
||||
#!nix-shell -i bash -p glib
|
||||
|
||||
# usage: sane-open-desktop org.my.desktop
|
||||
# given some .desktop file (by name, not by path), ask the xdg-desktop-portal service to open it
|
||||
|
||||
exec gdbus call --session --timeout 10 \
|
||||
--dest org.freedesktop.portal.Desktop \
|
||||
--object-path /org/freedesktop/portal/desktop \
|
||||
--method org.freedesktop.portal.DynamicLauncher.Launch \
|
||||
"$1" {}
|
||||
|
|
@ -56,6 +56,7 @@ let
|
|||
pipeline = callPackage ./additional/pipeline { };
|
||||
rtl8723cs-firmware = callPackage ./additional/rtl8723cs-firmware { };
|
||||
rtl8723cs-wowlan = callPackage ./additional/rtl8723cs-wowlan { };
|
||||
sane-open-desktop = callPackage ./additional/sane-open-desktop { };
|
||||
sane-scripts = lib.recurseIntoAttrs (callPackage ./additional/sane-scripts { });
|
||||
sane-weather = callPackage ./additional/sane-weather { };
|
||||
signal-desktop-from-src = callPackage ./additional/signal-desktop-from-src { };
|
||||
|
|
Loading…
Reference in New Issue
Block a user