diff options
| author | TheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com> | 2025-11-22 11:47:45 +0900 |
|---|---|---|
| committer | TheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com> | 2025-11-22 11:47:46 +0900 |
| commit | d45432c236033f6df3530e823a8a9df2652ed5e7 (patch) | |
| tree | fd4b5417e363f5a8ba6701a95b3c64fe41bf7bf7 | |
| parent | d5386e6f3fd38fefcbc386ce91c5ddbdaa969ffe (diff) | |
modified bin/fzffiles, modified bin/fzffiles
| -rwxr-xr-x | ar/.local/bin/fzffiles | 25 | ||||
| -rwxr-xr-x | mac/.local/bin/fzffiles | 25 |
2 files changed, 4 insertions, 46 deletions
diff --git a/ar/.local/bin/fzffiles b/ar/.local/bin/fzffiles index b98eee9..44634a2 100755 --- a/ar/.local/bin/fzffiles +++ b/ar/.local/bin/fzffiles @@ -11,15 +11,7 @@ IFS=' files=$(fzf-tmux \ --header "^a pwd ^b public ^d .dotfiles ^f configs ^g git ^h home ^k desktop ^r scripts ^s suckless ^u staged files ^v private ^/ help" \ --preview "selection={}; - clean=\"\$selection\"; - for icon in 📄 ✏️ ✅ ❌ 🔀 ❓; do - case \"\$clean\" in - \"\$icon \"*) - clean=\${clean#\"\$icon \"} - break - ;; - esac - done; + clean=\$(printf '%s' \"\$selection\" | sed -e 's/^📄 //' -e 's/^✏️ //' -e 's/^✅ //' -e 's/^❌ //' -e 's/^🔀 //' -e 's/^❓ //'); [ -z \"\$clean\" ] && { echo 'No selection'; exit 0; } target=\$(readlink -f \"\$clean\" 2>/dev/null || printf '%s' \"\$clean\"); if [ -z \"\$target\" ]; then @@ -93,20 +85,7 @@ files=$(fzf-tmux \ # Check if any files were selected, and exit if not [ -z "$files" ] && exit 0 -cleaned_files=$(printf '%s\n' "$files" | while IFS= read -r line; do - stripped="$line" - for icon in 📄 ✏️ ✅ ❌ 🔀 ❓; do - case "$stripped" in - "$icon "*) - stripped=${stripped#"$icon "} - break - ;; - esac - done - printf '%s\n' "$stripped" -done) - -files="$cleaned_files" +files=$(printf '%s\n' "$files" | sed -e 's/^📄 //' -e 's/^✏️ //' -e 's/^✅ //' -e 's/^❌ //' -e 's/^🔀 //' -e 's/^❓ //') if [ -d "$files" ]; then absolute_files=$(realpath $files) diff --git a/mac/.local/bin/fzffiles b/mac/.local/bin/fzffiles index e695c55..44634a2 100755 --- a/mac/.local/bin/fzffiles +++ b/mac/.local/bin/fzffiles @@ -11,15 +11,7 @@ IFS=' files=$(fzf-tmux \ --header "^a pwd ^b public ^d .dotfiles ^f configs ^g git ^h home ^k desktop ^r scripts ^s suckless ^u staged files ^v private ^/ help" \ --preview "selection={}; - clean=\"\$selection\"; - for icon in 📄 ✏️ ✅ ❌ 🔀 ❓; do - case \"\$clean\" in - \"\$icon \"*) - clean=\${clean#\"\$icon \"} - break - ;; - esac - done; + clean=\$(printf '%s' \"\$selection\" | sed -e 's/^📄 //' -e 's/^✏️ //' -e 's/^✅ //' -e 's/^❌ //' -e 's/^🔀 //' -e 's/^❓ //'); [ -z \"\$clean\" ] && { echo 'No selection'; exit 0; } target=\$(readlink -f \"\$clean\" 2>/dev/null || printf '%s' \"\$clean\"); if [ -z \"\$target\" ]; then @@ -93,20 +85,7 @@ files=$(fzf-tmux \ # Check if any files were selected, and exit if not [ -z "$files" ] && exit 0 -cleaned_files=$(printf '%s\n' "$files" | while IFS= read -r line; do - stripped="$line" - for icon in 📄 ✏️ ✅ ❌ 🔀 ❓; do - case "$stripped" in - "$icon "*) - stripped=${stripped#"$icon "} - break - ;; - esac - done - printf '%s\n' "$stripped" -done) - -files="$cleaned_files" +files=$(printf '%s\n' "$files" | sed -e 's/^📄 //' -e 's/^✏️ //' -e 's/^✅ //' -e 's/^❌ //' -e 's/^🔀 //' -e 's/^❓ //') if [ -d "$files" ]; then absolute_files=$(realpath $files) |
