Skip to content
This repository has been archived by the owner on Jan 16, 2023. It is now read-only.

Commit

Permalink
Separate bar fields only by spaces
Browse files Browse the repository at this point in the history
  • Loading branch information
xyb3rt committed Dec 7, 2017
1 parent e63843d commit 8a9e3ea
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion exec/image-info
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
# $2: image width
# $3: image height

s=" | " # field separator
s=" " # field separator

exec 2>/dev/null

Expand Down
12 changes: 7 additions & 5 deletions main.c
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,8 @@ void bar_put(win_bar_t *bar, const char *fmt, ...)
va_end(ap);
}

#define BAR_SEP " "

void update_info(void)
{
unsigned int i, fn, fw;
Expand Down Expand Up @@ -364,16 +366,16 @@ void update_info(void)
bar_put(r, "%s", mark);
if (img.ss.on) {
if (img.ss.delay % 10 != 0)
bar_put(r, "%2.1fs | ", (float)img.ss.delay / 10);
bar_put(r, "%2.1fs" BAR_SEP, (float)img.ss.delay / 10);
else
bar_put(r, "%ds | ", img.ss.delay / 10);
bar_put(r, "%ds" BAR_SEP, img.ss.delay / 10);
}
if (img.gamma != 0)
bar_put(r, "G%+d | ", img.gamma);
bar_put(r, "%3d%% | ", (int) (img.zoom * 100.0));
bar_put(r, "G%+d" BAR_SEP, img.gamma);
bar_put(r, "%3d%%" BAR_SEP, (int) (img.zoom * 100.0));
if (img.multi.cnt > 0) {
for (fn = 0, i = img.multi.cnt; i > 0; fn++, i /= 10);
bar_put(r, "%0*d/%d | ", fn, img.multi.sel + 1, img.multi.cnt);
bar_put(r, "%0*d/%d" BAR_SEP, fn, img.multi.sel + 1, img.multi.cnt);
}
bar_put(r, "%0*d/%d", fw, fileidx + 1, filecnt);
if (info.f.err)
Expand Down

0 comments on commit 8a9e3ea

Please sign in to comment.