Krolyxon
Commit 184d210

Branches

Refs →

nsxivexecimage-info

20 lines · 488 B · Bourne Again Shell (bash)

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# The output is displayed in sxiv's status bar.
6# Arguments:
7# $1: path to image file
8# $2: image width
9# $3: image height
10
11s=" | " # field separator
12
13filename=$(basename -- "$1")
14filesize=$(du -Hh -- "$1" | cut -f 1)
15
16geometry="${2}x${3}"
17tags=$(identify -format '%[IPTC:2:25]' ":$1" | tr ';' ',')
18
19echo "${filesize}${s}${geometry}${tags:+$s}${tags}${s}${filename}"
20