mirror of https://codeberg.org/nsxiv/nsxiv
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
430 B
Plaintext
21 lines
430 B
Plaintext
12 years ago
|
#!/bin/sh
|
||
|
|
||
3 years ago
|
# Example for $XDG_CONFIG_HOME/nsxiv/exec/image-info
|
||
|
# Called by nsxiv(1) whenever an image gets loaded.
|
||
|
# The output is displayed in nsxiv's status bar.
|
||
8 years ago
|
# Arguments:
|
||
|
# $1: path to image file
|
||
|
# $2: image width
|
||
|
# $3: image height
|
||
12 years ago
|
|
||
7 years ago
|
s=" " # field separator
|
||
12 years ago
|
|
||
8 years ago
|
exec 2>/dev/null
|
||
|
|
||
9 years ago
|
filename=$(basename -- "$1")
|
||
|
filesize=$(du -Hh -- "$1" | cut -f 1)
|
||
8 years ago
|
geometry="${2}x${3}"
|
||
12 years ago
|
|
||
6 years ago
|
echo "${filesize}${s}${geometry}${s}${filename}"
|
||
12 years ago
|
|