Updated mainly terminal filchooser from browser
This commit is contained in:
@@ -48,6 +48,27 @@
|
||||
XDG_PICTURES_DIR="$HOME/Pictures"
|
||||
XDG_VIDEOS_DIR="$HOME/Videos"
|
||||
'';
|
||||
|
||||
yaziWrapper = pkgs.writeShellScriptBin "yazi-wrapper" ''
|
||||
set -e
|
||||
|
||||
multiple="$1"
|
||||
directory="$2"
|
||||
save="$3"
|
||||
path="$4"
|
||||
out="$5"
|
||||
|
||||
# We use alacritty directly to run yazi
|
||||
# For saving (save=1), yazi is passed the directory and we write the final path output
|
||||
# For directories (directory=1), we pass yazi the dir selection flag
|
||||
if [ "$save" = "1" ]; then
|
||||
exec ${pkgs.alacritty}/bin/alacritty -e ${pkgs.yazi}/bin/yazi --chooser-file="$out" "$path"
|
||||
elif [ "$directory" = "1" ]; then
|
||||
exec ${pkgs.alacritty}/bin/alacritty -e ${pkgs.yazi}/bin/yazi --chooser-file="$out" --cwd-file="$out"".1" "$path"
|
||||
else
|
||||
exec ${pkgs.alacritty}/bin/alacritty -e ${pkgs.yazi}/bin/yazi --chooser-file="$out" "$path"
|
||||
fi
|
||||
'';
|
||||
in {
|
||||
users.users.someone.packages = with pkgs; [
|
||||
xdg-utils
|
||||
@@ -59,6 +80,13 @@ in {
|
||||
enable = true;
|
||||
defaultApplications = associations;
|
||||
};
|
||||
configFile."xdg-desktop-portal-termfilechooser/config".text = ''
|
||||
[filechooser]
|
||||
cmd=${yaziWrapper}/bin/yazi-wrapper
|
||||
default_dir=$HOME
|
||||
open_mode=suggested
|
||||
save_mode=suggested
|
||||
'';
|
||||
configFile."user-dirs.dirs".source = userDirsConfig;
|
||||
configFile."mimeapps.list".text = ''
|
||||
[Default Applications]
|
||||
|
||||
Reference in New Issue
Block a user