diff --git a/apps/yazi/default.nix b/apps/yazi/default.nix index c76f49a..23f6e85 100644 --- a/apps/yazi/default.nix +++ b/apps/yazi/default.nix @@ -4,29 +4,34 @@ ... }: let yazi-picker = pkgs.writeShellScriptBin "yazi-picker" '' + echo "--- $(date) ---" >> /tmp/yazi-picker.log + echo "Args: $@" >> /tmp/yazi-picker.log + path="$1" [ -z "$path" ] && path="." if [ "$2" = "true" ]; then - # Save file mode - # In save mode, we might want to just open the directory, - # but yazi --chooser-file works for picking a file to overwrite or a directory. - # For a "Save As" flow where you type a name, standard yazi chooser might be limited - # without custom lua, but selecting a directory works. - # For now, treat same as open. - : + echo "Mode: Save" >> /tmp/yazi-picker.log + # Future: handle save mode better (maybe prompts?) + else + echo "Mode: Open" >> /tmp/yazi-picker.log fi out="$HOME/.cache/yazi-chooser" rm -f "$out" - # We need to block until ghostty closes, or use --wait if available/default behavior. - # Ghostty -e does not automatically detach, so it should block. + echo "Launching ghostty..." >> /tmp/yazi-picker.log ${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 - cat "$out" + selected=$(cat "$out") + echo "Selected: $selected" >> /tmp/yazi-picker.log + echo "$selected" rm "$out" + else + echo "No selection" >> /tmp/yazi-picker.log fi ''; in { diff --git a/modules/nixos/hyprland.nix b/modules/nixos/hyprland.nix index 612658e..40fbb2e 100644 --- a/modules/nixos/hyprland.nix +++ b/modules/nixos/hyprland.nix @@ -33,7 +33,7 @@ ]; config.common = { default = ["hyprland"]; - "org.freedesktop.impl.portal.FileChooser" = "termfilechooser"; + "org.freedesktop.impl.portal.FileChooser" = ["termfilechooser"]; }; }; } \ No newline at end of file