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