[arch-commits] Commit in dvtm/trunk (PKGBUILD config.h)

Lukas Fleischer lfleischer at archlinux.org
Tue Nov 18 20:39:13 UTC 2014


    Date: Tuesday, November 18, 2014 @ 21:39:12
  Author: lfleischer
Revision: 122718

upgpkg: dvtm 0.13-1

Upstream update.

Modified:
  dvtm/trunk/PKGBUILD
  dvtm/trunk/config.h

----------+
 PKGBUILD |    6 +-
 config.h |  170 +++++++++++++++++++++++++++++++++++++++++--------------------
 2 files changed, 119 insertions(+), 57 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2014-11-18 20:14:50 UTC (rev 122717)
+++ PKGBUILD	2014-11-18 20:39:12 UTC (rev 122718)
@@ -4,7 +4,7 @@
 # Contributor: bender02 at gmx dot com
 
 pkgname=dvtm
-pkgver=0.12
+pkgver=0.13
 pkgrel=1
 pkgdesc='Dynamic virtual terminal manager.'
 arch=('i686' 'x86_64')
@@ -13,8 +13,8 @@
 depends=('ncurses')
 source=("http://www.brain-dump.org/projects/${pkgname}/${pkgname}-${pkgver}.tar.gz"
         'config.h')
-md5sums=('ce102246802bf443226c23e1e43aed3a'
-         '492d9162182eadf4563aed842d682acd')
+md5sums=('f4ab17eb6e79939182a40f66968ca5d0'
+         'eed9c0af15233b449b1cd8874130f028')
 
 prepare() {
 	cd "${srcdir}/${pkgname}-${pkgver}"

Modified: config.h
===================================================================
--- config.h	2014-11-18 20:14:50 UTC (rev 122717)
+++ config.h	2014-11-18 20:39:12 UTC (rev 122718)
@@ -10,15 +10,28 @@
  * A_PROTECT       Protected mode
  * A_INVIS         Invisible or blank mode
  */
-#define BLUE            (COLORS==256 ? 68 : COLOR_BLUE)
+
+enum {
+	DEFAULT,
+	BLUE,
+};
+
+static Color colors[] = {
+	[DEFAULT] = { .fg = -1,         .bg = -1, .fg256 = -1, .bg256 = -1, },
+	[BLUE]    = { .fg = COLOR_BLUE, .bg = -1, .fg256 = 68, .bg256 = -1, },
+};
+
+#define COLOR(c)        COLOR_PAIR(colors[c].pair)
 /* curses attributes for the currently focused window */
-#define SELECTED_ATTR   COLOR(BLUE, -1) | A_NORMAL
+#define SELECTED_ATTR   (COLOR(BLUE) | A_NORMAL)
 /* curses attributes for normal (not selected) windows */
-#define NORMAL_ATTR     COLOR(-1, -1) | A_NORMAL
+#define NORMAL_ATTR     (COLOR(DEFAULT) | A_NORMAL)
 /* curses attributes for the status bar */
-#define BAR_ATTR        COLOR(BLUE, -1) | A_NORMAL
+#define BAR_ATTR        (COLOR(BLUE) | A_NORMAL)
 /* status bar (command line option -s) position */
-#define BAR_POS		BAR_TOP /* BAR_BOTTOM, BAR_OFF */
+#define BAR_POS         BAR_TOP /* BAR_BOTTOM, BAR_OFF */
+/* whether status bar should be hidden if only one client exists */
+#define BAR_AUTOHIDE    true
 /* determines whether the statusbar text should be right or left aligned */
 #define BAR_ALIGN       ALIGN_RIGHT
 /* separator between window title and window number */
@@ -31,7 +44,17 @@
 #define MFACT 0.5
 /* scroll back buffer size in lines */
 #define SCROLL_HISTORY 500
+/* 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)
+/* 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)
 
+const char tags[][8] = { "1", "2", "3", "4", "5" };
+
 #include "tile.c"
 #include "grid.c"
 #include "bstack.c"
@@ -45,60 +68,84 @@
 	{ "[ ]", fullscreen },
 };
 
-#define MOD CTRL('g')
+#define MOD  CTRL('g')
 
 /* you can at most specifiy MAX_ARGS (3) number of arguments */
-static Key keys[] = {
-	{ MOD,   'c',           { create,         { NULL }                    } },
-	{ MOD,   'C',           { create,         { NULL, NULL, "$CWD" }      } },
-	{ MOD,   'x',           { killclient,     { NULL }                    } },
-	{ MOD,   'j',           { focusnext,      { NULL }                    } },
-	{ MOD,   'u',           { focusnextnm,    { NULL }                    } },
-	{ MOD,   'i',           { focusprevnm,    { NULL }                    } },
-	{ MOD,   'k',           { focusprev,      { NULL }                    } },
-	{ MOD,   't',           { setlayout,      { "[]=" }                   } },
-	{ MOD,   'g',           { setlayout,      { "+++" }                   } },
-	{ MOD,   'b',           { setlayout,      { "TTT" }                   } },
-	{ MOD,   'm',           { setlayout,      { "[ ]" }                   } },
-	{ MOD,   ' ',           { setlayout,      { NULL }                    } },
-	{ MOD,   'h',           { setmfact,       { "-0.05" }                 } },
-	{ MOD,   'l',           { setmfact,       { "+0.05" }                 } },
-	{ MOD,   '.',           { toggleminimize, { NULL }                    } },
-	{ MOD,   's',           { togglebar,      { NULL }                    } },
-	{ MOD,   'M',           { togglemouse,    { NULL }                    } },
-	{ MOD,   '\n',          { zoom ,          { NULL }                    } },
-	{ MOD,   '1',           { focusn,         { "1" }                     } },
-	{ MOD,   '2',           { focusn,         { "2" }                     } },
-	{ MOD,   '3',           { focusn,         { "3" }                     } },
-	{ MOD,   '4',           { focusn,         { "4" }                     } },
-	{ MOD,   '5',           { focusn,         { "5" }                     } },
-	{ MOD,   '6',           { focusn,         { "6" }                     } },
-	{ MOD,   '7',           { focusn,         { "7" }                     } },
-	{ MOD,   '8',           { focusn,         { "8" }                     } },
-	{ MOD,   '9',           { focusn,         { "9" }                     } },
-	{ MOD,   '\t',          { focuslast,      { NULL }                    } },
-	{ MOD,   'q',           { quit,           { NULL }                    } },
-	{ MOD,   'a',           { togglerunall,   { NULL }                    } },
-	{ MOD,   'r',           { redraw,         { NULL }                    } },
-	{ MOD,   'B',           { togglebell,     { NULL }                    } },
-	{ MOD,   'v',           { copymode,       { NULL }                    } },
-	{ MOD,   '/',           { copymode,       { "/" }                     } },
-	{ MOD,   '?',           { copymode,       { "?" }                     } },
-	{ MOD,   'p',           { paste,          { NULL }                    } },
-	{ MOD,   KEY_PPAGE,     { scrollback,     { "-1" }                    } },
-	{ MOD,   KEY_NPAGE,     { scrollback,     { "1"  }                    } },
-	{ MOD,   KEY_F(1),      { create,         { "man dvtm", "dvtm help" } } },
-	{ MOD,   MOD,           { send,           { (const char []){MOD, 0} } } },
-	{ NOMOD, KEY_SPREVIOUS, { scrollback,     { "-1" }                    } },
-	{ NOMOD, KEY_SNEXT,     { scrollback,     { "1"  }                    } },
+static KeyBinding bindings[] = {
+	{ { MOD, 'c',          }, { create,         { NULL }                    } },
+	{ { MOD, 'C',          }, { create,         { NULL, NULL, "$CWD" }      } },
+	{ { MOD, 'x',          }, { killclient,     { NULL }                    } },
+	{ { MOD, 'j',          }, { focusnext,      { NULL }                    } },
+	{ { MOD, 'u',          }, { focusnextnm,    { NULL }                    } },
+	{ { MOD, 'i',          }, { focusprevnm,    { NULL }                    } },
+	{ { MOD, 'k',          }, { focusprev,      { NULL }                    } },
+	{ { MOD, 'd',          }, { setlayout,      { "[]=" }                   } },
+	{ { MOD, 'g',          }, { setlayout,      { "+++" }                   } },
+	{ { MOD, 'b',          }, { setlayout,      { "TTT" }                   } },
+	{ { MOD, 'm',          }, { setlayout,      { "[ ]" }                   } },
+	{ { MOD, ' ',          }, { setlayout,      { NULL }                    } },
+	{ { MOD, 'h',          }, { setmfact,       { "-0.05" }                 } },
+	{ { MOD, 'l',          }, { setmfact,       { "+0.05" }                 } },
+	{ { MOD, '.',          }, { toggleminimize, { NULL }                    } },
+	{ { MOD, 's',          }, { togglebar,      { NULL }                    } },
+	{ { MOD, 'M',          }, { togglemouse,    { NULL }                    } },
+	{ { MOD, '\n',         }, { zoom ,          { NULL }                    } },
+	{ { MOD, '1',          }, { focusn,         { "1" }                     } },
+	{ { MOD, '2',          }, { focusn,         { "2" }                     } },
+	{ { MOD, '3',          }, { focusn,         { "3" }                     } },
+	{ { MOD, '4',          }, { focusn,         { "4" }                     } },
+	{ { MOD, '5',          }, { focusn,         { "5" }                     } },
+	{ { MOD, '6',          }, { focusn,         { "6" }                     } },
+	{ { MOD, '7',          }, { focusn,         { "7" }                     } },
+	{ { MOD, '8',          }, { focusn,         { "8" }                     } },
+	{ { MOD, '9',          }, { focusn,         { "9" }                     } },
+	{ { MOD, '\t',         }, { focuslast,      { NULL }                    } },
+	{ { MOD, 'q',          }, { quit,           { NULL }                    } },
+	{ { MOD, 'a',          }, { togglerunall,   { NULL }                    } },
+	{ { MOD, CTRL('L'),    }, { redraw,         { NULL }                    } },
+	{ { MOD, 'r',          }, { redraw,         { NULL }                    } },
+	{ { MOD, 'B',          }, { togglebell,     { NULL }                    } },
+	{ { MOD, 'e',          }, { copymode,       { NULL }                    } },
+	{ { MOD, '/',          }, { copymode,       { "/" }                     } },
+	{ { MOD, 'p',          }, { paste,          { NULL }                    } },
+	{ { MOD, KEY_PPAGE,    }, { scrollback,     { "-1" }                    } },
+	{ { MOD, KEY_NPAGE,    }, { scrollback,     { "1"  }                    } },
+	{ { MOD, '?',          }, { create,         { "man dvtm", "dvtm help" } } },
+	{ { MOD, MOD,          }, { send,           { (const char []){MOD, 0} } } },
+	{ { KEY_SPREVIOUS,     }, { scrollback,     { "-1" }                    } },
+	{ { KEY_SNEXT,         }, { scrollback,     { "1"  }                    } },
+	{ { MOD, '0',          }, { view,           { NULL }                    } },
+	{ { MOD, KEY_F(1),     }, { view,           { tags[0] }                 } },
+	{ { MOD, KEY_F(2),     }, { view,           { tags[1] }                 } },
+	{ { MOD, KEY_F(3),     }, { view,           { tags[2] }                 } },
+	{ { MOD, KEY_F(4),     }, { view,           { tags[3] }                 } },
+	{ { MOD, KEY_F(5),     }, { view,           { tags[4] }                 } },
+	{ { MOD, 'v', '1'      }, { view,           { tags[0] }                 } },
+	{ { MOD, 'v', '2'      }, { view,           { tags[1] }                 } },
+	{ { MOD, 'v', '3'      }, { view,           { tags[2] }                 } },
+	{ { MOD, 'v', '4'      }, { view,           { tags[3] }                 } },
+	{ { MOD, 'v', '5'      }, { view,           { tags[4] }                 } },
+	{ { MOD, 'v', '\t',    }, { viewprevtag,    { NULL }                    } },
+	{ { MOD, 't', '0'      }, { tag,            { NULL }                    } },
+	{ { MOD, 't', '1'      }, { tag,            { tags[0] }                 } },
+	{ { MOD, 't', '2'      }, { tag,            { tags[1] }                 } },
+	{ { MOD, 't', '3'      }, { tag,            { tags[2] }                 } },
+	{ { MOD, 't', '4'      }, { tag,            { tags[3] }                 } },
+	{ { MOD, 't', '5'      }, { tag,            { tags[4] }                 } },
+	{ { MOD, 'V', '1'      }, { toggleview,     { tags[0] }                 } },
+	{ { MOD, 'V', '2'      }, { toggleview,     { tags[1] }                 } },
+	{ { MOD, 'V', '3'      }, { toggleview,     { tags[2] }                 } },
+	{ { MOD, 'V', '4'      }, { toggleview,     { tags[3] }                 } },
+	{ { MOD, 'V', '5'      }, { toggleview,     { tags[4] }                 } },
+	{ { MOD, 'T', '1'      }, { toggletag,      { tags[0] }                 } },
+	{ { MOD, 'T', '2'      }, { toggletag,      { tags[1] }                 } },
+	{ { MOD, 'T', '3'      }, { toggletag,      { tags[2] }                 } },
+	{ { MOD, 'T', '4'      }, { toggletag,      { tags[3] }                 } },
+	{ { MOD, 'T', '5'      }, { toggletag,      { tags[4] }                 } },
 };
 
 static const ColorRule colorrules[] = {
-	{ "", A_NORMAL, -1, -1 }, /* default */
-#if 0
-	/* title attrs     fgcolor      bgcolor */
-	{ "ssh", A_NORMAL, COLOR_BLACK, 224      },
-#endif
+	{ "", A_NORMAL, &colors[DEFAULT] }, /* default */
 };
 
 /* possible values for the mouse buttons are listed below:
@@ -157,3 +204,18 @@
 static char const * const keytable[] = {
 	/* add your custom key escape sequences */
 };
+
+/* editor to use for copy mode. If neither of DVTM_EDITOR, EDITOR and PAGER is
+ * set the first entry is chosen. Otherwise the array is consulted for supported
+ * options. A %d in argv is replaced by the line number at which the file should
+ * be opened. If filter is true the editor is expected to work even if stdout is
+ * redirected (i.e. not a terminal).
+ */
+static Editor editors[] = {
+	{ .name = "vis",         .argv = { "vis", "+%d", "-", NULL  }, .filter = true  },
+	{ .name = "sandy",       .argv = { "sandy", "-d", "-", NULL }, .filter = true  },
+	{ .name = "dvtm-editor", .argv = { "dvtm-editor", "-", NULL }, .filter = true  },
+	{ .name = "vim",         .argv = { "vim", "+%d", "-", NULL  }, .filter = false },
+	{ .name = "less",        .argv = { "less", "+%d", NULL      }, .filter = false },
+	{ .name = "more",        .argv = { "more", "+%d", NULL      }, .filter = false },
+};


More information about the arch-commits mailing list