xdg-portal: use termfilechooser

This commit is contained in:
wo2w 2026-02-14 16:53:21 -05:00
parent 5cb4aa2a92
commit ad82940851
4 changed files with 25 additions and 9 deletions

View file

@ -9,6 +9,7 @@
./hyprlock.nix ./hyprlock.nix
./mako.nix ./mako.nix
./swaybg.nix ./swaybg.nix
./termfilechooser.nix
./tuigreet.nix ./tuigreet.nix
./yazi.nix ./yazi.nix
]; ];

View file

@ -17,12 +17,8 @@
]; ];
xdg.portal = { xdg.portal = {
extraPortals = [ pkgs.kdePackages.xdg-desktop-portal-kde ];
config.niri = { config.niri = {
default = [ default = [ "gtk" ];
"kde"
"gtk"
];
"org.freedesktop.impl.portal.ScreenCast" = "gnome"; "org.freedesktop.impl.portal.ScreenCast" = "gnome";
"org.freedesktop.impl.portal.Secret" = "gnome-keyring"; "org.freedesktop.impl.portal.Secret" = "gnome-keyring";
}; };

View file

@ -3,10 +3,6 @@
{ {
home-manager.users.wo2w.programs.niri.settings.window-rules = [ home-manager.users.wo2w.programs.niri.settings.window-rules = [
# block sensitive applications from capture # block sensitive applications from capture
{
matches = [{ title = "^Bitwarden$"; }];
block-out-from = "screen-capture";
}
{ {
matches = [{ app-id = "^org.kde.polkit-kde-authentication-agent-1$"; }]; matches = [{ app-id = "^org.kde.polkit-kde-authentication-agent-1$"; }];
block-out-from = "screen-capture"; block-out-from = "screen-capture";
@ -26,6 +22,12 @@
}; };
} }
# open termfilechooser floating like a regular portal
{
matches = [{ title = "^termfilechooser$"; }];
open-floating = true;
}
{ {
matches = [{ app-id = "com.dec05eba.gpu_screen_recorder"; }]; matches = [{ app-id = "com.dec05eba.gpu_screen_recorder"; }];
open-floating = false; open-floating = false;

View file

@ -0,0 +1,17 @@
{ config, pkgs, lib, ... }:
{
xdg.portal = {
extraPortals = [ pkgs.xdg-desktop-portal-termfilechooser ];
config.niri."org.freedesktop.impl.portal.FileChooser" = "termfilechooser";
};
home-manager.users.wo2w.xdg.configFile."xdg-desktop-portal-termfilechooser/config".text = ''
[filechooser]
cmd=${pkgs.xdg-desktop-portal-termfilechooser}/share/xdg-desktop-portal-termfilechooser/yazi-wrapper.sh
default_dir=$HOME
env=TERMCMD='${lib.getExe pkgs.kitty} -T "termfilechooser"'
open_mode = suggested
save_mode = last
'';
}