dot

packages and services management
Log | Files | Refs | README

commit b3fc1a8bdc1ec7ff77b496271c8693bb8b1b8523
parent 3b4b670636a19eacafba0a9f7c8c10dd1d675159
Author: josuah <mail@josuah.net>
Date:   Tue, 27 Dec 2016 11:30:17 +0000

Updated dvtm config

Diffstat:
M.config/dvtm/config.h | 167++++++++++++++++++++++++++++++++++++++++++++++++-------------------------------
M.config/dvtm/dvtm-statusline.diff | 14+++++++-------
M.config/git/config | 4++--
M.profile | 16+++++++---------
4 files changed, 117 insertions(+), 84 deletions(-)

diff --git a/.config/dvtm/config.h b/.config/dvtm/config.h @@ -1,3 +1,5 @@ +/* colors --------------------------------------------------------------------*/ + /* valid curses attributes are listed below they can be ORed * * A_NORMAL Normal display (no highlight) @@ -11,123 +13,148 @@ * A_INVIS Invisible or blank mode */ -enum { - DEFAULT, - BLACK, - RED, - GREEN, - YELLOW, - BLUE, - MAGENTA, - CYAN, - WHITE, -}; +enum { DEFAULT, RED, BLACK, }; static Color colors[] = { - [DEFAULT] = { .fg = -1, .bg = -1, .fg256 = -1, .bg256 = -1, }, - [BLACK] = { .fg = COLOR_BLACK, .bg = -1, .fg256 = 0, .bg256 = -1, }, - [RED] = { .fg = COLOR_RED, .bg = -1, .fg256 = 1, .bg256 = -1, }, - [GREEN] = { .fg = COLOR_GREEN, .bg = -1, .fg256 = 2, .bg256 = -1, }, - [YELLOW] = { .fg = COLOR_YELLOW, .bg = -1, .fg256 = 3, .bg256 = -1, }, - [BLUE] = { .fg = COLOR_BLUE, .bg = -1, .fg256 = 4, .bg256 = -1, }, - [MAGENTA] = { .fg = COLOR_MAGENTA, .bg = -1, .fg256 = 5, .bg256 = -1, }, - [CYAN] = { .fg = COLOR_CYAN, .bg = -1, .fg256 = 6, .bg256 = -1, }, - [WHITE] = { .fg = COLOR_WHITE, .bg = -1, .fg256 = 7, .bg256 = -1, }, + [DEFAULT] = { .fg = -1, .bg = -1, .fg256 = -1, .bg256 = -1, }, + [RED] = { .fg = COLOR_RED, .bg = -1, .fg256 = 1, .bg256 = -1, }, + [BLACK] = { .fg = COLOR_BLACK, .bg = -1, .fg256 = 0, .bg256 = -1, }, }; #define COLOR(c) COLOR_PAIR(colors[c].pair) + +static const ColorRule colorrules[] = { + { "", A_NORMAL, &colors[DEFAULT] }, /* default */ +}; + + +/* borders -------------------------------------------------------------------*/ + /* curses attributes for the currently focused window */ -#define SELECTED_ATTR (COLOR(DEFAULT) | A_BOLD) +#define SELECTED_ATTR A_BOLD + /* curses attributes for normal (not selected) windows */ #define NORMAL_ATTR (COLOR(BLACK) | A_BOLD) + /* curses attributes for a window with pending urgent flag */ -#define URGENT_ATTR NORMAL_ATTR +#define URGENT_ATTR (COLOR(RED) | A_BOLD) + + +/* status bar ----------------------------------------------------------------*/ + /* curses attributes for the status bar */ #define BAR_ATTR (COLOR(DEFAULT) | A_NORMAL) -/* characters for beginning and end of status bar message */ -#define BAR_BEGIN ' ' -#define BAR_END ' ' + /* status bar (command line option -s) position */ #define BAR_POS BAR_TOP /* BAR_BOTTOM, BAR_OFF */ + /* whether status bar should be hidden if only one client exists */ #define BAR_AUTOHIDE true -/* master width factor [0.1 .. 0.9] */ -#define MFACT 0.5 -/* number of clients in master area */ -#define NMASTER 1 -/* scroll back buffer size in lines */ -#define SCROLL_HISTORY 5000 -/* printf format string for the tag in the status bar */ -#define TAG_SYMBOL " %s " -#define TAG_START "" -#define TAG_STOP "" -#define TAG_SEP "│" + +/* format strings for the tags */ +#define TAG_SYMBOL " %s " /* printf format string */ +#define TAG_BEGIN "" +#define TAG_END "" +#define TAG_SEPARATOR "│" + +/* status for status line */ +#define BAR_BEGIN ' ' +#define BAR_END ' ' + + +/* tags ----------------------------------------------------------------------*/ + +const char tags[][8] = { "1", "2", "3 mail", "4 chat", "5 music" }; + /* curses attributes for the currently selected tags */ -#define TAG_SEL (COLOR(DEFAULT) | A_BOLD) +#define TAG_SEL (COLOR(DEFAULT) | A_REVERSE) + /* curses attributes for not selected tags which contain no windows */ -#define TAG_NORMAL (COLOR(BLACK) | A_BOLD) +#define TAG_NORMAL (COLOR(BLACK) | A_BOLD) + /* curses attributes for not selected tags which contain windows */ -#define TAG_OCCUPIED (COLOR(DEFAULT) | A_NORMAL) +#define TAG_OCCUPIED (COLOR(DEFAULT) | A_BOLD) + /* curses attributes for not selected tags which with urgent windows */ -#define TAG_URGENT (COLOR(RED) | A_BOLD) +#define TAG_URGENT (COLOR(RED) | A_BOLD) -const char tags[][8] = { "1", "2", "3 mails", "4 chat", "5 music" }; + +/* layouts -------------------------------------------------------------------*/ + +/* master width factor [0.1 .. 0.9] */ +#define MFACT 0.5 + +/* number of clients in master area */ +#define NMASTER 1 #include "tile.c" #include "grid.c" -#include "fullscreen.c" #include "bstack.c" #include "tstack.c" #include "vstack.c" +#include "fullscreen.c" #include "fibonacci.c" /* by default the first layout entry is used */ static Layout layouts[] = { { "│├┤f", tile }, - { "├┼┤g", grid }, { "├┬┤b", bstack }, { "├┴┤u", tstack }, { "├─┤n", vstack }, + { "├┼┤g", grid }, { "│@│o", spiral }, { "│&│w", dwindle }, { "│ │m", fullscreen }, }; -#define MOD CTRL(' ') + +/* keybindings ---------------------------------------------------------------*/ + +#define MOD CTRL('@') + #define TAGKEYS(KEY,TAG) \ { { MOD, 'v', KEY, }, { view, { tags[TAG] } } }, \ { { MOD, 't', KEY, }, { tag, { tags[TAG] } } }, \ { { MOD, 'V', KEY, }, { toggleview, { tags[TAG] } } }, \ - { { MOD, 'T', KEY, }, { toggletag, { tags[TAG] } } }, + { { MOD, 'T', KEY, }, { toggletag, { tags[TAG] } } }, \ + { { MOD, KEY_F(KEY), }, { view, { tags[TAG] } } }, /* you can specifiy at most 3 arguments */ static KeyBinding bindings[] = { { { MOD, 'c', }, { create, { NULL } } }, { { MOD, 'C', }, { create, { NULL, NULL, "$CWD" } } }, + { { MOD, '?', }, { create, { "man dvtm", "dvtm help" } } }, { { MOD, 'x', 'x', }, { killclient, { NULL } } }, + { { MOD, 'q', 'q', }, { quit, { NULL } } }, + { { MOD, 'j', }, { focusnext, { NULL } } }, { { MOD, 'J', }, { focusnextnm, { NULL } } }, { { MOD, 'K', }, { focusprevnm, { NULL } } }, { { MOD, 'k', }, { focusprev, { NULL } } }, + { { MOD, 'f', }, { setlayout, { "│├┤f" } } }, - { { MOD, 'g', }, { setlayout, { "├┼┤g" } } }, { { MOD, 'b', }, { setlayout, { "├┬┤b" } } }, { { MOD, 'u', }, { setlayout, { "├┴┤u" } } }, { { MOD, 'n', }, { setlayout, { "├─┤n" } } }, + { { MOD, 'g', }, { setlayout, { "├┼┤g" } } }, { { MOD, 'o', }, { setlayout, { "│@│o" } } }, { { MOD, 'w', }, { setlayout, { "│&│w" } } }, { { MOD, 'm', }, { setlayout, { "│ │m" } } }, { { MOD, ' ', }, { setlayout, { NULL } } }, + { { MOD, 'i', }, { incnmaster, { "+1" } } }, { { MOD, 'd', }, { incnmaster, { "-1" } } }, { { MOD, 'h', }, { setmfact, { "-0.05" } } }, { { MOD, 'l', }, { setmfact, { "+0.05" } } }, + { { MOD, '.', }, { toggleminimize, { NULL } } }, { { MOD, 's', }, { togglebar, { NULL } } }, { { MOD, 'S', }, { togglebarpos, { NULL } } }, { { MOD, 'M', }, { togglemouse, { NULL } } }, + { { MOD, '\n', }, { zoom , { NULL } } }, { { MOD, '\r', }, { zoom , { NULL } } }, + { { MOD, '1', }, { focusn, { "1" } } }, { { MOD, '2', }, { focusn, { "2" } } }, { { MOD, '3', }, { focusn, { "3" } } }, @@ -138,37 +165,38 @@ static KeyBinding bindings[] = { { { MOD, '8', }, { focusn, { "8" } } }, { { MOD, '9', }, { focusn, { "9" } } }, { { MOD, '\t', }, { focuslast, { NULL } } }, - { { MOD, 'q', 'q', }, { quit, { NULL } } }, { { MOD, 'a', }, { togglerunall, { NULL } } }, + { { MOD, CTRL('L'), }, { redraw, { NULL } } }, { { MOD, 'r', }, { redraw, { NULL } } }, + { { MOD, MOD, }, { send, { (const char []){MOD, 0} } } }, + { { 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, 'v', '0' }, { view, { NULL } } }, { { MOD, 'v', '\t', }, { viewprevtag, { NULL } } }, { { MOD, 't', '0' }, { tag, { NULL } } }, - TAGKEYS( '1', 0) - TAGKEYS( '2', 1) - TAGKEYS( '3', 2) - TAGKEYS( '4', 3) - TAGKEYS( '5', 4) + TAGKEYS( '1', 0) + TAGKEYS( '2', 1) + TAGKEYS( '3', 2) + TAGKEYS( '4', 3) + TAGKEYS( '5', 4) }; -static const ColorRule colorrules[] = { - { "", A_NORMAL, &colors[DEFAULT] }, /* default */ +static char const * const keytable[] = { + /* add your custom key escape sequences */ }; + +/* mouse ---------------------------------------------------------------------*/ + /* possible values for the mouse buttons are listed below: * * BUTTON1_PRESSED mouse button 1 down @@ -213,11 +241,16 @@ static Button buttons[] = { }; #endif /* CONFIG_MOUSE */ + +/* commands ------------------------------------------------------------------*/ + static Cmd commands[] = { /* create [cmd]: create a new window, run `cmd` in the shell if specified */ { "create", { create, { NULL } } }, + /* focus <win_id>: focus the window whose `DVTM_WINDOW_ID` is `win_id` */ { "focus", { focusid, { NULL } } }, + /* tag <win_id> <tag> [tag ...]: add +tag, remove -tag or set tag of the window with the given identifier */ { "tag", { tagid, { NULL } } }, }; @@ -227,22 +260,24 @@ static Action actions[] = { { create, { NULL } }, }; -static char const * const keytable[] = { - /* add your custom key escape sequences */ -}; + +/* copymode ------------------------------------------------------------------*/ + +/* scroll back buffer size in lines */ +#define SCROLL_HISTORY 500 /* 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). If color is true then color escape sequences - * are generated in the output. + * redirected (i.e. not a terminal). If color is true then color escape + * sequences are generated in the output. */ static Editor editors[] = { - { .name = "dvtm-editor", .argv = { "dvtm-editor", "-", NULL }, .filter = true, .color = false }, { .name = "vis", .argv = { "vis", "+%d", "-", NULL }, .filter = true, .color = false }, - { .name = "vim", .argv = { "vim", "+%d", "-", NULL }, .filter = true, .color = false }, { .name = "sandy", .argv = { "sandy", "-d", "-", NULL }, .filter = true, .color = false }, + { .name = "dvtm-editor", .argv = { "dvtm-editor", "-", NULL }, .filter = true, .color = false }, + { .name = "vim", .argv = { "vim", "+%d", "-", NULL }, .filter = false, .color = false }, { .name = "less", .argv = { "less", "-R", "+%d", NULL }, .filter = false, .color = true }, { .name = "more", .argv = { "more", "+%d", NULL }, .filter = false, .color = false }, }; diff --git a/.config/dvtm/dvtm-statusline.diff b/.config/dvtm/dvtm-statusline.diff @@ -7,10 +7,10 @@ index fec230a..702c76f 100644 #define SCROLL_HISTORY 500 /* printf format string for the tag in the status bar */ -#define TAG_SYMBOL "[%s]" -+#define TAG_SYMBOL " %s " -+#define TAG_START "[" -+#define TAG_STOP "]" -+#define TAG_SEP "|" ++#define TAG_SYMBOL " %s " ++#define TAG_BEGIN "[" ++#define TAG_END "]" ++#define TAG_SEPARATOR "|" /* curses attributes for the currently selected tags */ #define TAG_SEL (COLOR(BLUE) | A_BOLD) /* curses attributes for not selected tags which contain no windows */ @@ -23,7 +23,7 @@ index 4bbf8eb..9d3c709 100644 move(bar.y, 0); + attrset(BAR_ATTR); -+ printw(TAG_START); ++ printw(TAG_BEGIN); for (unsigned int i = 0; i < LENGTH(tags); i++){ if (tagset[seltags] & (1 << i)) attrset(TAG_SEL); @@ -34,11 +34,11 @@ index 4bbf8eb..9d3c709 100644 + + if (i < LENGTH(tags) - 1) { + attrset(BAR_ATTR); -+ printw(TAG_SEP); ++ printw(TAG_SEPARATOR); + } } + attrset(BAR_ATTR); -+ printw(TAG_STOP); ++ printw(TAG_END); - attrset(runinall ? TAG_SEL : TAG_NORMAL); + attrset(runinall ? TAG_SEL : BAR_ATTR); diff --git a/.config/git/config b/.config/git/config @@ -19,8 +19,8 @@ # Most common operations a = add -A c = commit - p = push origin master - u = pull origin master + p = push + u = pull s = status -s -b l = log --graph --color --pretty=format:"%C(yellow)%H%C(green)%d%C(reset)%n%x20%cd%n%x20%cn%x20(%ce)%n%x20%s%n" acp = !git a && git c && git p diff --git a/.profile b/.profile @@ -22,13 +22,16 @@ export NAME='Josuah Demangeon' export EMAIL='mail@josuah.net' export MAIL="$HOME/mail/INBOX" +# dvtm +export DVTM_TERM='ansi' +export DVTM_EDITOR="$PAGER" + # default commands export EDITOR="vim" export VISUAL="$EDITOR" export FCEDIT="$EDITOR" export PAGER="less" export MANPAGER="$PAGER" -export DVTM_EDITOR="$PAGER" # xdg base directory export XDG_DATA_HOME="$HOME/.local/share" @@ -46,7 +49,9 @@ export PS1='$( printf "\033[?6c" # current path with "$HOME" replaced with '~' + printf "\033[30;1m" [ -z "${PWD##$HOME*}" ] && printf ~%s "${PWD#$HOME}" || printf %s "$PWD" + printf "\033[m" # git branch and status git-prompt @@ -200,13 +205,6 @@ screencast() # Startup #_______________________________________________________________________________ -case "$TERM" in -linux ) - setfont ~/.local/share/consolefonts/tamsyn-16n.psf - ;; -dvtm ) - export TERM='screen' - ;; -esac +[ "$TERM" = 'linux' ] && setfont ~/.local/share/consolefonts/tamsyn-16n.psf [ "$ABDUCO" ] || TERM='screen' ABDUCO='dvtm' abduco -A dvtm dvtm-status