rofi: sandbox, and launch apps via xdg-open or gdbus

This commit is contained in:
Colin 2024-02-27 18:28:50 +00:00
parent 20a1aeb5b3
commit 36f6c72183
2 changed files with 24 additions and 0 deletions

View File

@ -16,6 +16,7 @@ configuration {
directory: "/home";
/* display-name: text to prepend in combi mode */
display-name: "/";
command: "xdg-open";
}
drun {
display-name: " ";
@ -27,6 +28,9 @@ configuration {
/* combi-display-format: "{text}"; */
combi-display-format: "{mode}{text}";
/* launch applications via xdg-desktop-portal */
run-command: "gdbus call --session --timeout 10 --dest org.freedesktop.portal.Desktop --object-path /org/freedesktop/portal/desktop --method org.freedesktop.portal.DynamicLauncher.Launch {app_id}.desktop {}";
drun-use-desktop-cache: true;
}

View File

@ -49,6 +49,26 @@
});
};
suggestedPrograms = [
"xdg-utils"
"gdbus"
];
sandbox.method = "bwrap";
sandbox.wrapperType = "wrappedDerivation";
sandbox.whitelistDbus = [ "user" ]; #< to launch apps via the portal
sandbox.whitelistWayland = true;
sandbox.extraHomePaths = [
".local/share/applications" #< to locate .desktop files
"Music"
"Pictures"
"Pictures/servo-macros"
"Videos"
"Videos/servo"
"knowledge"
"tmp"
];
fs.".config/rofi/config.rasi".symlink.target = ./config.rasi;
# redirect its default drun cache location
fs.".cache/rofi3.druncache".symlink.target = "rofi/rofi3.druncache";