2019-01-03 19:03:09 +00:00
|
|
|
#!/bin/sh
|
|
|
|
while read file
|
|
|
|
do
|
|
|
|
case "$1" in
|
2019-01-13 02:56:36 +00:00
|
|
|
"w") setbg "$file" & ;;
|
2019-01-03 19:03:09 +00:00
|
|
|
"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" ] && exit
|
2019-01-06 19:18:49 +00:00
|
|
|
cp "$file" "$destdir" && notify-send -i "$(readlink -f "$file")" "$file copied to $destdir." &
|
2019-01-03 19:03:09 +00:00
|
|
|
;;
|
|
|
|
"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" ] && exit
|
2019-01-06 19:18:49 +00:00
|
|
|
mv "$file" "$destdir" && notify-send -i "$(readlink -f "$file")" "$file moved to $destdir." &
|
2019-01-03 19:03:09 +00:00
|
|
|
;;
|
|
|
|
"r")
|
|
|
|
convert -rotate 90 "$file" "$file" ;;
|
|
|
|
"R")
|
|
|
|
convert -rotate -90 "$file" "$file" ;;
|
|
|
|
"f")
|
|
|
|
convert -flop "$file" "$file" ;;
|
|
|
|
"y")
|
|
|
|
echo -n "$file" | xclip -selection clipboard &&
|
|
|
|
notify-send "$file copied to clipboard" & ;;
|
|
|
|
"Y")
|
2019-01-06 19:18:49 +00:00
|
|
|
echo -n "$(readlink -f "$file")" | xclip -selection clipboard &&
|
|
|
|
notify-send "$(readlink -f "$file") copied to clipboard" & ;;
|
2019-01-03 19:03:09 +00:00
|
|
|
"d")
|
|
|
|
[ "$(printf "No\\nYes" | dmenu -i -p "Really delete $file?")" = "Yes" ] && rm "$file" && notify-send "$file deleted." ;;
|
2019-01-13 02:56:36 +00:00
|
|
|
"g") ifinstalled gimp && gimp "$file" & ;;
|
2019-01-03 19:03:09 +00:00
|
|
|
esac
|
|
|
|
done
|