nsxivimage-info
| 1 | #!/bin/sh |
| 2 | |
| 3 | # Example for ~/.sxiv/exec/image-info |
| 4 | # Called by sxiv(1) whenever an image gets loaded, |
| 5 | # with the name of the image file as its first argument. |
| 6 | # The output is displayed in sxiv's status bar. |
| 7 | |
| 8 | filename=$(basename "$1") |
| 9 | filesize=$(du -h "$1" | cut -f 1) |
| 10 | |
| 11 | geometry=$(identify -format '%wx%h' "$1[0]") |
| 12 | |
| 13 | tags=$(exiv2 -q pr -pi "$1" | awk '$1~"Keywords" { printf("%s,", $4); }') |
| 14 | tags=${tags:+|}${tags%,} |
| 15 | |
| 16 | echo "[$filesize|$geometry$tags] $filename" |
| 17 |