readlink for fulldir

This commit is contained in:
Luke Smith 2019-01-06 14:18:49 -05:00
parent dd4ece50d8
commit cd839cb0d1

View file

@ -1,7 +1,6 @@
#!/bin/sh #!/bin/sh
while read file while read file
do do
fullpath="$(pwd)/$file"
case "$1" in case "$1" in
"w") "w")
cp "$file" ~/.config/wall.png && cp "$file" ~/.config/wall.png &&
@ -10,12 +9,12 @@ do
"c") "c")
[ -z "$destdir" ] && destdir="$(sed "s/\s.*#.*$//;/^\s*$/d" ~/.bmdirs | awk '{print $2}' | dmenu -l 20 -i -p "Copy file(s) to where?" | sed "s|~|$HOME|g")" [ -z "$destdir" ] && destdir="$(sed "s/\s.*#.*$//;/^\s*$/d" ~/.bmdirs | awk '{print $2}' | dmenu -l 20 -i -p "Copy file(s) to where?" | sed "s|~|$HOME|g")"
[ -z "$destdir" ] && exit [ -z "$destdir" ] && exit
cp "$file" "$destdir" && notify-send -i "$fullpath" "$file copied to $destdir." & cp "$file" "$destdir" && notify-send -i "$(readlink -f "$file")" "$file copied to $destdir." &
;; ;;
"m") "m")
[ -z "$destdir" ] && destdir="$(sed "s/\s.*#.*$//;/^\s*$/d" ~/.bmdirs | awk '{print $2}' | dmenu -l 20 -i -p "Move file(s) to where?" | sed "s|~|$HOME|g")" [ -z "$destdir" ] && destdir="$(sed "s/\s.*#.*$//;/^\s*$/d" ~/.bmdirs | awk '{print $2}' | dmenu -l 20 -i -p "Move file(s) to where?" | sed "s|~|$HOME|g")"
[ -z "$destdir" ] && exit [ -z "$destdir" ] && exit
cp "$file" "$destdir" && notify-send -i "$fullpath" "$file moved to $destdir." & mv "$file" "$destdir" && notify-send -i "$(readlink -f "$file")" "$file moved to $destdir." &
;; ;;
"r") "r")
convert -rotate 90 "$file" "$file" ;; convert -rotate 90 "$file" "$file" ;;
@ -27,8 +26,8 @@ do
echo -n "$file" | xclip -selection clipboard && echo -n "$file" | xclip -selection clipboard &&
notify-send "$file copied to clipboard" & ;; notify-send "$file copied to clipboard" & ;;
"Y") "Y")
echo -n "$fullpath" | xclip -selection clipboard && echo -n "$(readlink -f "$file")" | xclip -selection clipboard &&
notify-send "$fullpath copied to clipboard" & ;; notify-send "$(readlink -f "$file") copied to clipboard" & ;;
"d") "d")
[ "$(printf "No\\nYes" | dmenu -i -p "Really delete $file?")" = "Yes" ] && rm "$file" && notify-send "$file deleted." ;; [ "$(printf "No\\nYes" | dmenu -i -p "Really delete $file?")" = "Yes" ] && rm "$file" && notify-send "$file deleted." ;;
"G") "G")