yazi cleanup, forget about termfilechooser it is a rabbit hole

This commit is contained in:
Matt Nish-Lapidus 2025-06-29 22:23:40 -04:00
parent 3efe104240
commit 359e58f469
9 changed files with 20 additions and 206 deletions

View file

@ -211,14 +211,6 @@
};
services = {
xdg-desktop-portal-termfilepickers = {
enable = true;
package = pkgs.xdg-desktop-portal-termfilepickers;
desktopEnvironments = [ "common" "niri" ];
config = {
terminal_command = lib.getExe pkgs.wezterm;
};
};
flatpak = {
enable = true;
packages = [
@ -256,25 +248,6 @@
# xdg.configFile."wpaperd/config.toml".source = ../../homes/emenel/dotfiles/dot_config/wpaperd/config.toml;
home.file.".local/wallpapers".source = ../../assets/wallpapers;
# xdg.mime = {
# enable = true;
# };
# xdg.mimeApps = {
# enable = true;
# defaultApplications = {
# "application/pdf" = [ "zen-twilight.desktop" ];
# };
# associations = {
# added = {
# "application/pdf" = [ "zen-twilight.desktop" ];
# };
# removed = {
# "application/pdf" = [ "chromium-browser.desktop" ];
# };
# };
# };
xdg.portal = {
enable = true;
configPackages = [ pkgs.niri-unstable ];
@ -284,12 +257,9 @@
xdg-desktop-portal
xdg-desktop-portal-wlr
gnome-keyring
xdg-desktop-portal-termfilepickers
];
};
# home.sessionVariables.TERMCMD = "wezterm --class=file_chooser";
xdg.desktopEntries = {
rmpc = {
name = "rmpc (music player)";
@ -329,5 +299,5 @@
};
xdg.configFile."halloy/config.toml".source = ../../homes/emenel/dotfiles/dot_config/halloy/config.toml;
# xdg.configFile."nyxt/config.lisp".source = ../../homes/emenel/dotfiles/dot_config/nyxt/config.lisp;
xdg.configFile."nyxt/config.lisp".source = ../../homes/emenel/dotfiles/dot_config/nyxt/config.lisp;
}

View file

@ -1,5 +0,0 @@
### $XDG_CONFIG_HOME/xdg-desktop-portal-termfilechooser/config ###
[filechooser]
cmd=$HOME/.config/xdg-desktop-portal-termfilechooser/yazi-wrapper.sh
default_dir=$HOME

View file

@ -1,29 +0,0 @@
#!/usr/bin/env sh
set -ex
multiple="$1"
directory="$2"
save="$3"
path="$4"
out="$5"
cmd="yazi"
termcmd="${TERMCMD:-$HOME/.local/bin/wezlauncher}"
if [ "$save" = "1" ]; then
set -- --chooser-file="$out" "$path"
elif [ "$directory" = "1" ]; then
set -- --chooser-file="$out" --cwd-file="$out" "$path"
elif [ "$multiple" = "1" ]; then
set -- --chooser-file="$out" "$path"
else
set -- --chooser-file="$out" "$path"
fi
command="$termcmd $cmd"
for arg in "$@"; do
escaped=$(printf "%s" "$arg" | sed 's/"/\\"/g')
command="$command \"$escaped\""
done
sh -c "$command"

View file

@ -106,6 +106,9 @@
};
};
};
nushell = {
enable = true;
};
fish = {
enable = true;
shellAliases = {

View file

@ -154,15 +154,6 @@
linemode = "time_and_size";
show_symlink = true;
};
opener = {
edit = [
{ run = "emacsclient -r \"$@\""; desc = "emacsclient"; orphan = true; block = false; }
{ run = "nano \"$@\""; desc = "nano"; orphan = false; block = true; }
];
extract = [
{ run = "ouch d -y \"$@\""; desc = "Extract here with ouch"; }
];
};
open = {
prepend_rules = [
{ name = "*.zip"; use = "extract"; }
@ -184,12 +175,12 @@
prepend_previewers = [
{ mime = "audio/*"; run = "exifaudio"; }
# { name = "*.csv"; run = "rich-preview"; }
# { name = "*.md"; run = "rich-preview" ; }
# { name = "*.rst"; run = "rich-preview"; }
# { name = "*.ipynb"; run = "rich-preview"; }
# { name = "*.json"; run = "rich-preview"; }
# { name = "*.org"; run = "rich-preview"; }
{ name = "*.csv"; run = "rich-preview"; }
{ name = "*.md"; run = "rich-preview" ; }
{ name = "*.rst"; run = "rich-preview"; }
{ name = "*.ipynb"; run = "rich-preview"; }
{ name = "*.json"; run = "rich-preview"; }
{ name = "*.org"; run = "rich-preview"; }
# Office Documents
{ mime = "application/openxmlformats-officedocument.*"; run = "office"; }
@ -221,16 +212,16 @@
# run = "mime-ext";
# prio = "high";
# }
# {
# id = "git";
# name = "*";
# run = "git";
# }
# {
# id = "git";
# name = "*/";
# run = "git";
# }
{
id = "git";
name = "*";
run = "git";
}
{
id = "git";
name = "*/";
run = "git";
}
];
};
tasks = {
@ -242,6 +233,4 @@
xdg.configFile."yazi/theme.toml".source = ./yazi/theme.toml;
xdg.configFile."yazi/flavors".source = ./yazi/flavors;
# xdg.configFile."xdg-desktop-portal-termfilechooser/config".source = ./file-chooser/config;
# xdg.configFile."xdg-desktop-portal-termfilechooser/yazi-wrapper.sh".source = ./file-chooser/yazi-wrapper.sh;
}