Krolyxon
Commit 825c52c

Branches

Refs →

nsxiv825c52c

Made bar fields more distinguishable

Author
Bert Münnich
Date
2013-02-24 20:04 +0100
Committer
Bert Münnich · 2013-03-19 21:14 +0100
Parent
38ecea3
Commit
825c52c33fcaec5dbaa361cb39835987de8312f2

+6 −4

2 files changed

  1. M image-info +4 −2
  2. M main.c +2 −2
M image-info View
@@ -5,13 +5,15 @@
55 # with the name of the image file as its first argument.
66 # The output is displayed in sxiv's status bar.
77
8+s=" | " # field separator
9+
810 filename=$(basename "$1")
911 filesize=$(du -h "$1" | cut -f 1)
1012
1113 geometry=$(identify -format '%wx%h' "$1[0]")
1214
1315 tags=$(exiv2 -q pr -pi "$1" | awk '$1~"Keywords" { printf("%s,", $4); }')
14−tags=${tags:+|}${tags%,}
16+tags=${tags%,}
1517
16−echo "[$filesize|$geometry$tags] $filename"
18+echo "${filesize}${s}${geometry}${tags:+$s}${tags}${s}${filename}"
1719
M main.c View
@@ -338,10 +338,10 @@ void update_info(void)
338338 ow_info = false;
339339 }
340340 } else {
341− n = snprintf(rt, rlen, "%3d%% ", (int) (img.zoom * 100.0));
341+ n = snprintf(rt, rlen, "%3d%% | ", (int) (img.zoom * 100.0));
342342 if (img.multi.cnt > 0) {
343343 for (fn = 0, i = img.multi.cnt; i > 0; fn++, i /= 10);
344− n += snprintf(rt + n, rlen - n, "(%0*d/%d) ",
344+ n += snprintf(rt + n, rlen - n, "%0*d/%d | ",
345345 fn, img.multi.sel + 1, img.multi.cnt);
346346 }
347347 n += snprintf(rt + n, rlen - n, "%0*d/%d", fw, sel + 1, filecnt);