revert: remove yazi image saving feature and portal changes

This commit is contained in:
kenji
2026-01-11 11:18:50 -06:00
parent d9f848f626
commit a793429622
4 changed files with 2 additions and 91 deletions
-3
View File
@@ -43,9 +43,6 @@
bind K tabprev
unbind <C-e>
" Hint images and save using Yazi picker
bind ;y hint -i -c native yazi-img-save
" Force Tridactyl to yield new tab control to Firefox/Extensions
set newtab about:newtab
'';
-8
View File
@@ -4,14 +4,6 @@
];
windowrulev2 = [
"suppressevent maximize, class:.*"
# --- YAZI FILE PICKER ---
"float, class:^(yazi-picker)$"
"center, class:^(yazi-picker)$"
"size 60% 60%, class:^(yazi-picker)$"
"dimaround, class:^(yazi-picker)$"
];
};
}
+1 -68
View File
@@ -1,67 +1,4 @@
{
pkgs,
config,
...
}: let
yazi-img-save = pkgs.writeShellScriptBin "yazi-img-save" ''
echo "--- $(date) ---" >> /tmp/yazi-save.log
echo "Args: $@" >> /tmp/yazi-save.log
url="$1"
if [ -z "$url" ]; then
${pkgs.libnotify}/bin/notify-send "Yazi Save" "No URL provided"
echo "Error: No URL provided" >> /tmp/yazi-save.log
exit 1
fi
# Create a temp file to store the chosen directory
out=$(mktemp)
echo "Launching ghostty..." >> /tmp/yazi-save.log
${pkgs.ghostty}/bin/ghostty --class="yazi-picker" --title="Pick Save Folder" -e ${pkgs.yazi}/bin/yazi . --chooser-file="$out"
if [ -f "$out" ]; then
selected=$(cat "$out")
rm "$out"
echo "Selected: $selected" >> /tmp/yazi-save.log
if [ -n "$selected" ]; then
# If selected is a file, get its directory.
if [ -f "$selected" ]; then
target_dir=$(dirname "$selected")
elif [ -d "$selected" ]; then
target_dir="$selected"
else
# fallback
target_dir="$HOME/Downloads"
fi
echo "Target Dir: $target_dir" >> /tmp/yazi-save.log
${pkgs.libnotify}/bin/notify-send "Downloading..." "$url"
# Download
cd "$target_dir"
echo "Downloading with wget..." >> /tmp/yazi-save.log
${pkgs.wget}/bin/wget --content-disposition --no-clobber "$url"
ret=$?
if [ $ret -eq 0 ]; then
${pkgs.libnotify}/bin/notify-send "Download Complete" "Saved to $target_dir"
echo "Download success" >> /tmp/yazi-save.log
else
${pkgs.libnotify}/bin/notify-send -u critical "Download Failed" "wget exit code: $ret"
echo "Download failed: $ret" >> /tmp/yazi-save.log
fi
else
echo "No selection made" >> /tmp/yazi-save.log
fi
else
echo "No output file" >> /tmp/yazi-save.log
fi
'';
in {
{pkgs, ...}: {
programs.yazi = {
enable = true;
enableFishIntegration = true;
@@ -74,8 +11,4 @@ in {
};
};
};
home.packages = [
yazi-img-save
];
}
+1 -12
View File
@@ -24,15 +24,4 @@
default = ["${myConfig.terminal.default}"];
};
};
xdg.portal = {
enable = true;
extraPortals = [
pkgs.xdg-desktop-portal-hyprland
];
config.common = {
default = ["hyprland"];
};
};
}
}