~kaction/dvtm

851a020aee8b66598958545b1da9a9b9366c901a — Dmitry Bogatov 2 years ago 51d01e9 + 53ce17e
Merge branch 'next'

* next:
  Include toggle for "showcmd" feature into config.def.h
  Make selected tag in bar more contrast
  Increase number of tags to 9
  Fix spelling error in dvtm-pager.1
3 files changed, 16 insertions(+), 6 deletions(-)

M config.def.h
M dvtm-pager.1
M dvtm.c
M config.def.h => config.def.h +14 -4
@@ 14,11 14,13 @@
enum {
	DEFAULT,
	BLUE,
	MAGENTA
};

static Color colors[] = {
	[DEFAULT] = { .fg = -1,         .bg = -1, .fg256 = -1, .bg256 = -1, },
	[BLUE]    = { .fg = COLOR_BLUE, .bg = -1, .fg256 = 68, .bg256 = -1, },
	[DEFAULT] = { .fg = -1,            .bg = -1, .fg256 = -1, .bg256 = -1,},
	[BLUE]    = { .fg = COLOR_BLUE,    .bg = -1, .fg256 = 68, .bg256 = -1,},
	[MAGENTA] = { .fg = COLOR_MAGENTA, .bg = -1, .fg256 = 91, .bg256 = -1,},
};

#define COLOR(c)        COLOR_PAIR(colors[c].pair)


@@ 46,15 48,19 @@ static Color colors[] = {
/* printf format string for the tag in the status bar */
#define TAG_SYMBOL   "[%s]"
/* curses attributes for the currently selected tags */
#define TAG_SEL      (COLOR(BLUE) | A_BOLD)
#define TAG_SEL      (COLOR(MAGENTA))
/* curses attributes for not selected tags which contain no windows */
#define TAG_NORMAL   (COLOR(DEFAULT) | A_NORMAL)
/* curses attributes for not selected tags which contain windows */
#define TAG_OCCUPIED (COLOR(BLUE) | A_NORMAL)
/* curses attributes for not selected tags which with urgent windows */
#define TAG_URGENT (COLOR(BLUE) | A_NORMAL | A_BLINK)
/* Display keys of partially typed keycombo next to layout icon.
 * Similar vim feature is called "showcmd".
 */
#define SHOW_COMBO true

const char tags[][8] = { "1", "2", "3", "4", "5" };
const char tags[][8] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" };

#include "tile.c"
#include "grid.c"


@@ 140,6 146,10 @@ static KeyBinding bindings[] = {
	TAGKEYS( '3',                              2)
	TAGKEYS( '4',                              3)
	TAGKEYS( '5',                              4)
	TAGKEYS( '6',                              5)
	TAGKEYS( '7',                              6)
	TAGKEYS( '8',                              7)
	TAGKEYS( '9',                              8)
};

static const ColorRule colorrules[] = {

M dvtm-pager.1 => dvtm-pager.1 +1 -1
@@ 3,7 3,7 @@
.Os dvtm VERSION
.Sh NAME
.Nm dvtm-pager
.Nd select apropriate pager for dvtm
.Nd select appropriate pager for dvtm
.
.
.Sh SYNOPSIS

M dvtm.c => dvtm.c +1 -1
@@ 355,7 355,7 @@ drawbar(void) {
	addstr(layout->symbol);
	attrset(TAG_NORMAL);

	if (keys) {
	if (SHOW_COMBO && keys) {
		unsigned int keycount = 0;
		while (keycount < MAX_KEYS && keys[keycount]) {
			if (keys[keycount] < ' ')