2022-07-04 21:36:33 +02:00
|
|
|
#!/bin/sh
|
2023-03-30 16:07:52 +02:00
|
|
|
while read -r file; do
|
|
|
|
case "$1" in
|
|
|
|
"w") setbg "$file" & ;;
|
|
|
|
"c")
|
|
|
|
[ -z "$destdir" ] && destdir="$(sed "s/#.*$//;/^\s*$/d" "$XDG_CONFIG_HOME/shell/bm-dirs" | awk '{print $2}' | dmenu -l 20 -i -p "Copy file(s) to where?" | sed "s|~|$HOME|g")"
|
2022-07-04 21:36:33 +02:00
|
|
|
[ ! -d "$destdir" ] && notify-send "$destdir is not a directory, cancelled." && exit
|
|
|
|
cp "$file" "$destdir" && notify-send -i "$(readlink -f "$file")" "$file copied to $destdir." &
|
|
|
|
;;
|
2023-03-30 16:07:52 +02:00
|
|
|
"m")
|
|
|
|
[ -z "$destdir" ] && destdir="$(sed "s/#.*$//;/^\s*$/d" "$XDG_CONFIG_HOME/shell/bm-dirs" | awk '{print $2}' | dmenu -l 20 -i -p "Move file(s) to where?" | sed "s|~|$HOME|g")"
|
2022-07-04 21:36:33 +02:00
|
|
|
[ ! -d "$destdir" ] && notify-send "$destdir is not a directory, cancelled." && exit
|
|
|
|
mv "$file" "$destdir" && notify-send -i "$(readlink -f "$file")" "$file moved to $destdir." &
|
|
|
|
;;
|
|
|
|
"r")
|
2023-03-30 16:07:52 +02:00
|
|
|
convert -rotate 90 "$file" "$file"
|
|
|
|
;;
|
2022-07-04 21:36:33 +02:00
|
|
|
"R")
|
2023-03-30 16:07:52 +02:00
|
|
|
convert -rotate -90 "$file" "$file"
|
|
|
|
;;
|
2022-07-04 21:36:33 +02:00
|
|
|
"f")
|
2023-03-30 16:07:52 +02:00
|
|
|
convert -flop "$file" "$file"
|
|
|
|
;;
|
2022-07-04 21:36:33 +02:00
|
|
|
"y")
|
2023-02-21 00:15:28 +01:00
|
|
|
printf "%s" "$file" | tr -d '\n' | xclip -selection clipboard &&
|
2023-03-30 16:07:52 +02:00
|
|
|
notify-send "$file copied to clipboard" &
|
|
|
|
;;
|
2022-07-04 21:36:33 +02:00
|
|
|
"Y")
|
|
|
|
readlink -f "$file" | tr -d '\n' | xclip -selection clipboard &&
|
2023-03-30 16:07:52 +02:00
|
|
|
notify-send "$(readlink -f "$file") copied to clipboard" &
|
|
|
|
;;
|
2022-07-04 21:36:33 +02:00
|
|
|
"d")
|
2023-03-30 16:07:52 +02:00
|
|
|
[ "$(printf "No\\nYes" | dmenu -i -p "Really delete $file?")" = "Yes" ] && rm "$file" && notify-send "$file deleted."
|
|
|
|
;;
|
|
|
|
"g") ifinstalled gimp && setsid -f gimp "$file" ;;
|
|
|
|
"i") notify-send "File information" "$(mediainfo "$file" | sed "s/[ ]\+:/:/g;s/: /: <b>/;s/$/<\/b>/" | grep "<b>")" ;;
|
|
|
|
esac
|
2022-07-04 21:36:33 +02:00
|
|
|
done
|