image-info 468 B

123456789101112131415161718192021
  1. #!/bin/sh
  2. # Example for $XDG_CONFIG_HOME/sxiv/exec/image-info
  3. # Called by sxiv(1) whenever an image gets loaded.
  4. # The output is displayed in sxiv's status bar.
  5. # Arguments:
  6. # $1: path to image file
  7. # $2: image width
  8. # $3: image height
  9. s=" " # field separator
  10. exec 2>/dev/null
  11. filename=$(basename -- "$1")
  12. filesize=$(du -Hh -- "$1" | cut -f 1)
  13. geometry="${2}x${3}"
  14. tags=$(img-chon.sh tags "$1")
  15. echo "${filesize}${s}${geometry}${s}${filename}${s}${tags}"