update key-handler for sxiv
This commit is contained in:
parent
355407f078
commit
7263fcb3a1
1 changed files with 5 additions and 5 deletions
|
@ -1,15 +1,15 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
while read file
|
while read -r file
|
||||||
do
|
do
|
||||||
case "$1" in
|
case "$1" in
|
||||||
"w") setbg "$file" & ;;
|
"w") setbg "$file" & ;;
|
||||||
"c")
|
"c")
|
||||||
[ -z "$destdir" ] && destdir="$(sed "s/\s.*#.*$//;/^\s*$/d" ${XDG_CONFIG_HOME:-$HOME/.config}/shell/bm-dirs | awk '{print $2}' | dmenu -l 20 -i -p "Copy file(s) to where?" | sed "s|~|$HOME|g")"
|
[ -z "$destdir" ] && destdir="$(sed "s/#.*$//;/^\s*$/d" ${XDG_CONFIG_HOME:-$HOME/.config}/shell/bm-dirs | awk '{print $2}' | dmenu -l 20 -i -p "Copy file(s) to where?" | sed "s|~|$HOME|g")"
|
||||||
[ ! -d "$destdir" ] && notify-send "$destdir is not a directory, cancelled." && exit
|
[ ! -d "$destdir" ] && notify-send "$destdir is not a directory, cancelled." && exit
|
||||||
cp "$file" "$destdir" && notify-send -i "$(readlink -f "$file")" "$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" ${XDG_CONFIG_HOME:-$HOME/.config}/shell/bm-dirs | awk '{print $2}' | dmenu -l 20 -i -p "Move file(s) to where?" | sed "s|~|$HOME|g")"
|
[ -z "$destdir" ] && destdir="$(sed "s/#.*$//;/^\s*$/d" ${XDG_CONFIG_HOME:-$HOME/.config}/shell/bm-dirs | awk '{print $2}' | dmenu -l 20 -i -p "Move file(s) to where?" | sed "s|~|$HOME|g")"
|
||||||
[ ! -d "$destdir" ] && notify-send "$destdir is not a directory, cancelled." && exit
|
[ ! -d "$destdir" ] && notify-send "$destdir is not a directory, cancelled." && exit
|
||||||
mv "$file" "$destdir" && notify-send -i "$(readlink -f "$file")" "$file moved to $destdir." &
|
mv "$file" "$destdir" && notify-send -i "$(readlink -f "$file")" "$file moved to $destdir." &
|
||||||
;;
|
;;
|
||||||
|
@ -20,7 +20,7 @@ do
|
||||||
"f")
|
"f")
|
||||||
convert -flop "$file" "$file" ;;
|
convert -flop "$file" "$file" ;;
|
||||||
"y")
|
"y")
|
||||||
echo -n "$file" | tr -d '\n' | xclip -selection clipboard &&
|
printf "%s" "$file" | tr -d '\n' | xclip -selection clipboard &&
|
||||||
notify-send "$file copied to clipboard" & ;;
|
notify-send "$file copied to clipboard" & ;;
|
||||||
"Y")
|
"Y")
|
||||||
readlink -f "$file" | tr -d '\n' | xclip -selection clipboard &&
|
readlink -f "$file" | tr -d '\n' | xclip -selection clipboard &&
|
||||||
|
@ -28,6 +28,6 @@ do
|
||||||
"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") ifinstalled gimp && setsid -f gimp "$file" ;;
|
"g") ifinstalled gimp && setsid -f gimp "$file" ;;
|
||||||
"i") notify-send "File information" "$(mediainfo "$file")" ;;
|
"i") notify-send "File information" "$(mediainfo "$file" | sed "s/[ ]\+:/:/g;s/: /: <b>/;s/$/<\/b>/" | grep "<b>")" ;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue