diff options
author | Bert Münnich <ber.t@gmx.com> | 2012-02-16 23:20:27 +0100 |
---|---|---|
committer | Bert Münnich <ber.t@gmx.com> | 2012-02-16 23:20:27 +0100 |
commit | 2d4264af286db2a746d600139a12472841c2677d (patch) | |
tree | 53a65b90464e29d5e1dd5b3504a9a7bedb6e712d | |
parent | b418df7afc01796254fdf24d4afe12da3f0795bd (diff) |
Added option -b: disable bar
-rw-r--r-- | Makefile | 2 | ||||
-rw-r--r-- | README.md | 1 | ||||
-rw-r--r-- | options.c | 8 | ||||
-rw-r--r-- | options.h | 1 | ||||
-rw-r--r-- | sxiv.1 | 5 | ||||
-rw-r--r-- | window.c | 7 |
6 files changed, 18 insertions, 6 deletions
@@ -1,4 +1,4 @@ -VERSION = git-20120215 +VERSION = git-20120216 CC = gcc CFLAGS = -ansi -Wall -pedantic -O2 @@ -60,6 +60,7 @@ of small previews is displayed, making it easy to choose an image to open. sxiv supports the following command-line options: + -b Do not show info bar on bottom of window -c Remove all orphaned cache files from thumbnail cache and exit -d Scale all images to 100%, but fit large images into window -F Use size-hints to make the window fixed/floating @@ -32,7 +32,7 @@ options_t _options; const options_t *options = (const options_t*) &_options; void print_usage(void) { - printf("usage: sxiv [-cdFfhpqrstvZ] [-g GEOMETRY] [-n NUM] " + printf("usage: sxiv [-bcdFfhpqrstvZ] [-g GEOMETRY] [-n NUM] " "[-z ZOOM] FILES...\n"); } @@ -52,17 +52,21 @@ void parse_options(int argc, char **argv) { _options.fixed_win = false; _options.fullscreen = false; + _options.hide_bar = false; _options.geometry = NULL; _options.quiet = false; _options.thumb_mode = false; _options.clean_cache = false; - while ((opt = getopt(argc, argv, "cdFfg:hn:pqrstvZz:")) != -1) { + while ((opt = getopt(argc, argv, "bcdFfg:hn:pqrstvZz:")) != -1) { switch (opt) { case '?': print_usage(); exit(EXIT_FAILURE); + case 'b': + _options.hide_bar = true; + break; case 'c': _options.clean_cache = true; break; @@ -38,6 +38,7 @@ typedef struct { /* window: */ bool fixed_win; bool fullscreen; + bool hide_bar; char *geometry; /* misc flags: */ @@ -3,7 +3,7 @@ sxiv \- Simple (or small or suckless) X Image Viewer .SH SYNOPSIS .B sxiv -.RB [ \-cdFfhpqrstvZ ] +.RB [ \-bcdFfhpqrstvZ ] .RB [ \-g .IR GEOMETRY ] .RB [ \-n @@ -33,6 +33,9 @@ Please note, that the fullscreen mode requires an EWMH/NetWM compliant window manager. .SH OPTIONS .TP +.B \-b +Do not show info bar on bottom of window. +.TP .B \-c Remove all orphaned cache files from the thumbnail cache directory and exit. .TP @@ -121,6 +121,7 @@ void win_init(win_t *win) { win->xwin = 0; win->pm = 0; win->fullscreen = false; + win->barh = 0; win->lbar = NULL; win->rbar = NULL; @@ -209,8 +210,10 @@ void win_open(win_t *win) { classhint.res_class = "sxiv"; XSetClassHint(e->dpy, win->xwin, &classhint); - win->barh = font.ascent + font.descent + 2 * V_TEXT_PAD; - win->h -= win->barh; + if (!options->hide_bar) { + win->barh = font.ascent + font.descent + 2 * V_TEXT_PAD; + win->h -= win->barh; + } if (options->fixed_win) win_set_sizehints(win); |