Debian Codegraph @

etc/examples/thumb-info

raw
1 #!/bin/sh
2
3 # Example for $XDG_CONFIG_HOME/nsxiv/exec/thumb-info
4 # Called by nsxiv(1) whenever the selected thumbnail changes.
5 # The output is displayed in nsxiv's status bar.
6 # Arguments:
7 # $1: path to image file (as provided by the user)
8 # $2: empty
9 # $3: empty
10 # $4: fully resolved path to the image file
11
12 s=" " # field separator
13
14 exec 2>/dev/null
15
16 filename=$(basename -- "$4")
17 filesize=$(du -Hh -- "$4" | cut -f 1)
18
19 echo "${filesize}${s}${filename}"
20