diff options
| author | TheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com> | 2025-11-13 16:56:35 +0900 |
|---|---|---|
| committer | TheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com> | 2025-11-13 16:56:35 +0900 |
| commit | 34b7edfdc570493440caea825456a194324d64f7 (patch) | |
| tree | e5de502af0e558881f19bcf0b79fa5761fa6f5e0 /ar | |
| parent | 0a91d0a350e8ac861b37def03f4a3162954ceda9 (diff) | |
modified bin/fzffiles, modified bin/fzffiles
Diffstat (limited to 'ar')
| -rwxr-xr-x | ar/.local/bin/fzffiles | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/ar/.local/bin/fzffiles b/ar/.local/bin/fzffiles index d092596..d3255af 100755 --- a/ar/.local/bin/fzffiles +++ b/ar/.local/bin/fzffiles @@ -32,7 +32,20 @@ files=$(fzf-tmux \ --bind "ctrl-k:change-prompt( 🖥️ )+reload(fd -H -L -t f -E .Trash -E .git -E .cache . ${XDG_DESKTOP_DIR:-${HOME}/Desktop})" \ --bind "ctrl-r:change-prompt( 👟 )+reload(fd -H -L -t f -E .Trash -E .git -E .cache -E zsh . ${XDG_BIN_HOME:-${HOME}/.local/bin})" \ --bind "ctrl-s:change-prompt( 🛠 )+reload(find ${XDG_SOURCES_HOME:-${HOME}/.local/src}/suckless -maxdepth 2 -type f -not -path '*/.git/*')" \ - --bind "ctrl-u:change-prompt( 📝 )+reload(if git rev-parse --is-inside-work-tree >/dev/null 2>&1; then git -C $(git rev-parse --show-toplevel 2>/dev/null) status -s | awk -v pwd=\"$PWD\" '{print pwd \"\/\" \$2}' | grep -v '^$'; else echo 'This is not a git repository.'; fi)" \ + --bind "ctrl-u:change-prompt( 📝 )+reload(if git rev-parse --is-inside-work-tree >/dev/null 2>&1; then top=\$(git rev-parse --show-toplevel 2>/dev/null); git -C \"\$top\" status --porcelain | awk -v root=\"\$top\" '{ + staged=substr(\$0,1,1); + unstaged=substr(\$0,2,1); + file=substr(\$0,4); + gsub(/^ +/, \"\", file); + if (file == \"\") next; + if (staged == \"?\" && unstaged == \"?\") icon=\"🆕\"; + else if (staged == \"!\" && unstaged == \"!\") icon=\"🚫\"; + else if (staged != \" \" && staged != \"?\" && unstaged != \" \" && unstaged != \"?\") icon=\"🟪\"; + else if (staged != \" \" && staged != \"?\") icon=\"🟩\"; + else if (unstaged != \" \") icon=\"🟥\"; + else icon=\"❓\"; + print icon \" \" root \"/\" file + }'; else echo 'This is not a git repository.'; fi)" \ --bind "ctrl-v:change-prompt( 🔒 )+reload(fd -H -L -t f -E .Trash -E .git -E .cache . $HOME/Private)" \ --bind 'ctrl-/:change-prompt( ❓ )+reload(echo "^a all ^b public @@ -49,6 +62,8 @@ files=$(fzf-tmux \ # Check if any files were selected, and exit if not [ -z "$files" ] && exit 0 +files=$(printf '%s\n' "$files" | sed 's/^[🟩🟥🟪🆕🚫❓] //') + if [ -d "$files" ]; then absolute_files=$(realpath $files) if echo "$absolute_files" | while read -r file; do file --mime-type "$file" | grep -q 'video/'; done; then |
