dot

packages and services management
Log | Files | Refs | README

commit ba0123c55a3cb1222fb848f836e1231680caaa47
parent f524f53f78fe3ebdee471cf76339068361a492dd
Author: josuah <mail@josuah.net>
Date:   Wed, 26 Oct 2016 21:55:24 -0400

Simple enough compositor

Diffstat:
ABUILD/unagi | 3+++
Mbin/config-build | 2+-
Mdvtm/config.h | 36+++++++++++++++++++++++++-----------
Advtm/dvtm.c-0.14-pertag.diff | 215+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Rst/st-0.6-argbbg.diff -> st/st-alpha-0.6.diff | 0
Mvim/.vim/vimrc | 10++++++----
Mxorg/.xinitrc | 4++--
7 files changed, 252 insertions(+), 18 deletions(-)

diff --git a/BUILD/unagi b/BUILD/unagi @@ -0,0 +1,3 @@ +# Unagi Compositing Manager + +tar=http://projects.mini-dweeb.org/attachments/download/114/unagi-0.3.4.tar.gz diff --git a/bin/config-build b/bin/config-build @@ -120,7 +120,7 @@ build() { for patch in $(find "$CONFIG/$1" -name '*.diff') do - patch -Np1 < "$patch" + patch -p1 < "$patch" done [ -f "$CONFIG/$1/config.mk" ] && cp -f "$CONFIG/$1/config.mk" . diff --git a/dvtm/config.h b/dvtm/config.h @@ -13,23 +13,37 @@ enum { DEFAULT, + BLACK, + RED, + GREEN, + YELLOW, BLUE, + MAGENTA, + CYAN, + WHITE, }; 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, }, + [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, }, }; #define COLOR(c) COLOR_PAIR(colors[c].pair) /* curses attributes for the currently focused window */ -#define SELECTED_ATTR (COLOR(BLUE) | A_NORMAL) +#define SELECTED_ATTR (COLOR(DEFAULT) | A_BOLD) /* curses attributes for normal (not selected) windows */ -#define NORMAL_ATTR (COLOR(DEFAULT) | A_NORMAL) +#define NORMAL_ATTR (COLOR(BLACK) | A_BOLD) /* curses attributes for a window with pending urgent flag */ #define URGENT_ATTR NORMAL_ATTR /* curses attributes for the status bar */ -#define BAR_ATTR (COLOR(BLUE) | A_NORMAL) +#define BAR_ATTR (COLOR(DEFAULT) | A_NORMAL) /* characters for beginning and end of status bar message */ #define BAR_BEGIN ' ' #define BAR_END ' ' @@ -44,17 +58,17 @@ static Color colors[] = { /* 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_SYMBOL " %s " /* curses attributes for the currently selected tags */ -#define TAG_SEL (COLOR(BLUE) | A_BOLD) +#define TAG_SEL (COLOR(DEFAULT) | A_BOLD) /* curses attributes for not selected tags which contain no windows */ -#define TAG_NORMAL (COLOR(DEFAULT) | A_NORMAL) +#define TAG_NORMAL (COLOR(BLACK) | A_BOLD) /* curses attributes for not selected tags which contain windows */ -#define TAG_OCCUPIED (COLOR(BLUE) | A_NORMAL) +#define TAG_OCCUPIED (COLOR(DEFAULT) | A_NORMAL) /* curses attributes for not selected tags which with urgent windows */ -#define TAG_URGENT (COLOR(BLUE) | A_NORMAL | A_BLINK) +#define TAG_URGENT (COLOR(RED) | A_BOLD) -const char tags[][8] = { " |", " ||", "|||" }; +const char tags[][8] = { "|", "||", "|||" }; #include "tile.c" #include "grid.c" diff --git a/dvtm/dvtm.c-0.14-pertag.diff b/dvtm/dvtm.c-0.14-pertag.diff @@ -0,0 +1,215 @@ +diff --git a/dvtm.c b/dvtm.c +index e337061..2085e84 100644 +--- a/dvtm.c ++++ b/dvtm.c +@@ -223,9 +223,20 @@ static char *title; + + #include "config.h" + ++typedef struct { ++ unsigned int curtag, prevtag; ++ int nmaster[LENGTH(tags) + 1]; ++ float mfact[LENGTH(tags) + 1]; ++ Layout *layout[LENGTH(tags) + 1]; ++ int barpos[LENGTH(tags) + 1]; ++ int barlastpos[LENGTH(tags) + 1]; ++ bool runinall[LENGTH(tags) + 1]; ++} Pertag; ++ + /* global variables */ + static const char *dvtm_name = "dvtm"; + Screen screen = { .mfact = MFACT, .nmaster = NMASTER, .history = SCROLL_HISTORY }; ++static Pertag pertag; + static Client *stack = NULL; + static Client *sel = NULL; + static Client *lastsel = NULL; +@@ -302,15 +313,15 @@ updatebarpos(void) { + static void + hidebar(void) { + if (bar.pos != BAR_OFF) { +- bar.lastpos = bar.pos; +- bar.pos = BAR_OFF; ++ bar.lastpos = pertag.barlastpos[pertag.curtag] = bar.pos; ++ bar.pos = pertag.barpos[pertag.curtag] = BAR_OFF; + } + } + + static void + showbar(void) { + if (bar.pos == BAR_OFF) +- bar.pos = bar.lastpos; ++ bar.pos = pertag.barpos[pertag.curtag] = bar.lastpos; + } + + static void +@@ -389,7 +400,7 @@ draw_border(Client *c) { + + if (!show_border()) + return; +- if (sel == c || (runinall && !c->minimized)) ++ if (sel == c || (pertag.runinall[pertag.curtag] && !c->minimized)) + attrs = SELECTED_ATTR; + if (sel != c && c->urgent) + attrs = URGENT_ATTR; +@@ -808,9 +819,33 @@ toggletag(const char *args[]) { + } + + static void ++setpertag(void) { ++ screen.nmaster = pertag.nmaster[pertag.curtag]; ++ screen.mfact = pertag.mfact[pertag.curtag]; ++ layout = pertag.layout[pertag.curtag]; ++ if (bar.pos != pertag.barpos[pertag.curtag]) { ++ bar.pos = pertag.barpos[pertag.curtag]; ++ updatebarpos(); ++ } ++ bar.lastpos = pertag.barlastpos[pertag.curtag]; ++ runinall = pertag.runinall[pertag.curtag]; ++} ++ ++static void + toggleview(const char *args[]) { ++ int i; ++ + unsigned int newtagset = tagset[seltags] ^ (bitoftag(args[0]) & TAGMASK); + if (newtagset) { ++ if(newtagset == TAGMASK) { ++ pertag.prevtag = pertag.curtag; ++ pertag.curtag = 0; ++ } else if(!(newtagset & 1 << (pertag.curtag - 1))) { ++ pertag.prevtag = pertag.curtag; ++ for (i=0; !(newtagset &1 << i); i++) ; ++ pertag.curtag = i + 1; ++ } ++ setpertag(); + tagset[seltags] = newtagset; + tagschanged(); + } +@@ -818,9 +853,19 @@ toggleview(const char *args[]) { + + static void + view(const char *args[]) { ++ int i; ++ + unsigned int newtagset = bitoftag(args[0]) & TAGMASK; + if (tagset[seltags] != newtagset && newtagset) { + seltags ^= 1; /* toggle sel tagset */ ++ pertag.prevtag = pertag.curtag; ++ if(args[0] == NULL) ++ pertag.curtag = 0; ++ else { ++ for (i = 0; (i < LENGTH(tags)) && (tags[i] != args[0]); i++) ; ++ pertag.curtag = i + 1; ++ } ++ setpertag(); + tagset[seltags] = newtagset; + tagschanged(); + } +@@ -828,7 +873,13 @@ view(const char *args[]) { + + static void + viewprevtag(const char *args[]) { ++ unsigned int tmptag; ++ + seltags ^= 1; ++ tmptag = pertag.prevtag; ++ pertag.prevtag = pertag.curtag; ++ pertag.curtag = tmptag; ++ setpertag(); + tagschanged(); + } + +@@ -845,7 +896,7 @@ keypress(int code) { + nodelay(stdscr, FALSE); + } + +- for (Client *c = runinall ? nextvisible(clients) : sel; c; c = nextvisible(c->next)) { ++ for (Client *c = pertag.runinall[pertag.curtag] ? nextvisible(clients) : sel; c; c = nextvisible(c->next)) { + if (is_content_visible(c)) { + c->urgent = false; + if (code == '\e') +@@ -853,7 +904,7 @@ keypress(int code) { + else + vt_keypress(c->term, code); + } +- if (!runinall) ++ if (!pertag.runinall[pertag.curtag]) + break; + } + } +@@ -872,6 +923,21 @@ mouse_setup(void) { + #endif /* CONFIG_MOUSE */ + } + ++static void ++initpertag(void) { ++ int i; ++ ++ pertag.curtag = pertag.prevtag = 1; ++ for(i=0; i <= LENGTH(tags); i++) { ++ pertag.nmaster[i] = screen.nmaster; ++ pertag.mfact[i] = screen.mfact; ++ pertag.layout[i] = layout; ++ pertag.barpos[i] = bar.pos; ++ pertag.barlastpos[i] = bar.lastpos; ++ pertag.runinall[i] = runinall; ++ } ++} ++ + static bool + checkshell(const char *shell) { + if (shell == NULL || *shell == '\0' || *shell != '/') +@@ -917,6 +983,7 @@ setup(void) { + } + colors[i].pair = vt_color_reserve(colors[i].fg, colors[i].bg); + } ++ initpertag(); + resize_screen(); + struct sigaction sa; + sa.sa_flags = 0; +@@ -1247,6 +1314,7 @@ setlayout(const char *args[]) { + return; + layout = &layouts[i]; + } ++ pertag.layout[pertag.curtag] = layout; + arrange(); + } + +@@ -1267,6 +1335,7 @@ incnmaster(const char *args[]) { + if (screen.nmaster < 1) + screen.nmaster = 1; + } ++ pertag.nmaster[pertag.curtag] = screen.nmaster; + arrange(); + } + +@@ -1289,6 +1358,7 @@ setmfact(const char *args[]) { + else if (screen.mfact > 0.9) + screen.mfact = 0.9; + } ++ pertag.mfact[pertag.curtag] = screen.mfact; + arrange(); + } + +@@ -1313,10 +1383,10 @@ static void + togglebarpos(const char *args[]) { + switch (bar.pos == BAR_OFF ? bar.lastpos : bar.pos) { + case BAR_TOP: +- bar.pos = BAR_BOTTOM; ++ bar.pos = pertag.barpos[pertag.curtag] = BAR_BOTTOM; + break; + case BAR_BOTTOM: +- bar.pos = BAR_TOP; ++ bar.pos = pertag.barpos[pertag.curtag] = BAR_TOP; + break; + } + updatebarpos(); +@@ -1371,7 +1441,7 @@ togglemouse(const char *args[]) { + + static void + togglerunall(const char *args[]) { +- runinall = !runinall; ++ pertag.runinall[pertag.curtag] = !pertag.runinall[pertag.curtag]; + draw_all(); + } + diff --git a/st/st-0.6-argbbg.diff b/st/st-alpha-0.6.diff diff --git a/vim/.vim/vimrc b/vim/.vim/vimrc @@ -13,10 +13,11 @@ syntax enable | filetype plugin on | set nocompatible set omnifunc=syntaxcomplete#Complete " Completion set autoindent copyindent " Indentation -set laststatus=2 showcmd ruler showmode " Status +set laststatus=0 showcmd showmode " Statusline +set ruler rulerformat=%40(%1*%f%=%l:%-3v\ %P%) " Ruler set smartcase ignorecase showmatch incsearch " Searching set list listchars=tab::\ ,trail:.,nbsp:.,extends:>,precedes:< " Listchars -set fillchars=stl:─,stlnc:─,vert:│,fold:─,diff:─ " Fillchars +set fillchars=vert:│,fold:─,diff:─ " Fillchars set number numberwidth=1 cursorline nowrap " Interface set scrolloff=3 " Scroll set backupdir=~/.cache/vim// directory=~/.cache/vim// undodir=~/.cache/vim// @@ -24,7 +25,7 @@ set virtualedit=block formatprg=fmt " Editing set wildmenu wildmode=longest:full,full " Completion set hidden " Buffers set showfulltag " Compilation -let &colorcolumn=join(range(81,120),",") +let &colorcolumn=join(range(81,90),",") " MAPPINGS @@ -102,7 +103,8 @@ highlight CursorLineNr cterm=bold ctermfg=1 highlight ColorColumn cterm=none ctermfg=1 ctermbg=none highlight LineNr cterm=bold ctermfg=0 highlight StatusLine cterm=bold ctermfg=7 -highlight StatusLineNC cterm=bold ctermfg=0 +highlight StatusLineNC cterm=bold ctermfg=7 +highlight User1 cterm=bold ctermfg=7 highlight ModeMsg cterm=bold ctermfg=1 ctermbg=0 highlight WildMenu cterm=none ctermfg=0 ctermbg=1 highlight VertSplit cterm=none ctermfg=7 ctermbg=none diff --git a/xorg/.xinitrc b/xorg/.xinitrc @@ -10,7 +10,7 @@ done & nm-applet & xfce4-power-manager & -#feh --bg-center ~/Images/Interstellar.png -#compton & +feh --bg-fill ~/Images/interstellar-2.png +unagi & exec dwm