mirror of
https://github.com/kolunmi/dwlb.git
synced 2025-10-27 10:14:27 +00:00
add -bottom & -hidden options to configure default settings
This commit is contained in:
parent
02acdb90cc
commit
9c67e550cf
21
dwlb.c
21
dwlb.c
@ -55,13 +55,15 @@
|
|||||||
"usage: dwlb [OPTIONS]\n" \
|
"usage: dwlb [OPTIONS]\n" \
|
||||||
"Bar Config\n" \
|
"Bar Config\n" \
|
||||||
" -hide-vacant-tags do not display empty and inactive tags\n" \
|
" -hide-vacant-tags do not display empty and inactive tags\n" \
|
||||||
|
" -bottom bars will initially be drawn at the bottom\n" \
|
||||||
|
" -hidden bars will initially be hidden\n" \
|
||||||
" -font [FONT] specify a font\n" \
|
" -font [FONT] specify a font\n" \
|
||||||
" -text-color [COLOR] specify text color\n" \
|
" -text-color [COLOR] specify text color\n" \
|
||||||
" -active-color [COLOR] specify color to indicate active tags or monitors\n" \
|
" -active-color [COLOR] specify color to indicate active tags or monitors\n" \
|
||||||
" -inactive-color [COLOR] specify color to indicate inactive tags or monitors\n" \
|
" -inactive-color [COLOR] specify color to indicate inactive tags or monitors\n" \
|
||||||
" -urg-text-color [COLOR] specify text color on urgent tags\n" \
|
" -urg-text-color [COLOR] specify text color on urgent tags\n" \
|
||||||
" -urg-bg-color [COLOR] specify color of urgent tags\n" \
|
" -urg-bg-color [COLOR] specify color of urgent tags\n" \
|
||||||
" -tags [TAG 1]...[TAG 9] specify tag text\n" \
|
" -tags [TAG 1]...[TAG 9] specify custom tag names\n" \
|
||||||
"Commands\n" \
|
"Commands\n" \
|
||||||
" -status [OUTPUT] [TEXT] set status text\n" \
|
" -status [OUTPUT] [TEXT] set status text\n" \
|
||||||
" -show [OUTPUT] show bar\n" \
|
" -show [OUTPUT] show bar\n" \
|
||||||
@ -69,7 +71,7 @@
|
|||||||
" -toggle-visibility [OUTPUT] toggle bar visibility\n" \
|
" -toggle-visibility [OUTPUT] toggle bar visibility\n" \
|
||||||
" -set-top [OUTPUT] draw bar at the top\n" \
|
" -set-top [OUTPUT] draw bar at the top\n" \
|
||||||
" -set-bottom [OUTPUT] draw bar at the bottom\n" \
|
" -set-bottom [OUTPUT] draw bar at the bottom\n" \
|
||||||
" -toggle-location [OUTPUT] toggle bar location\n" \
|
" -toggle-location [OUTPUT] toggle bar location\n" \
|
||||||
"Other\n" \
|
"Other\n" \
|
||||||
" -v get version information\n" \
|
" -v get version information\n" \
|
||||||
" -h view this help text\n"
|
" -h view this help text\n"
|
||||||
@ -118,13 +120,16 @@ static struct wl_shm *shm;
|
|||||||
static struct zwlr_layer_shell_v1 *layer_shell;
|
static struct zwlr_layer_shell_v1 *layer_shell;
|
||||||
static struct zxdg_output_manager_v1 *output_manager;
|
static struct zxdg_output_manager_v1 *output_manager;
|
||||||
|
|
||||||
|
static Bar *bars = NULL;
|
||||||
|
|
||||||
static uint32_t height;
|
static uint32_t height;
|
||||||
static uint32_t textpadding;
|
static uint32_t textpadding;
|
||||||
|
static bool hidden = false;
|
||||||
|
static bool bottom = false;
|
||||||
|
|
||||||
static bool run_display = true;
|
static bool run_display = true;
|
||||||
static bool ready = false;
|
static bool ready = false;
|
||||||
static bool hide_vacant = false;
|
static bool hide_vacant = false;
|
||||||
static Bar *bars = NULL;
|
|
||||||
|
|
||||||
#define TAGSLEN 9
|
#define TAGSLEN 9
|
||||||
static char *tags[TAGSLEN] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" };
|
static char *tags[TAGSLEN] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" };
|
||||||
@ -136,6 +141,7 @@ static pixman_color_t textcolor = { .red = 0xeeee, .green = 0xeeee, .blue = 0xee
|
|||||||
static pixman_color_t urgbgcolor = { .red = 0xeeee, .green = 0xeeee, .blue = 0xeeee, .alpha = 0xffff, };
|
static pixman_color_t urgbgcolor = { .red = 0xeeee, .green = 0xeeee, .blue = 0xeeee, .alpha = 0xffff, };
|
||||||
static pixman_color_t urgtextcolor = { .red = 2222, .green = 0x2222, .blue = 0x2222, .alpha = 0xffff, };
|
static pixman_color_t urgtextcolor = { .red = 2222, .green = 0x2222, .blue = 0x2222, .alpha = 0xffff, };
|
||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
wl_buffer_release(void *data, struct wl_buffer *wl_buffer)
|
wl_buffer_release(void *data, struct wl_buffer *wl_buffer)
|
||||||
{
|
{
|
||||||
@ -571,6 +577,8 @@ setup_bar(Bar *b)
|
|||||||
{
|
{
|
||||||
b->height = height;
|
b->height = height;
|
||||||
b->textpadding = textpadding;
|
b->textpadding = textpadding;
|
||||||
|
b->bottom = bottom;
|
||||||
|
b->hidden = hidden;
|
||||||
|
|
||||||
snprintf(b->layout, sizeof b->layout, "[]=");
|
snprintf(b->layout, sizeof b->layout, "[]=");
|
||||||
|
|
||||||
@ -579,7 +587,8 @@ setup_bar(Bar *b)
|
|||||||
CLEANUP_DIE("Could not create xdg_output");
|
CLEANUP_DIE("Could not create xdg_output");
|
||||||
zxdg_output_v1_add_listener(b->xdg_output, &output_listener, b);
|
zxdg_output_v1_add_listener(b->xdg_output, &output_listener, b);
|
||||||
|
|
||||||
show_bar(b);
|
if (!b->hidden)
|
||||||
|
show_bar(b);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -1027,6 +1036,10 @@ main(int argc, char **argv)
|
|||||||
return 0;
|
return 0;
|
||||||
} else if (!strcmp(argv[i], "-hide-vacant-tags")) {
|
} else if (!strcmp(argv[i], "-hide-vacant-tags")) {
|
||||||
hide_vacant = true;
|
hide_vacant = true;
|
||||||
|
} else if (!strcmp(argv[i], "-bottom")) {
|
||||||
|
bottom = true;
|
||||||
|
} else if (!strcmp(argv[i], "-hidden")) {
|
||||||
|
hidden = true;
|
||||||
} else if (!strcmp(argv[i], "-font")) {
|
} else if (!strcmp(argv[i], "-font")) {
|
||||||
if (++i >= argc)
|
if (++i >= argc)
|
||||||
DIE("Option -font requires an argument");
|
DIE("Option -font requires an argument");
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user