example nsxiv configs
This commit is contained in:
parent
c629631e3d
commit
019042aa4f
|
@ -0,0 +1,11 @@
|
|||
#!/bin/sh
|
||||
s=" " # field separator
|
||||
|
||||
exec 2>/dev/null
|
||||
|
||||
filename=$(basename -- "$1")
|
||||
filesize=$(du -Hh -- "$1" | cut -f 1)
|
||||
geometry="${2}x${3}"
|
||||
|
||||
echo "${filesize}${s}${geometry}${s}${filename}"
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
#!/bin/sh
|
||||
# shellcheck disable=2162
|
||||
rotate() {
|
||||
degree="$1"
|
||||
tr '\n' '\0' | xargs -0 realpath | sort | uniq | while read file; do
|
||||
case "$(file -b -i "$file")" in
|
||||
image/jpeg*) jpegtran -rotate "$degree" -copy all -outfile "$file" "$file" ;;
|
||||
*) mogrify -rotate "$degree" "$file" ;;
|
||||
esac
|
||||
done
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
"C-x") xclip -in -filter | tr '\n' ' ' | xclip -in -selection clipboard ;;
|
||||
"C-c") while read file; do xclip -selection clipboard -target image/png "$file"; done ;;
|
||||
"C-g") tr '\n' '\0' | xargs -0 gimp & ;;
|
||||
"C-comma") rotate 270 ;;
|
||||
"C-period") rotate 90 ;;
|
||||
"C-slash") rotate 180 ;;
|
||||
esac
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
#!/bin/sh
|
||||
|
||||
s=" " # field separator
|
||||
|
||||
exec 2>/dev/null
|
||||
|
||||
filename=$(basename -- "$4")
|
||||
filesize=$(du -Hh -- "$4" | cut -f 1)
|
||||
|
||||
echo "${filesize}${s}${filename}"
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
#!/bin/sh
|
||||
|
||||
exec 2>/dev/null
|
||||
|
||||
filename="${1##*/}"
|
||||
|
||||
if [ -n "$4" ]; then # image mode
|
||||
printf "%s" "nsxiv - ${filename} | ${4}x${5} ${6}% [${2}/${3}]"
|
||||
else
|
||||
printf "%s" "nsxiv - ${filename} [${2}/${3}]"
|
||||
fi
|
Loading…
Reference in New Issue