| 1 | #!/bin/sh |
| 2 | |
| 3 | # Example for $XDG_CONFIG_HOME/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 | s=" | " # field separator |
| 9 | |
| 10 | filename=$(basename -- "$1") |
| 11 | filesize=$(du -Hh -- "$1" | cut -f 1) |
| 12 | |
| 13 | geometry=$(identify -format '%wx%h' ":$1[0]") |
| 14 | tags=$(identify -format '%[IPTC:2:25]' ":$1" | tr ';' ',') |
| 15 | |
| 16 | echo "${filesize}${s}${geometry}${tags:+$s}${tags}${s}${filename}" |
| 17 | |