fix(yazi): add debug logging and correct portal config
This commit is contained in:
+15
-10
@@ -4,29 +4,34 @@
|
|||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
yazi-picker = pkgs.writeShellScriptBin "yazi-picker" ''
|
yazi-picker = pkgs.writeShellScriptBin "yazi-picker" ''
|
||||||
|
echo "--- $(date) ---" >> /tmp/yazi-picker.log
|
||||||
|
echo "Args: $@" >> /tmp/yazi-picker.log
|
||||||
|
|
||||||
path="$1"
|
path="$1"
|
||||||
[ -z "$path" ] && path="."
|
[ -z "$path" ] && path="."
|
||||||
|
|
||||||
if [ "$2" = "true" ]; then
|
if [ "$2" = "true" ]; then
|
||||||
# Save file mode
|
echo "Mode: Save" >> /tmp/yazi-picker.log
|
||||||
# In save mode, we might want to just open the directory,
|
# Future: handle save mode better (maybe prompts?)
|
||||||
# but yazi --chooser-file works for picking a file to overwrite or a directory.
|
else
|
||||||
# For a "Save As" flow where you type a name, standard yazi chooser might be limited
|
echo "Mode: Open" >> /tmp/yazi-picker.log
|
||||||
# without custom lua, but selecting a directory works.
|
|
||||||
# For now, treat same as open.
|
|
||||||
:
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
out="$HOME/.cache/yazi-chooser"
|
out="$HOME/.cache/yazi-chooser"
|
||||||
rm -f "$out"
|
rm -f "$out"
|
||||||
|
|
||||||
# We need to block until ghostty closes, or use --wait if available/default behavior.
|
echo "Launching ghostty..." >> /tmp/yazi-picker.log
|
||||||
# Ghostty -e does not automatically detach, so it should block.
|
|
||||||
${pkgs.ghostty}/bin/ghostty --class="yazi-picker" --title="File Picker" -e ${pkgs.yazi}/bin/yazi "$path" --chooser-file="$out"
|
${pkgs.ghostty}/bin/ghostty --class="yazi-picker" --title="File Picker" -e ${pkgs.yazi}/bin/yazi "$path" --chooser-file="$out"
|
||||||
|
ret=$?
|
||||||
|
echo "Ghostty exited with $ret" >> /tmp/yazi-picker.log
|
||||||
|
|
||||||
if [ -f "$out" ]; then
|
if [ -f "$out" ]; then
|
||||||
cat "$out"
|
selected=$(cat "$out")
|
||||||
|
echo "Selected: $selected" >> /tmp/yazi-picker.log
|
||||||
|
echo "$selected"
|
||||||
rm "$out"
|
rm "$out"
|
||||||
|
else
|
||||||
|
echo "No selection" >> /tmp/yazi-picker.log
|
||||||
fi
|
fi
|
||||||
'';
|
'';
|
||||||
in {
|
in {
|
||||||
|
|||||||
@@ -33,7 +33,7 @@
|
|||||||
];
|
];
|
||||||
config.common = {
|
config.common = {
|
||||||
default = ["hyprland"];
|
default = ["hyprland"];
|
||||||
"org.freedesktop.impl.portal.FileChooser" = "termfilechooser";
|
"org.freedesktop.impl.portal.FileChooser" = ["termfilechooser"];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user