diff options
Diffstat (limited to 'env/.config/lf')
| -rwxr-xr-x | env/.config/lf/lfrc | 54 |
1 files changed, 29 insertions, 25 deletions
diff --git a/env/.config/lf/lfrc b/env/.config/lf/lfrc index d8d72f0..90a49fd 100755 --- a/env/.config/lf/lfrc +++ b/env/.config/lf/lfrc @@ -111,21 +111,21 @@ cmd zip ${{ }} cmd trash ${{ - files=$(printf "$fx" | tr '\n' ';') - while [ "$files" ]; do - file=${files%%;*} + files=$(printf "$fx" | tr '\n' ';') + while [ "$files" ]; do + file=${files%%;*} - mv "$(basename "$file")" ~/.trash - if [ "$files" = "$file" ]; then - files='' - else - files="${files#*;}" - fi - done + mv "$(basename "$file")" ~/.trash + if [ "$files" = "$file" ]; then + files='' + else + files="${files#*;}" + fi + done }} cmd vim ${{ - nvim $f + nvim $f }} cmd Sxiv ${{ @@ -136,19 +136,19 @@ cmd clipf ${{ # printf "$f" | xclip -selection clipboard # xclip -selection clipboard -t "$(file -b --mime-type $f)" -i $f # echo -n '$f' | xclip -sel clip -t text/uri-list -i -case "$(file -b --mime-type $f)" in -image/png|image/jpeg|image/gif) - xclip -selection clipboard -t image/png -i $f - ;; -video/mp4) - # !! doesnt work. no clue how todo uri-list. ICCCM section 2.6.2 is confusing - # echo -n '$f' | xclip -selection clipboard -t x-special/gnome-copied-files -i - xclip -selection clipboard -t text/uri-list -i $f - ;; -*) - xclip -selection clipboard -t "$(file -b --mime-type $f)" -i $f - ;; -esac + case "$(file -b --mime-type $f)" in + image/png|image/jpeg|image/gif) + xclip -selection clipboard -t image/png -i $f + ;; + video/mp4) + # !! doesnt work. no clue how todo uri-list. ICCCM section 2.6.2 is confusing + # echo -n '$f' | xclip -selection clipboard -t x-special/gnome-copied-files -i + xclip -selection clipboard -t text/uri-list -i $f + ;; + *) + xclip -selection clipboard -t "$(file -b --mime-type $f)" -i $f + ;; + esac }} cmd clip-path ${{ @@ -160,7 +160,11 @@ cmd clip-path ${{ }} cmd filebrowser ${{ - nohup pcmanfm $f > /dev/null 2> /dev/null < /dev/null & disown + if [ "$(file -b --mime-type "$f")" == "inode/directory" ]; then + nohup pcmanfm -- "$f" > /dev/null 2> /dev/null < /dev/null & disown + else + nohup pcmanfm -- "$(dirname -- $f)" > /dev/null 2> /dev/null < /dev/null & disown + fi }} map DD trash |
