├── README.md ├── bin ├── emacsc └── ii-client ├── funtoo ├── dwm-6.1-r1 │ ├── dwm-6.1-r1.config.h │ ├── dwm-horizgrid-6.1.diff │ └── dwm-pertag-6.1.diff ├── st-0.7 │ ├── st-0.7.config.h │ └── st-scrollback-0.7.diff └── st-git │ ├── st-9999.config.h │ ├── st-disable-bold-italic-fonts.diff │ ├── st-scrollback-20170329-149c0d3.diff │ └── st-scrollback-mouse-20170427-5a10aca.diff └── openbsd ├── etc ├── doas.conf ├── installurl ├── ksh │ ├── colors │ ├── git_prompt │ ├── ksh_aliases │ ├── ksh_env │ ├── ksh_functions │ └── ksh_prompt ├── mail │ └── smtpd.conf └── wsconsctl.conf └── home ├── .Xresources ├── .config ├── bspwm │ └── bspwmrc ├── i3 │ └── config ├── i3status │ └── config ├── nvim │ └── init.vim └── sxhkd │ └── sxhkdrc ├── .cwmrc ├── .kshrc ├── .math.xmodmap ├── .profile ├── .tmux ├── .tmux.conf.lime ├── .tmux.conf.scientifica ├── .tmux.conf.ssh.lime └── .tmux.conf.ssh.scientifica ├── .weechat └── weechat.conf ├── .xinitrc ├── bin ├── cwm_panel ├── cwm_panel_bar ├── cwm_panel_var └── dmenu_custom └── lib └── profile /README.md: -------------------------------------------------------------------------------- 1 | # dotfiles 2 | improved centralized dotfiles repository 3 | -------------------------------------------------------------------------------- /bin/emacsc: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | emacsclient -c --eval '(load-file "~/.emacs")' --eval '(load-theme (quote xresources))' --eval '(dired ".")' -------------------------------------------------------------------------------- /bin/ii-client: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # to be used with suckless ii (irc client) 3 | # usage: ii-client #channel 4 | [ -d "$1" ] || exit 1 5 | tail -n 80 -f "$1/out" 6 | while IFS='' read -r line 7 | do 8 | printf '%s\n' "$line" > "$1/in" 9 | done 10 | -------------------------------------------------------------------------------- /funtoo/dwm-6.1-r1/dwm-6.1-r1.config.h: -------------------------------------------------------------------------------- 1 | /* vim: set syntax=c */ 2 | /* See LICENSE file for copyright and license details. */ 3 | 4 | #include "horizgrid.c" 5 | 6 | /* {{{ appearance */ 7 | /*static const char *fonts[] = { "Monaco for Powerline:size=8:bold:antialias=true:autohint=false" }; 8 | static const char dmenufont[] = "Monaco for Powerline:size=8:bold:antialias=true:autohint=false"; */ 9 | 10 | static const char *fonts[] = { "GohuFont:size=9:antialias=false:hinting=true" }; 11 | static const char dmenufont[] = "GohuFont:size=9:antialias=false:hinting=true"; 12 | 13 | /* {{{ zenburn-like colorscheme 14 | 15 | static const char normbordercolor[] = "#353535"; 16 | static const char normbgcolor[] = "#2c2e2f"; 17 | static const char normfgcolor[] = "#bbbbbb"; 18 | static const char selbordercolor[] = "#666666"; 19 | static const char selbgcolor[] = "#444444"; 20 | static const char selfgcolor[] = "#eeeeee"; 21 | 22 | }}} */ 23 | 24 | /* {{{ base16-ocean colorscheme */ 25 | 26 | static const char normbordercolor[] = "#65737E"; 27 | static const char normbgcolor[] = "#2b303b"; 28 | static const char normfgcolor[] = "#65737e"; 29 | static const char selbordercolor[] = "#543f5e"; 30 | static const char selbgcolor[] = "#543f5e"; 31 | static const char selfgcolor[] = "#C0C5CE"; 32 | 33 | /* }}} */ 34 | 35 | static const unsigned int borderpx = 1; /* border pixel of windows */ 36 | static const unsigned int snap = 12; /* snap pixel */ 37 | static const int showbar = 1; /* 0 means no bar */ 38 | static const int topbar = 1; /* 0 means bottom bar */ 39 | 40 | /* }}} */ 41 | 42 | /* {{{ tagging */ 43 | static const char *tags[] = { "acme", "term", "ssh", "web", "chat", "media", "misc" }; 44 | static const Rule rules[] = { 45 | /* xprop(1): 46 | * WM_CLASS(STRING) = instance, class 47 | * WM_NAME(STRING) = title 48 | */ 49 | /* class instance title tags mask isfloating monitor */ 50 | /* { "Google-chrome-beta", NULL, NULL, 4, 0, NULL }, 51 | { "Google-chrome-unstable", NULL, NULL, 4, 0, NULL }, 52 | { "Google-chrome-stable", NULL, NULL, 4, 0, NULL }, 53 | { "Sylpheed", NULL, NULL, 5, 0, NULL }, 54 | { "discord", "discord", NULL, 5, 0, NULL }, 55 | { "Gimp", NULL, NULL, 6, 0, NULL }, 56 | { "Steam", "Steam", NULL, 6, 0, NULL }, */ 57 | { NULL, NULL, NULL, NULL, NULL, NULL }, 58 | }; 59 | /* }}} */ 60 | 61 | /* {{{ layout(s) */ 62 | static const float mfact = 0.50; /* factor of master area size [0.05..0.95] */ 63 | static const int nmaster = 1; /* number of clients in master area */ 64 | static const int resizehints = 0; /* 1 means respect size hints in tiled resizals */ 65 | 66 | static const Layout layouts[] = { 67 | /* symbol arrange function */ 68 | { "[]=", tile }, /* first entry is default */ 69 | { "><>", NULL }, /* no layout function means floating behavior */ 70 | { "[ ]", monocle }, 71 | { "###", horizgrid }, 72 | }; 73 | /* }}} */ 74 | 75 | /* {{{ key definitions */ 76 | #define MODKEY Mod4Mask 77 | #define TAGKEYS(KEY,TAG) \ 78 | { MODKEY, KEY, view, {.ui = 1 << TAG} }, \ 79 | { MODKEY|ControlMask, KEY, toggleview, {.ui = 1 << TAG} }, \ 80 | { MODKEY|ShiftMask, KEY, tag, {.ui = 1 << TAG} }, \ 81 | { MODKEY|ControlMask|ShiftMask, KEY, toggletag, {.ui = 1 << TAG} }, 82 | /* }}} */ 83 | 84 | /* helper for spawning shell commands in the pre dwm-5.0 fashion */ 85 | #define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } } 86 | 87 | /* {{{ commands */ 88 | static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn() */ 89 | static const char *dmenucmd[] = { "dmenu_run", "-m", dmenumon, "-fn", dmenufont, "-nb", normbgcolor, "-nf", normfgcolor, "-sb", selbgcolor, "-sf", selfgcolor, NULL }; 90 | static const char *termcmd[] = { "st", NULL }; 91 | 92 | static Key keys[] = { 93 | /* modifier key function argument */ 94 | { MODKEY, XK_p, spawn, {.v = dmenucmd } }, 95 | { MODKEY|ShiftMask, XK_Return, spawn, {.v = termcmd } }, 96 | { MODKEY, XK_b, togglebar, {0} }, 97 | { MODKEY, XK_j, focusstack, {.i = +1 } }, 98 | { MODKEY, XK_k, focusstack, {.i = -1 } }, 99 | { MODKEY, XK_i, incnmaster, {.i = +1 } }, 100 | { MODKEY, XK_d, incnmaster, {.i = -1 } }, 101 | { MODKEY, XK_h, setmfact, {.f = -0.05} }, 102 | { MODKEY, XK_l, setmfact, {.f = +0.05} }, 103 | { MODKEY, XK_Return, zoom, {0} }, 104 | { MODKEY, XK_Tab, focusstack, {.i = +1 } }, 105 | { MODKEY|ShiftMask, XK_Tab, focusstack, {.i = -1 } }, 106 | { MODKEY|ShiftMask, XK_c, killclient, {0} }, 107 | { MODKEY, XK_t, setlayout, {.v = &layouts[0]} }, 108 | { MODKEY, XK_f, setlayout, {.v = &layouts[1]} }, 109 | { MODKEY, XK_m, setlayout, {.v = &layouts[2]} }, 110 | { MODKEY, XK_g, setlayout, {.v = &layouts[3]} }, 111 | { MODKEY, XK_space, setlayout, {0} }, 112 | { MODKEY|ShiftMask, XK_space, togglefloating, {0} }, 113 | { MODKEY, XK_0, view, {.ui = ~0 } }, 114 | { MODKEY|ShiftMask, XK_0, tag, {.ui = ~0 } }, 115 | { MODKEY, XK_comma, focusmon, {.i = -1 } }, 116 | { MODKEY, XK_period, focusmon, {.i = +1 } }, 117 | { MODKEY|ShiftMask, XK_comma, tagmon, {.i = -1 } }, 118 | { MODKEY|ShiftMask, XK_period, tagmon, {.i = +1 } }, 119 | TAGKEYS( XK_1, 0) 120 | TAGKEYS( XK_2, 1) 121 | TAGKEYS( XK_3, 2) 122 | TAGKEYS( XK_4, 3) 123 | TAGKEYS( XK_5, 4) 124 | TAGKEYS( XK_6, 5) 125 | TAGKEYS( XK_7, 6) 126 | TAGKEYS( XK_8, 7) 127 | TAGKEYS( XK_9, 8) 128 | { MODKEY|ShiftMask, XK_q, quit, {0} }, 129 | }; 130 | /* }}} */ 131 | 132 | /* {{{ button definitions */ 133 | /* click can be ClkLtSymbol, ClkStatusText, ClkWinTitle, ClkClientWin, or ClkRootWin */ 134 | static Button buttons[] = { 135 | /* click event mask button function argument */ 136 | { ClkLtSymbol, 0, Button1, setlayout, {0} }, 137 | { ClkLtSymbol, 0, Button3, setlayout, {.v = &layouts[2]} }, 138 | { ClkWinTitle, 0, Button2, zoom, {0} }, 139 | { ClkStatusText, 0, Button2, spawn, {.v = termcmd } }, 140 | { ClkClientWin, MODKEY, Button1, movemouse, {0} }, 141 | { ClkClientWin, MODKEY, Button2, togglefloating, {0} }, 142 | { ClkClientWin, MODKEY, Button3, resizemouse, {0} }, 143 | { ClkTagBar, 0, Button1, view, {0} }, 144 | { ClkTagBar, 0, Button3, toggleview, {0} }, 145 | { ClkTagBar, MODKEY, Button1, tag, {0} }, 146 | { ClkTagBar, MODKEY, Button3, toggletag, {0} }, 147 | }; 148 | /* }}} */ 149 | -------------------------------------------------------------------------------- /funtoo/dwm-6.1-r1/dwm-horizgrid-6.1.diff: -------------------------------------------------------------------------------- 1 | From 064e1d48631cd9b03f32b42d7be79677197ee42f Mon Sep 17 00:00:00 2001 2 | From: Marshall Mason 3 | Date: Mon, 9 Nov 2015 12:38:28 -0800 4 | Subject: [PATCH] Added horizgrid function 5 | 6 | --- 7 | config.def.h | 2 ++ 8 | horizgrid.c | 32 ++++++++++++++++++++++++++++++++ 9 | 2 files changed, 34 insertions(+) 10 | create mode 100644 horizgrid.c 11 | 12 | diff --git a/config.def.h b/config.def.h 13 | index eaae8f3..c2ad519 100644 14 | --- a/config.def.h 15 | +++ b/config.def.h 16 | @@ -36,11 +36,13 @@ static const float mfact = 0.55; /* factor of master area size [0.05..0.95] 17 | static const int nmaster = 1; /* number of clients in master area */ 18 | static const Bool resizehints = True; /* True means respect size hints in tiled resizals */ 19 | 20 | +#include "horizgrid.c" 21 | static const Layout layouts[] = { 22 | /* symbol arrange function */ 23 | { "[]=", tile }, /* first entry is default */ 24 | { "><>", NULL }, /* no layout function means floating behavior */ 25 | { "[M]", monocle }, 26 | + { "###", horizgrid }, 27 | }; 28 | 29 | /* key definitions */ 30 | diff --git a/horizgrid.c b/horizgrid.c 31 | new file mode 100644 32 | index 0000000..51ce0f8 33 | --- /dev/null 34 | +++ b/horizgrid.c 35 | @@ -0,0 +1,32 @@ 36 | +void 37 | +horizgrid(Monitor *m) { 38 | + Client *c; 39 | + unsigned int n, i; 40 | + int w = 0; 41 | + int ntop, nbottom = 0; 42 | + 43 | + /* Count windows */ 44 | + for(n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++); 45 | + 46 | + if(n == 0) 47 | + return; 48 | + else if(n == 1) { /* Just fill the whole screen */ 49 | + c = nexttiled(m->clients); 50 | + resize(c, m->wx, m->wy, m->ww - (2*c->bw), m->wh - (2*c->bw), False); 51 | + } else if(n == 2) { /* Split vertically */ 52 | + w = m->ww / 2; 53 | + c = nexttiled(m->clients); 54 | + resize(c, m->wx, m->wy, w - (2*c->bw), m->wh - (2*c->bw), False); 55 | + c = nexttiled(c->next); 56 | + resize(c, m->wx + w, m->wy, w - (2*c->bw), m->wh - (2*c->bw), False); 57 | + } else { 58 | + ntop = n / 2; 59 | + nbottom = n - ntop; 60 | + for(i = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), i++) { 61 | + if(i < ntop) 62 | + resize(c, m->wx + i * m->ww / ntop, m->wy, m->ww / ntop - (2*c->bw), m->wh / 2 - (2*c->bw), False); 63 | + else 64 | + resize(c, m->wx + (i - ntop) * m->ww / nbottom, m->wy + m->wh / 2, m->ww / nbottom - (2*c->bw), m->wh / 2 - (2*c->bw), False); 65 | + } 66 | + } 67 | +} 68 | -- 69 | 2.1.4 70 | 71 | -------------------------------------------------------------------------------- /funtoo/dwm-6.1-r1/dwm-pertag-6.1.diff: -------------------------------------------------------------------------------- 1 | diff --git a/dwm.c b/dwm.c 2 | index 0362114..9ba4ec5 100644 3 | --- a/dwm.c 4 | +++ b/dwm.c 5 | @@ -111,6 +111,7 @@ typedef struct { 6 | void (*arrange)(Monitor *); 7 | } Layout; 8 | 9 | +typedef struct Pertag Pertag; 10 | struct Monitor { 11 | char ltsymbol[16]; 12 | float mfact; 13 | @@ -130,6 +131,7 @@ struct Monitor { 14 | Monitor *next; 15 | Window barwin; 16 | const Layout *lt[2]; 17 | + Pertag *pertag; 18 | }; 19 | 20 | typedef struct { 21 | @@ -270,6 +272,16 @@ static Window root; 22 | /* configuration, allows nested code to access above variables */ 23 | #include "config.h" 24 | 25 | +struct Pertag { 26 | + unsigned int curtag, prevtag; /* current and previous tag */ 27 | + int nmasters[LENGTH(tags) + 1]; /* number of windows in master area */ 28 | + float mfacts[LENGTH(tags) + 1]; /* mfacts per tag */ 29 | + unsigned int sellts[LENGTH(tags) + 1]; /* selected layouts */ 30 | + const Layout *ltidxs[LENGTH(tags) + 1][2]; /* matrix of tags and layouts indexes */ 31 | + Bool showbars[LENGTH(tags) + 1]; /* display bar for the current tag */ 32 | + Client *prevzooms[LENGTH(tags) + 1]; /* store zoom information */ 33 | +}; 34 | + 35 | /* compile-time check if all tags fit into an unsigned int bit array. */ 36 | struct NumTags { char limitexceeded[LENGTH(tags) > 31 ? -1 : 1]; }; 37 | 38 | @@ -526,6 +538,7 @@ clientmessage(XEvent *e) 39 | { 40 | XClientMessageEvent *cme = &e->xclient; 41 | Client *c = wintoclient(cme->window); 42 | + int i; 43 | 44 | if (!c) 45 | return; 46 | @@ -537,6 +550,8 @@ clientmessage(XEvent *e) 47 | if (!ISVISIBLE(c)) { 48 | c->mon->seltags ^= 1; 49 | c->mon->tagset[c->mon->seltags] = c->tags; 50 | + for(i=0; !(c->tags & 1 << i); i++); 51 | + view(&(Arg){.ui = 1 << i}); 52 | } 53 | pop(c); 54 | } 55 | @@ -640,6 +655,7 @@ Monitor * 56 | createmon(void) 57 | { 58 | Monitor *m; 59 | + int i; 60 | 61 | m = ecalloc(1, sizeof(Monitor)); 62 | m->tagset[0] = m->tagset[1] = 1; 63 | @@ -650,6 +666,27 @@ createmon(void) 64 | m->lt[0] = &layouts[0]; 65 | m->lt[1] = &layouts[1 % LENGTH(layouts)]; 66 | strncpy(m->ltsymbol, layouts[0].symbol, sizeof m->ltsymbol); 67 | + if (!(m->pertag = (Pertag *)calloc(1, sizeof(Pertag)))) 68 | + die("fatal: could not malloc() %u bytes\n", sizeof(Pertag)); 69 | + m->pertag->curtag = m->pertag->prevtag = 1; 70 | + for(i=0; i <= LENGTH(tags); i++) { 71 | + /* init nmaster */ 72 | + m->pertag->nmasters[i] = m->nmaster; 73 | + 74 | + /* init mfacts */ 75 | + m->pertag->mfacts[i] = m->mfact; 76 | + 77 | + /* init layouts */ 78 | + m->pertag->ltidxs[i][0] = m->lt[0]; 79 | + m->pertag->ltidxs[i][1] = m->lt[1]; 80 | + m->pertag->sellts[i] = m->sellt; 81 | + 82 | + /* init showbar */ 83 | + m->pertag->showbars[i] = m->showbar; 84 | + 85 | + /* swap focus and zoomswap*/ 86 | + m->pertag->prevzooms[i] = NULL; 87 | + } 88 | return m; 89 | } 90 | 91 | @@ -981,7 +1018,7 @@ grabkeys(void) 92 | void 93 | incnmaster(const Arg *arg) 94 | { 95 | - selmon->nmaster = MAX(selmon->nmaster + arg->i, 0); 96 | + selmon->nmaster = selmon->pertag->nmasters[selmon->pertag->curtag] = MAX(selmon->nmaster + arg->i, 0); 97 | arrange(selmon); 98 | } 99 | 100 | @@ -1517,10 +1554,13 @@ setfullscreen(Client *c, int fullscreen) 101 | void 102 | setlayout(const Arg *arg) 103 | { 104 | - if (!arg || !arg->v || arg->v != selmon->lt[selmon->sellt]) 105 | - selmon->sellt ^= 1; 106 | + if (!arg || !arg->v || arg->v != selmon->lt[selmon->sellt]) { 107 | + selmon->pertag->sellts[selmon->pertag->curtag] ^= 1; 108 | + selmon->sellt = selmon->pertag->sellts[selmon->pertag->curtag]; 109 | + } 110 | if (arg && arg->v) 111 | - selmon->lt[selmon->sellt] = (Layout *)arg->v; 112 | + selmon->pertag->ltidxs[selmon->pertag->curtag][selmon->sellt] = (Layout *)arg->v; 113 | + selmon->lt[selmon->sellt] = selmon->pertag->ltidxs[selmon->pertag->curtag][selmon->sellt]; 114 | strncpy(selmon->ltsymbol, selmon->lt[selmon->sellt]->symbol, sizeof selmon->ltsymbol); 115 | if (selmon->sel) 116 | arrange(selmon); 117 | @@ -1539,7 +1579,7 @@ setmfact(const Arg *arg) 118 | f = arg->f < 1.0 ? arg->f + selmon->mfact : arg->f - 1.0; 119 | if (f < 0.1 || f > 0.9) 120 | return; 121 | - selmon->mfact = f; 122 | + selmon->mfact = selmon->pertag->mfacts[selmon->pertag->curtag] = f; 123 | arrange(selmon); 124 | } 125 | 126 | @@ -1692,7 +1732,7 @@ tile(Monitor *m) 127 | void 128 | togglebar(const Arg *arg) 129 | { 130 | - selmon->showbar = !selmon->showbar; 131 | + selmon->showbar = selmon->pertag->showbars[selmon->pertag->curtag] = !selmon->showbar; 132 | updatebarpos(selmon); 133 | XMoveResizeWindow(dpy, selmon->barwin, selmon->wx, selmon->by, selmon->ww, bh); 134 | arrange(selmon); 135 | @@ -1731,9 +1771,29 @@ void 136 | toggleview(const Arg *arg) 137 | { 138 | unsigned int newtagset = selmon->tagset[selmon->seltags] ^ (arg->ui & TAGMASK); 139 | + int i; 140 | 141 | if (newtagset) { 142 | + if (newtagset == ~0) { 143 | + selmon->pertag->prevtag = selmon->pertag->curtag; 144 | + selmon->pertag->curtag = 0; 145 | + } 146 | + /* test if the user did not select the same tag */ 147 | + if (!(newtagset & 1 << (selmon->pertag->curtag - 1))) { 148 | + selmon->pertag->prevtag = selmon->pertag->curtag; 149 | + for (i=0; !(newtagset & 1 << i); i++) ; 150 | + selmon->pertag->curtag = i + 1; 151 | + } 152 | selmon->tagset[selmon->seltags] = newtagset; 153 | + 154 | + /* apply settings for this view */ 155 | + selmon->nmaster = selmon->pertag->nmasters[selmon->pertag->curtag]; 156 | + selmon->mfact = selmon->pertag->mfacts[selmon->pertag->curtag]; 157 | + selmon->sellt = selmon->pertag->sellts[selmon->pertag->curtag]; 158 | + selmon->lt[selmon->sellt] = selmon->pertag->ltidxs[selmon->pertag->curtag][selmon->sellt]; 159 | + selmon->lt[selmon->sellt^1] = selmon->pertag->ltidxs[selmon->pertag->curtag][selmon->sellt^1]; 160 | + if (selmon->showbar != selmon->pertag->showbars[selmon->pertag->curtag]) 161 | + togglebar(NULL); 162 | focus(NULL); 163 | arrange(selmon); 164 | } 165 | @@ -2031,11 +2091,33 @@ updatewmhints(Client *c) 166 | void 167 | view(const Arg *arg) 168 | { 169 | + int i; 170 | + unsigned int tmptag; 171 | + 172 | if ((arg->ui & TAGMASK) == selmon->tagset[selmon->seltags]) 173 | return; 174 | selmon->seltags ^= 1; /* toggle sel tagset */ 175 | - if (arg->ui & TAGMASK) 176 | + if (arg->ui & TAGMASK) { 177 | + selmon->pertag->prevtag = selmon->pertag->curtag; 178 | selmon->tagset[selmon->seltags] = arg->ui & TAGMASK; 179 | + if (arg->ui == ~0) 180 | + selmon->pertag->curtag = 0; 181 | + else { 182 | + for (i=0; !(arg->ui & 1 << i); i++) ; 183 | + selmon->pertag->curtag = i + 1; 184 | + } 185 | + } else { 186 | + tmptag = selmon->pertag->prevtag; 187 | + selmon->pertag->prevtag = selmon->pertag->curtag; 188 | + selmon->pertag->curtag = tmptag; 189 | + } 190 | + selmon->nmaster = selmon->pertag->nmasters[selmon->pertag->curtag]; 191 | + selmon->mfact = selmon->pertag->mfacts[selmon->pertag->curtag]; 192 | + selmon->sellt = selmon->pertag->sellts[selmon->pertag->curtag]; 193 | + selmon->lt[selmon->sellt] = selmon->pertag->ltidxs[selmon->pertag->curtag][selmon->sellt]; 194 | + selmon->lt[selmon->sellt^1] = selmon->pertag->ltidxs[selmon->pertag->curtag][selmon->sellt^1]; 195 | + if (selmon->showbar != selmon->pertag->showbars[selmon->pertag->curtag]) 196 | + togglebar(NULL); 197 | focus(NULL); 198 | arrange(selmon); 199 | } 200 | -------------------------------------------------------------------------------- /funtoo/st-0.7/st-0.7.config.h: -------------------------------------------------------------------------------- 1 | // vi:syntax=c 2 | 3 | /* {{{ ALTERNATIVE FONTS? 4 | static char font[] = "Droid Sans Mono Slashed:size=8:antialias=true:autohint=false"; 5 | static char font[] = "Source Code Pro:size=8:Semibold:antialias=true:autohint=false"; 6 | static char font[] = "xos4 Terminus:pixelsize=10:antialias=false"; 7 | }}} */ 8 | 9 | static char font[] = "Monaco for Powerline:size=8:bold:antialias=true:autohint=false"; 10 | static int borderpx = 6; 11 | 12 | /* 13 | * What program is execed by st depends of these precedence rules: 14 | * 1: program passed with -e 15 | * 2: utmp option 16 | * 3: SHELL environment variable 17 | * 4: value of shell in /etc/passwd 18 | * 5: value of shell in config.h 19 | */ 20 | static char shell[] = "/bin/sh"; 21 | static char *utmp = NULL; 22 | static char stty_args[] = "stty raw pass8 nl -echo -iexten -cstopb 38400"; 23 | /* scrollback.diff histsize */ 24 | #define histsize 2000 25 | 26 | /* identification sequence returned in DA and DECID */ 27 | static char vtiden[] = "\033[?6c"; 28 | 29 | /* Kerning / character bounding-box multipliers */ 30 | static float cwscale = 1.0; 31 | static float chscale = 1.0; 32 | 33 | /* 34 | * word delimiter string 35 | * 36 | * More advanced example: " `'\"()[]{}" 37 | */ 38 | static char worddelimiters[] = " "; 39 | 40 | /* selection timeouts (in milliseconds) */ 41 | static unsigned int doubleclicktimeout = 300; 42 | static unsigned int tripleclicktimeout = 600; 43 | 44 | /* alt screens */ 45 | static int allowaltscreen = 1; 46 | 47 | /* frames per second st should at maximum draw to the screen */ 48 | static unsigned int xfps = 120; 49 | static unsigned int actionfps = 30; 50 | 51 | /* 52 | * blinking timeout (set to 0 to disable blinking) for the terminal blinking 53 | * attribute. 54 | */ 55 | static unsigned int blinktimeout = 800; 56 | 57 | /* 58 | * thickness of underline and bar cursors 59 | */ 60 | static unsigned int cursorthickness = 2; 61 | 62 | /* 63 | * bell volume. It must be a value between -100 and 100. Use 0 for disabling 64 | * it 65 | */ 66 | static int bellvolume = 0; 67 | 68 | /* default TERM value */ 69 | static char termname[] = "xterm-256color"; 70 | 71 | /* 72 | * spaces per tab 73 | * 74 | * When you are changing this value, don't forget to adapt the »it« value in 75 | * the st.info and appropriately install the st.info in the environment where 76 | * you use this st version. 77 | * 78 | * it#$tabspaces, 79 | * 80 | * Secondly make sure your kernel is not expanding tabs. When running `stty 81 | * -a` »tab0« should appear. You can tell the terminal to not expand tabs by 82 | * running following command: 83 | * 84 | * stty tabs 85 | */ 86 | static unsigned int tabspaces = 4; 87 | 88 | /* {{{ Terminal colors (16 first used in escape sequence) */ 89 | /* {{{ zenburnish colortheme */ 90 | /* static const char *colorname[] = { 91 | [0] = "#121212", 92 | [1] = "#d75f5f", 93 | [2] = "#87af5f", 94 | [3] = "#ffaf5f", 95 | [4] = "#87afd7", 96 | [5] = "#8787af", 97 | [6] = "#5f8787", 98 | [7] = "#808080", 99 | 100 | [8] = "#404040", 101 | [9] = "#EA8484", 102 | [10] = "#C7F09F", 103 | [11] = "#FFCC9A", 104 | [12] ="#a5caef", 105 | [13] = "#a6a6de", 106 | [14] = "#69b2b2", 107 | [15] = "#d7d7d7", 108 | 109 | [256] = "#3f3f3f", 110 | [257] = "#cccccc", 111 | }; */ 112 | /* }}} */ 113 | 114 | /* {{ { ocean colorscheme */ 115 | static const char *colorname[] = { 116 | 117 | [0] = "#2b303b", 118 | [1] = "#bf616a", 119 | [2] = "#a3be8c", 120 | [3] = "#ebcb8b", 121 | [4] = "#8fa1b3", 122 | [5] = "#b48ead", 123 | [6] = "#96b5b4", 124 | [7] = "#c0c5ce", 125 | 126 | [8] = "#65737e", 127 | [9] = "#bf616a", 128 | [10] = "#a3be8c", 129 | [11] = "#ebcb8b", 130 | [12] = "#8fa1b3", 131 | [13] = "#b48ead", 132 | [14] = "#96b5b4", 133 | [15] = "#eff1f5", 134 | 135 | [256] = "#2b303b", 136 | [257] = "#c0c5ce", 137 | }; 138 | /* }}} */ 139 | /* 140 | * Default colors (colorname index) 141 | * foreground, background, cursor 142 | */ 143 | static unsigned int defaultfg = 257; 144 | static unsigned int defaultbg = 256; 145 | static unsigned int defaultcs = 257; 146 | static unsigned int defaultrcs = 256; 147 | 148 | static unsigned int defaultitalic = 7; 149 | static unsigned int defaultunderline = 7; 150 | 151 | /* 152 | * Default shape of cursor 153 | * 2: Block ("█") 154 | * 4: Underline ("_") 155 | * 6: Bar ("|") 156 | * 7: Snowman ("☃") 157 | */ 158 | static unsigned int cursorshape = 2; 159 | 160 | /* 161 | * Default colour and shape of the mouse cursor 162 | */ 163 | static unsigned int mouseshape = XC_xterm; 164 | static unsigned int mousefg = 257; 165 | static unsigned int mousebg = 0; 166 | 167 | /* 168 | * Colors used, when the specific fg == defaultfg. So in reverse mode this 169 | * will reverse too. Another logic would only make the simple feature too 170 | * complex. 171 | */ 172 | 173 | /* 174 | * Internal mouse shortcuts. 175 | * Beware that overloading Button1 will disable the selection. 176 | */ 177 | static MouseShortcut mshortcuts[] = { 178 | /* button mask string */ 179 | { Button4, XK_ANY_MOD, "\031" }, 180 | { Button5, XK_ANY_MOD, "\005" }, 181 | }; 182 | 183 | /* Internal keyboard shortcuts. */ 184 | #define MODKEY Mod1Mask 185 | 186 | static Shortcut shortcuts[] = { 187 | /* mask keysym function argument */ 188 | { XK_ANY_MOD, XK_Break, sendbreak, {.i = 0} }, 189 | { ControlMask, XK_Print, toggleprinter, {.i = 0} }, 190 | { ShiftMask, XK_Print, printscreen, {.i = 0} }, 191 | { XK_ANY_MOD, XK_Print, printsel, {.i = 0} }, 192 | { MODKEY|ShiftMask, XK_Prior, xzoom, {.f = +1} }, 193 | { MODKEY|ShiftMask, XK_Next, xzoom, {.f = -1} }, 194 | { MODKEY|ShiftMask, XK_Home, xzoomreset, {.f = 0} }, 195 | { ShiftMask, XK_Insert, selpaste, {.i = 0} }, 196 | { MODKEY|ShiftMask, XK_Insert, clippaste, {.i = 0} }, 197 | { MODKEY|ShiftMask, XK_C, clipcopy, {.i = 0} }, 198 | { MODKEY|ShiftMask, XK_V, clippaste, {.i = 0} }, 199 | { MODKEY, XK_Num_Lock, numlock, {.i = 0} }, 200 | /* scrollback.diff shortcuts */ 201 | { ShiftMask, XK_Page_Up, kscrollup, {.i = -1} }, 202 | { ShiftMask, XK_Page_Down, kscrolldown, {.i = -1} }, 203 | }; 204 | 205 | /* 206 | * Special keys (change & recompile st.info accordingly) 207 | * 208 | * Mask value: 209 | * * Use XK_ANY_MOD to match the key no matter modifiers state 210 | * * Use XK_NO_MOD to match the key alone (no modifiers) 211 | * appkey value: 212 | * * 0: no value 213 | * * > 0: keypad application mode enabled 214 | * * = 2: term.numlock = 1 215 | * * < 0: keypad application mode disabled 216 | * appcursor value: 217 | * * 0: no value 218 | * * > 0: cursor application mode enabled 219 | * * < 0: cursor application mode disabled 220 | * crlf value 221 | * * 0: no value 222 | * * > 0: crlf mode is enabled 223 | * * < 0: crlf mode is disabled 224 | * 225 | * Be careful with the order of the definitions because st searches in 226 | * this table sequentially, so any XK_ANY_MOD must be in the last 227 | * position for a key. 228 | */ 229 | 230 | /* 231 | * If you want keys other than the X11 function keys (0xFD00 - 0xFFFF) 232 | * to be mapped below, add them to this array. 233 | */ 234 | static KeySym mappedkeys[] = { -1 }; 235 | 236 | /* 237 | * State bits to ignore when matching key or button events. By default, 238 | * numlock (Mod2Mask) and keyboard layout (XK_SWITCH_MOD) are ignored. 239 | */ 240 | static uint ignoremod = Mod2Mask|XK_SWITCH_MOD; 241 | 242 | /* 243 | * Override mouse-select while mask is active (when MODE_MOUSE is set). 244 | * Note that if you want to use ShiftMask with selmasks, set this to an other 245 | * modifier, set to 0 to not use it. 246 | */ 247 | static uint forceselmod = ShiftMask; 248 | 249 | /* 250 | * This is the huge key array which defines all compatibility to the Linux 251 | * world. Please decide about changes wisely. 252 | */ 253 | static Key key[] = { 254 | /* keysym mask string appkey appcursor crlf */ 255 | { XK_KP_Home, ShiftMask, "\033[2J", 0, -1, 0}, 256 | { XK_KP_Home, ShiftMask, "\033[1;2H", 0, +1, 0}, 257 | { XK_KP_Home, XK_ANY_MOD, "\033[H", 0, -1, 0}, 258 | { XK_KP_Home, XK_ANY_MOD, "\033[1~", 0, +1, 0}, 259 | { XK_KP_Up, XK_ANY_MOD, "\033Ox", +1, 0, 0}, 260 | { XK_KP_Up, XK_ANY_MOD, "\033[A", 0, -1, 0}, 261 | { XK_KP_Up, XK_ANY_MOD, "\033OA", 0, +1, 0}, 262 | { XK_KP_Down, XK_ANY_MOD, "\033Or", +1, 0, 0}, 263 | { XK_KP_Down, XK_ANY_MOD, "\033[B", 0, -1, 0}, 264 | { XK_KP_Down, XK_ANY_MOD, "\033OB", 0, +1, 0}, 265 | { XK_KP_Left, XK_ANY_MOD, "\033Ot", +1, 0, 0}, 266 | { XK_KP_Left, XK_ANY_MOD, "\033[D", 0, -1, 0}, 267 | { XK_KP_Left, XK_ANY_MOD, "\033OD", 0, +1, 0}, 268 | { XK_KP_Right, XK_ANY_MOD, "\033Ov", +1, 0, 0}, 269 | { XK_KP_Right, XK_ANY_MOD, "\033[C", 0, -1, 0}, 270 | { XK_KP_Right, XK_ANY_MOD, "\033OC", 0, +1, 0}, 271 | { XK_KP_Prior, ShiftMask, "\033[5;2~", 0, 0, 0}, 272 | { XK_KP_Prior, XK_ANY_MOD, "\033[5~", 0, 0, 0}, 273 | { XK_KP_Begin, XK_ANY_MOD, "\033[E", 0, 0, 0}, 274 | { XK_KP_End, ControlMask, "\033[J", -1, 0, 0}, 275 | { XK_KP_End, ControlMask, "\033[1;5F", +1, 0, 0}, 276 | { XK_KP_End, ShiftMask, "\033[K", -1, 0, 0}, 277 | { XK_KP_End, ShiftMask, "\033[1;2F", +1, 0, 0}, 278 | { XK_KP_End, XK_ANY_MOD, "\033[4~", 0, 0, 0}, 279 | { XK_KP_Next, ShiftMask, "\033[6;2~", 0, 0, 0}, 280 | { XK_KP_Next, XK_ANY_MOD, "\033[6~", 0, 0, 0}, 281 | { XK_KP_Insert, ShiftMask, "\033[2;2~", +1, 0, 0}, 282 | { XK_KP_Insert, ShiftMask, "\033[4l", -1, 0, 0}, 283 | { XK_KP_Insert, ControlMask, "\033[L", -1, 0, 0}, 284 | { XK_KP_Insert, ControlMask, "\033[2;5~", +1, 0, 0}, 285 | { XK_KP_Insert, XK_ANY_MOD, "\033[4h", -1, 0, 0}, 286 | { XK_KP_Insert, XK_ANY_MOD, "\033[2~", +1, 0, 0}, 287 | { XK_KP_Delete, ControlMask, "\033[M", -1, 0, 0}, 288 | { XK_KP_Delete, ControlMask, "\033[3;5~", +1, 0, 0}, 289 | { XK_KP_Delete, ShiftMask, "\033[2K", -1, 0, 0}, 290 | { XK_KP_Delete, ShiftMask, "\033[3;2~", +1, 0, 0}, 291 | { XK_KP_Delete, XK_ANY_MOD, "\033[P", -1, 0, 0}, 292 | { XK_KP_Delete, XK_ANY_MOD, "\033[3~", +1, 0, 0}, 293 | { XK_KP_Multiply, XK_ANY_MOD, "\033Oj", +2, 0, 0}, 294 | { XK_KP_Add, XK_ANY_MOD, "\033Ok", +2, 0, 0}, 295 | { XK_KP_Enter, XK_ANY_MOD, "\033OM", +2, 0, 0}, 296 | { XK_KP_Enter, XK_ANY_MOD, "\r", -1, 0, -1}, 297 | { XK_KP_Enter, XK_ANY_MOD, "\r\n", -1, 0, +1}, 298 | { XK_KP_Subtract, XK_ANY_MOD, "\033Om", +2, 0, 0}, 299 | { XK_KP_Decimal, XK_ANY_MOD, "\033On", +2, 0, 0}, 300 | { XK_KP_Divide, XK_ANY_MOD, "\033Oo", +2, 0, 0}, 301 | { XK_KP_0, XK_ANY_MOD, "\033Op", +2, 0, 0}, 302 | { XK_KP_1, XK_ANY_MOD, "\033Oq", +2, 0, 0}, 303 | { XK_KP_2, XK_ANY_MOD, "\033Or", +2, 0, 0}, 304 | { XK_KP_3, XK_ANY_MOD, "\033Os", +2, 0, 0}, 305 | { XK_KP_4, XK_ANY_MOD, "\033Ot", +2, 0, 0}, 306 | { XK_KP_5, XK_ANY_MOD, "\033Ou", +2, 0, 0}, 307 | { XK_KP_6, XK_ANY_MOD, "\033Ov", +2, 0, 0}, 308 | { XK_KP_7, XK_ANY_MOD, "\033Ow", +2, 0, 0}, 309 | { XK_KP_8, XK_ANY_MOD, "\033Ox", +2, 0, 0}, 310 | { XK_KP_9, XK_ANY_MOD, "\033Oy", +2, 0, 0}, 311 | { XK_Up, ShiftMask, "\033[1;2A", 0, 0, 0}, 312 | { XK_Up, ControlMask, "\033[1;5A", 0, 0, 0}, 313 | { XK_Up, Mod1Mask, "\033[1;3A", 0, 0, 0}, 314 | { XK_Up, XK_ANY_MOD, "\033[A", 0, -1, 0}, 315 | { XK_Up, XK_ANY_MOD, "\033OA", 0, +1, 0}, 316 | { XK_Down, ShiftMask, "\033[1;2B", 0, 0, 0}, 317 | { XK_Down, ControlMask, "\033[1;5B", 0, 0, 0}, 318 | { XK_Down, Mod1Mask, "\033[1;3B", 0, 0, 0}, 319 | { XK_Down, XK_ANY_MOD, "\033[B", 0, -1, 0}, 320 | { XK_Down, XK_ANY_MOD, "\033OB", 0, +1, 0}, 321 | { XK_Left, ShiftMask, "\033[1;2D", 0, 0, 0}, 322 | { XK_Left, ControlMask, "\033[1;5D", 0, 0, 0}, 323 | { XK_Left, Mod1Mask, "\033[1;3D", 0, 0, 0}, 324 | { XK_Left, XK_ANY_MOD, "\033[D", 0, -1, 0}, 325 | { XK_Left, XK_ANY_MOD, "\033OD", 0, +1, 0}, 326 | { XK_Right, ShiftMask, "\033[1;2C", 0, 0, 0}, 327 | { XK_Right, ControlMask, "\033[1;5C", 0, 0, 0}, 328 | { XK_Right, Mod1Mask, "\033[1;3C", 0, 0, 0}, 329 | { XK_Right, XK_ANY_MOD, "\033[C", 0, -1, 0}, 330 | { XK_Right, XK_ANY_MOD, "\033OC", 0, +1, 0}, 331 | { XK_ISO_Left_Tab, ShiftMask, "\033[Z", 0, 0, 0}, 332 | { XK_Return, Mod1Mask, "\033\r", 0, 0, -1}, 333 | { XK_Return, Mod1Mask, "\033\r\n", 0, 0, +1}, 334 | { XK_Return, XK_ANY_MOD, "\r", 0, 0, -1}, 335 | { XK_Return, XK_ANY_MOD, "\r\n", 0, 0, +1}, 336 | { XK_Insert, ShiftMask, "\033[4l", -1, 0, 0}, 337 | { XK_Insert, ShiftMask, "\033[2;2~", +1, 0, 0}, 338 | { XK_Insert, ControlMask, "\033[L", -1, 0, 0}, 339 | { XK_Insert, ControlMask, "\033[2;5~", +1, 0, 0}, 340 | { XK_Insert, XK_ANY_MOD, "\033[4h", -1, 0, 0}, 341 | { XK_Insert, XK_ANY_MOD, "\033[2~", +1, 0, 0}, 342 | { XK_Delete, ControlMask, "\033[M", -1, 0, 0}, 343 | { XK_Delete, ControlMask, "\033[3;5~", +1, 0, 0}, 344 | { XK_Delete, ShiftMask, "\033[2K", -1, 0, 0}, 345 | { XK_Delete, ShiftMask, "\033[3;2~", +1, 0, 0}, 346 | { XK_Delete, XK_ANY_MOD, "\033[P", -1, 0, 0}, 347 | { XK_Delete, XK_ANY_MOD, "\033[3~", +1, 0, 0}, 348 | { XK_BackSpace, XK_NO_MOD, "\177", 0, 0, 0}, 349 | { XK_BackSpace, Mod1Mask, "\033\177", 0, 0, 0}, 350 | { XK_Home, ShiftMask, "\033[2J", 0, -1, 0}, 351 | { XK_Home, ShiftMask, "\033[1;2H", 0, +1, 0}, 352 | { XK_Home, XK_ANY_MOD, "\033[H", 0, -1, 0}, 353 | { XK_Home, XK_ANY_MOD, "\033[1~", 0, +1, 0}, 354 | { XK_End, ControlMask, "\033[J", -1, 0, 0}, 355 | { XK_End, ControlMask, "\033[1;5F", +1, 0, 0}, 356 | { XK_End, ShiftMask, "\033[K", -1, 0, 0}, 357 | { XK_End, ShiftMask, "\033[1;2F", +1, 0, 0}, 358 | { XK_End, XK_ANY_MOD, "\033[4~", 0, 0, 0}, 359 | { XK_Prior, ControlMask, "\033[5;5~", 0, 0, 0}, 360 | { XK_Prior, ShiftMask, "\033[5;2~", 0, 0, 0}, 361 | { XK_Prior, XK_ANY_MOD, "\033[5~", 0, 0, 0}, 362 | { XK_Next, ControlMask, "\033[6;5~", 0, 0, 0}, 363 | { XK_Next, ShiftMask, "\033[6;2~", 0, 0, 0}, 364 | { XK_Next, XK_ANY_MOD, "\033[6~", 0, 0, 0}, 365 | { XK_F1, XK_NO_MOD, "\033OP" , 0, 0, 0}, 366 | { XK_F1, /* F13 */ ShiftMask, "\033[1;2P", 0, 0, 0}, 367 | { XK_F1, /* F25 */ ControlMask, "\033[1;5P", 0, 0, 0}, 368 | { XK_F1, /* F37 */ Mod4Mask, "\033[1;6P", 0, 0, 0}, 369 | { XK_F1, /* F49 */ Mod1Mask, "\033[1;3P", 0, 0, 0}, 370 | { XK_F1, /* F61 */ Mod3Mask, "\033[1;4P", 0, 0, 0}, 371 | { XK_F2, XK_NO_MOD, "\033OQ" , 0, 0, 0}, 372 | { XK_F2, /* F14 */ ShiftMask, "\033[1;2Q", 0, 0, 0}, 373 | { XK_F2, /* F26 */ ControlMask, "\033[1;5Q", 0, 0, 0}, 374 | { XK_F2, /* F38 */ Mod4Mask, "\033[1;6Q", 0, 0, 0}, 375 | { XK_F2, /* F50 */ Mod1Mask, "\033[1;3Q", 0, 0, 0}, 376 | { XK_F2, /* F62 */ Mod3Mask, "\033[1;4Q", 0, 0, 0}, 377 | { XK_F3, XK_NO_MOD, "\033OR" , 0, 0, 0}, 378 | { XK_F3, /* F15 */ ShiftMask, "\033[1;2R", 0, 0, 0}, 379 | { XK_F3, /* F27 */ ControlMask, "\033[1;5R", 0, 0, 0}, 380 | { XK_F3, /* F39 */ Mod4Mask, "\033[1;6R", 0, 0, 0}, 381 | { XK_F3, /* F51 */ Mod1Mask, "\033[1;3R", 0, 0, 0}, 382 | { XK_F3, /* F63 */ Mod3Mask, "\033[1;4R", 0, 0, 0}, 383 | { XK_F4, XK_NO_MOD, "\033OS" , 0, 0, 0}, 384 | { XK_F4, /* F16 */ ShiftMask, "\033[1;2S", 0, 0, 0}, 385 | { XK_F4, /* F28 */ ControlMask, "\033[1;5S", 0, 0, 0}, 386 | { XK_F4, /* F40 */ Mod4Mask, "\033[1;6S", 0, 0, 0}, 387 | { XK_F4, /* F52 */ Mod1Mask, "\033[1;3S", 0, 0, 0}, 388 | { XK_F5, XK_NO_MOD, "\033[15~", 0, 0, 0}, 389 | { XK_F5, /* F17 */ ShiftMask, "\033[15;2~", 0, 0, 0}, 390 | { XK_F5, /* F29 */ ControlMask, "\033[15;5~", 0, 0, 0}, 391 | { XK_F5, /* F41 */ Mod4Mask, "\033[15;6~", 0, 0, 0}, 392 | { XK_F5, /* F53 */ Mod1Mask, "\033[15;3~", 0, 0, 0}, 393 | { XK_F6, XK_NO_MOD, "\033[17~", 0, 0, 0}, 394 | { XK_F6, /* F18 */ ShiftMask, "\033[17;2~", 0, 0, 0}, 395 | { XK_F6, /* F30 */ ControlMask, "\033[17;5~", 0, 0, 0}, 396 | { XK_F6, /* F42 */ Mod4Mask, "\033[17;6~", 0, 0, 0}, 397 | { XK_F6, /* F54 */ Mod1Mask, "\033[17;3~", 0, 0, 0}, 398 | { XK_F7, XK_NO_MOD, "\033[18~", 0, 0, 0}, 399 | { XK_F7, /* F19 */ ShiftMask, "\033[18;2~", 0, 0, 0}, 400 | { XK_F7, /* F31 */ ControlMask, "\033[18;5~", 0, 0, 0}, 401 | { XK_F7, /* F43 */ Mod4Mask, "\033[18;6~", 0, 0, 0}, 402 | { XK_F7, /* F55 */ Mod1Mask, "\033[18;3~", 0, 0, 0}, 403 | { XK_F8, XK_NO_MOD, "\033[19~", 0, 0, 0}, 404 | { XK_F8, /* F20 */ ShiftMask, "\033[19;2~", 0, 0, 0}, 405 | { XK_F8, /* F32 */ ControlMask, "\033[19;5~", 0, 0, 0}, 406 | { XK_F8, /* F44 */ Mod4Mask, "\033[19;6~", 0, 0, 0}, 407 | { XK_F8, /* F56 */ Mod1Mask, "\033[19;3~", 0, 0, 0}, 408 | { XK_F9, XK_NO_MOD, "\033[20~", 0, 0, 0}, 409 | { XK_F9, /* F21 */ ShiftMask, "\033[20;2~", 0, 0, 0}, 410 | { XK_F9, /* F33 */ ControlMask, "\033[20;5~", 0, 0, 0}, 411 | { XK_F9, /* F45 */ Mod4Mask, "\033[20;6~", 0, 0, 0}, 412 | { XK_F9, /* F57 */ Mod1Mask, "\033[20;3~", 0, 0, 0}, 413 | { XK_F10, XK_NO_MOD, "\033[21~", 0, 0, 0}, 414 | { XK_F10, /* F22 */ ShiftMask, "\033[21;2~", 0, 0, 0}, 415 | { XK_F10, /* F34 */ ControlMask, "\033[21;5~", 0, 0, 0}, 416 | { XK_F10, /* F46 */ Mod4Mask, "\033[21;6~", 0, 0, 0}, 417 | { XK_F10, /* F58 */ Mod1Mask, "\033[21;3~", 0, 0, 0}, 418 | { XK_F11, XK_NO_MOD, "\033[23~", 0, 0, 0}, 419 | { XK_F11, /* F23 */ ShiftMask, "\033[23;2~", 0, 0, 0}, 420 | { XK_F11, /* F35 */ ControlMask, "\033[23;5~", 0, 0, 0}, 421 | { XK_F11, /* F47 */ Mod4Mask, "\033[23;6~", 0, 0, 0}, 422 | { XK_F11, /* F59 */ Mod1Mask, "\033[23;3~", 0, 0, 0}, 423 | { XK_F12, XK_NO_MOD, "\033[24~", 0, 0, 0}, 424 | { XK_F12, /* F24 */ ShiftMask, "\033[24;2~", 0, 0, 0}, 425 | { XK_F12, /* F36 */ ControlMask, "\033[24;5~", 0, 0, 0}, 426 | { XK_F12, /* F48 */ Mod4Mask, "\033[24;6~", 0, 0, 0}, 427 | { XK_F12, /* F60 */ Mod1Mask, "\033[24;3~", 0, 0, 0}, 428 | { XK_F13, XK_NO_MOD, "\033[1;2P", 0, 0, 0}, 429 | { XK_F14, XK_NO_MOD, "\033[1;2Q", 0, 0, 0}, 430 | { XK_F15, XK_NO_MOD, "\033[1;2R", 0, 0, 0}, 431 | { XK_F16, XK_NO_MOD, "\033[1;2S", 0, 0, 0}, 432 | { XK_F17, XK_NO_MOD, "\033[15;2~", 0, 0, 0}, 433 | { XK_F18, XK_NO_MOD, "\033[17;2~", 0, 0, 0}, 434 | { XK_F19, XK_NO_MOD, "\033[18;2~", 0, 0, 0}, 435 | { XK_F20, XK_NO_MOD, "\033[19;2~", 0, 0, 0}, 436 | { XK_F21, XK_NO_MOD, "\033[20;2~", 0, 0, 0}, 437 | { XK_F22, XK_NO_MOD, "\033[21;2~", 0, 0, 0}, 438 | { XK_F23, XK_NO_MOD, "\033[23;2~", 0, 0, 0}, 439 | { XK_F24, XK_NO_MOD, "\033[24;2~", 0, 0, 0}, 440 | { XK_F25, XK_NO_MOD, "\033[1;5P", 0, 0, 0}, 441 | { XK_F26, XK_NO_MOD, "\033[1;5Q", 0, 0, 0}, 442 | { XK_F27, XK_NO_MOD, "\033[1;5R", 0, 0, 0}, 443 | { XK_F28, XK_NO_MOD, "\033[1;5S", 0, 0, 0}, 444 | { XK_F29, XK_NO_MOD, "\033[15;5~", 0, 0, 0}, 445 | { XK_F30, XK_NO_MOD, "\033[17;5~", 0, 0, 0}, 446 | { XK_F31, XK_NO_MOD, "\033[18;5~", 0, 0, 0}, 447 | { XK_F32, XK_NO_MOD, "\033[19;5~", 0, 0, 0}, 448 | { XK_F33, XK_NO_MOD, "\033[20;5~", 0, 0, 0}, 449 | { XK_F34, XK_NO_MOD, "\033[21;5~", 0, 0, 0}, 450 | { XK_F35, XK_NO_MOD, "\033[23;5~", 0, 0, 0}, 451 | }; 452 | 453 | /* 454 | * Selection types' masks. 455 | * Use the same masks as usual. 456 | * Button1Mask is always unset, to make masks match between ButtonPress. 457 | * ButtonRelease and MotionNotify. 458 | * If no match is found, regular selection is used. 459 | */ 460 | static uint selmasks[] = { 461 | [SEL_RECTANGULAR] = Mod1Mask, 462 | }; 463 | 464 | /* 465 | * Printable characters in ASCII, used to estimate the advance width 466 | * of single wide characters. 467 | */ 468 | static char ascii_printable[] = 469 | " !\"#$%&'()*+,-./0123456789:;<=>?" 470 | "@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_" 471 | "`abcdefghijklmnopqrstuvwxyz{|}~"; 472 | 473 | -------------------------------------------------------------------------------- /funtoo/st-0.7/st-scrollback-0.7.diff: -------------------------------------------------------------------------------- 1 | diff --git a/config.def.h b/config.def.h 2 | index b41747f..eae969e 100644 3 | --- a/config.def.h 4 | +++ b/config.def.h 5 | @@ -7,6 +7,7 @@ 6 | */ 7 | static char font[] = "Liberation Mono:pixelsize=12:antialias=true:autohint=true"; 8 | static int borderpx = 2; 9 | +#define histsize 2000 10 | 11 | /* 12 | * What program is execed by st depends of these precedence rules: 13 | @@ -172,6 +173,8 @@ static Shortcut shortcuts[] = { 14 | { MODKEY|ShiftMask, XK_C, clipcopy, {.i = 0} }, 15 | { MODKEY|ShiftMask, XK_V, clippaste, {.i = 0} }, 16 | { MODKEY, XK_Num_Lock, numlock, {.i = 0} }, 17 | + { ShiftMask, XK_Page_Up, kscrollup, {.i = -1} }, 18 | + { ShiftMask, XK_Page_Down, kscrolldown, {.i = -1} }, 19 | }; 20 | 21 | /* 22 | diff --git a/st.c b/st.c 23 | index 2594c65..233d301 100644 24 | --- a/st.c 25 | +++ b/st.c 26 | @@ -86,6 +86,8 @@ char *argv0; 27 | #define TRUERED(x) (((x) & 0xff0000) >> 8) 28 | #define TRUEGREEN(x) (((x) & 0xff00)) 29 | #define TRUEBLUE(x) (((x) & 0xff) << 8) 30 | +#define TLINE(y) ((y) < term.scr ? term.hist[((y) + term.histi - term.scr \ 31 | + + histsize + 1) % histsize] : term.line[(y) - term.scr]) 32 | 33 | 34 | enum glyph_attribute { 35 | @@ -228,26 +230,6 @@ typedef struct { 36 | int narg; /* nb of args */ 37 | } STREscape; 38 | 39 | -/* Internal representation of the screen */ 40 | -typedef struct { 41 | - int row; /* nb row */ 42 | - int col; /* nb col */ 43 | - Line *line; /* screen */ 44 | - Line *alt; /* alternate screen */ 45 | - int *dirty; /* dirtyness of lines */ 46 | - XftGlyphFontSpec *specbuf; /* font spec buffer used for rendering */ 47 | - TCursor c; /* cursor */ 48 | - int top; /* top scroll limit */ 49 | - int bot; /* bottom scroll limit */ 50 | - int mode; /* terminal mode flags */ 51 | - int esc; /* escape state flags */ 52 | - char trantbl[4]; /* charset table translation */ 53 | - int charset; /* current charset */ 54 | - int icharset; /* selected charset for sequence */ 55 | - int numlock; /* lock numbers in keyboard */ 56 | - int *tabs; 57 | -} Term; 58 | - 59 | /* Purely graphic info */ 60 | typedef struct { 61 | Display *dpy; 62 | @@ -327,6 +309,8 @@ typedef struct { 63 | /* function definitions used in config.h */ 64 | static void clipcopy(const Arg *); 65 | static void clippaste(const Arg *); 66 | +static void kscrolldown(const Arg *); 67 | +static void kscrollup(const Arg *); 68 | static void numlock(const Arg *); 69 | static void selpaste(const Arg *); 70 | static void xzoom(const Arg *); 71 | @@ -340,6 +324,29 @@ static void sendbreak(const Arg *); 72 | /* Config.h for applying patches and the configuration. */ 73 | #include "config.h" 74 | 75 | +/* Internal representation of the screen */ 76 | +typedef struct { 77 | + int row; /* nb row */ 78 | + int col; /* nb col */ 79 | + Line *line; /* screen */ 80 | + Line *alt; /* alternate screen */ 81 | + Line hist[histsize]; /* history buffer */ 82 | + int histi; /* history index */ 83 | + int scr; /* scroll back */ 84 | + int *dirty; /* dirtyness of lines */ 85 | + XftGlyphFontSpec *specbuf; /* font spec buffer used for rendering */ 86 | + TCursor c; /* cursor */ 87 | + int top; /* top scroll limit */ 88 | + int bot; /* bottom scroll limit */ 89 | + int mode; /* terminal mode flags */ 90 | + int esc; /* escape state flags */ 91 | + char trantbl[4]; /* charset table translation */ 92 | + int charset; /* current charset */ 93 | + int icharset; /* selected charset for sequence */ 94 | + int numlock; /* lock numbers in keyboard */ 95 | + int *tabs; 96 | +} Term; 97 | + 98 | /* Font structure */ 99 | typedef struct { 100 | int height; 101 | @@ -399,8 +406,8 @@ static void tputtab(int); 102 | static void tputc(Rune); 103 | static void treset(void); 104 | static void tresize(int, int); 105 | -static void tscrollup(int, int); 106 | -static void tscrolldown(int, int); 107 | +static void tscrollup(int, int, int); 108 | +static void tscrolldown(int, int, int); 109 | static void tsetattr(int *, int); 110 | static void tsetchar(Rune, Glyph *, int, int); 111 | static void tsetscroll(int, int); 112 | @@ -731,10 +738,10 @@ tlinelen(int y) 113 | { 114 | int i = term.col; 115 | 116 | - if (term.line[y][i - 1].mode & ATTR_WRAP) 117 | + if (TLINE(y)[i - 1].mode & ATTR_WRAP) 118 | return i; 119 | 120 | - while (i > 0 && term.line[y][i - 1].u == ' ') 121 | + while (i > 0 && TLINE(y)[i - 1].u == ' ') 122 | --i; 123 | 124 | return i; 125 | @@ -796,7 +803,7 @@ selsnap(int *x, int *y, int direction) 126 | * Snap around if the word wraps around at the end or 127 | * beginning of a line. 128 | */ 129 | - prevgp = &term.line[*y][*x]; 130 | + prevgp = &TLINE(*y)[*x]; 131 | prevdelim = ISDELIM(prevgp->u); 132 | for (;;) { 133 | newx = *x + direction; 134 | @@ -811,14 +818,14 @@ selsnap(int *x, int *y, int direction) 135 | yt = *y, xt = *x; 136 | else 137 | yt = newy, xt = newx; 138 | - if (!(term.line[yt][xt].mode & ATTR_WRAP)) 139 | + if (!(TLINE(yt)[xt].mode & ATTR_WRAP)) 140 | break; 141 | } 142 | 143 | if (newx >= tlinelen(newy)) 144 | break; 145 | 146 | - gp = &term.line[newy][newx]; 147 | + gp = &TLINE(newy)[newx]; 148 | delim = ISDELIM(gp->u); 149 | if (!(gp->mode & ATTR_WDUMMY) && (delim != prevdelim 150 | || (delim && gp->u != prevgp->u))) 151 | @@ -839,14 +846,14 @@ selsnap(int *x, int *y, int direction) 152 | *x = (direction < 0) ? 0 : term.col - 1; 153 | if (direction < 0) { 154 | for (; *y > 0; *y += direction) { 155 | - if (!(term.line[*y-1][term.col-1].mode 156 | + if (!(TLINE(*y-1)[term.col-1].mode 157 | & ATTR_WRAP)) { 158 | break; 159 | } 160 | } 161 | } else if (direction > 0) { 162 | for (; *y < term.row-1; *y += direction) { 163 | - if (!(term.line[*y][term.col-1].mode 164 | + if (!(TLINE(*y)[term.col-1].mode 165 | & ATTR_WRAP)) { 166 | break; 167 | } 168 | @@ -1012,13 +1019,13 @@ getsel(void) 169 | } 170 | 171 | if (sel.type == SEL_RECTANGULAR) { 172 | - gp = &term.line[y][sel.nb.x]; 173 | + gp = &TLINE(y)[sel.nb.x]; 174 | lastx = sel.ne.x; 175 | } else { 176 | - gp = &term.line[y][sel.nb.y == y ? sel.nb.x : 0]; 177 | + gp = &TLINE(y)[sel.nb.y == y ? sel.nb.x : 0]; 178 | lastx = (sel.ne.y == y) ? sel.ne.x : term.col-1; 179 | } 180 | - last = &term.line[y][MIN(lastx, linelen-1)]; 181 | + last = &TLINE(y)[MIN(lastx, linelen-1)]; 182 | while (last >= gp && last->u == ' ') 183 | --last; 184 | 185 | @@ -1490,6 +1497,9 @@ ttyread(void) 186 | /* keep any uncomplete utf8 char for the next call */ 187 | memmove(buf, ptr, buflen); 188 | 189 | + if (term.scr > 0 && term.scr < histsize-1) 190 | + term.scr++; 191 | + 192 | return ret; 193 | } 194 | 195 | @@ -1499,6 +1509,9 @@ ttywrite(const char *s, size_t n) 196 | fd_set wfd, rfd; 197 | ssize_t r; 198 | size_t lim = 256; 199 | + Arg arg = (Arg){ .i = term.scr }; 200 | + 201 | + kscrolldown(&arg); 202 | 203 | /* 204 | * Remember that we are using a pty, which might be a modem line. 205 | @@ -1690,13 +1703,53 @@ tswapscreen(void) 206 | } 207 | 208 | void 209 | -tscrolldown(int orig, int n) 210 | +kscrolldown(const Arg* a) 211 | +{ 212 | + int n = a->i; 213 | + 214 | + if (n < 0) 215 | + n = term.row + n; 216 | + 217 | + if (n > term.scr) 218 | + n = term.scr; 219 | + 220 | + if (term.scr > 0) { 221 | + term.scr -= n; 222 | + selscroll(0, -n); 223 | + tfulldirt(); 224 | + } 225 | +} 226 | + 227 | +void 228 | +kscrollup(const Arg* a) 229 | +{ 230 | + int n = a->i; 231 | + 232 | + if (n < 0) 233 | + n = term.row + n; 234 | + 235 | + if (term.scr <= histsize - n) { 236 | + term.scr += n; 237 | + selscroll(0, n); 238 | + tfulldirt(); 239 | + } 240 | +} 241 | + 242 | +void 243 | +tscrolldown(int orig, int n, int copyhist) 244 | { 245 | int i; 246 | Line temp; 247 | 248 | LIMIT(n, 0, term.bot-orig+1); 249 | 250 | + if (copyhist) { 251 | + term.histi = (term.histi - 1 + histsize) % histsize; 252 | + temp = term.hist[term.histi]; 253 | + term.hist[term.histi] = term.line[term.bot]; 254 | + term.line[term.bot] = temp; 255 | + } 256 | + 257 | tsetdirt(orig, term.bot-n); 258 | tclearregion(0, term.bot-n+1, term.col-1, term.bot); 259 | 260 | @@ -1710,13 +1763,20 @@ tscrolldown(int orig, int n) 261 | } 262 | 263 | void 264 | -tscrollup(int orig, int n) 265 | +tscrollup(int orig, int n, int copyhist) 266 | { 267 | int i; 268 | Line temp; 269 | 270 | LIMIT(n, 0, term.bot-orig+1); 271 | 272 | + if (copyhist) { 273 | + term.histi = (term.histi + 1) % histsize; 274 | + temp = term.hist[term.histi]; 275 | + term.hist[term.histi] = term.line[orig]; 276 | + term.line[orig] = temp; 277 | + } 278 | + 279 | tclearregion(0, orig, term.col-1, orig+n-1); 280 | tsetdirt(orig+n, term.bot); 281 | 282 | @@ -1765,7 +1825,7 @@ tnewline(int first_col) 283 | int y = term.c.y; 284 | 285 | if (y == term.bot) { 286 | - tscrollup(term.top, 1); 287 | + tscrollup(term.top, 1, 1); 288 | } else { 289 | y++; 290 | } 291 | @@ -1930,14 +1990,14 @@ void 292 | tinsertblankline(int n) 293 | { 294 | if (BETWEEN(term.c.y, term.top, term.bot)) 295 | - tscrolldown(term.c.y, n); 296 | + tscrolldown(term.c.y, n, 0); 297 | } 298 | 299 | void 300 | tdeleteline(int n) 301 | { 302 | if (BETWEEN(term.c.y, term.top, term.bot)) 303 | - tscrollup(term.c.y, n); 304 | + tscrollup(term.c.y, n, 0); 305 | } 306 | 307 | int32_t 308 | @@ -2371,11 +2431,11 @@ csihandle(void) 309 | break; 310 | case 'S': /* SU -- Scroll line up */ 311 | DEFAULT(csiescseq.arg[0], 1); 312 | - tscrollup(term.top, csiescseq.arg[0]); 313 | + tscrollup(term.top, csiescseq.arg[0], 0); 314 | break; 315 | case 'T': /* SD -- Scroll line down */ 316 | DEFAULT(csiescseq.arg[0], 1); 317 | - tscrolldown(term.top, csiescseq.arg[0]); 318 | + tscrolldown(term.top, csiescseq.arg[0], 0); 319 | break; 320 | case 'L': /* IL -- Insert blank lines */ 321 | DEFAULT(csiescseq.arg[0], 1); 322 | @@ -2871,7 +2931,7 @@ eschandle(uchar ascii) 323 | return 0; 324 | case 'D': /* IND -- Linefeed */ 325 | if (term.c.y == term.bot) { 326 | - tscrollup(term.top, 1); 327 | + tscrollup(term.top, 1, 1); 328 | } else { 329 | tmoveto(term.c.x, term.c.y+1); 330 | } 331 | @@ -2884,7 +2944,7 @@ eschandle(uchar ascii) 332 | break; 333 | case 'M': /* RI -- Reverse index */ 334 | if (term.c.y == term.top) { 335 | - tscrolldown(term.top, 1); 336 | + tscrolldown(term.top, 1, 1); 337 | } else { 338 | tmoveto(term.c.x, term.c.y-1); 339 | } 340 | @@ -3047,7 +3107,7 @@ tputc(Rune u) 341 | void 342 | tresize(int col, int row) 343 | { 344 | - int i; 345 | + int i, j; 346 | int minrow = MIN(row, term.row); 347 | int mincol = MIN(col, term.col); 348 | int *bp; 349 | @@ -3087,6 +3147,14 @@ tresize(int col, int row) 350 | term.dirty = xrealloc(term.dirty, row * sizeof(*term.dirty)); 351 | term.tabs = xrealloc(term.tabs, col * sizeof(*term.tabs)); 352 | 353 | + for (i = 0; i < histsize; i++) { 354 | + term.hist[i] = xrealloc(term.hist[i], col * sizeof(Glyph)); 355 | + for (j = mincol; j < col; j++) { 356 | + term.hist[i][j] = term.c.attr; 357 | + term.hist[i][j].u = ' '; 358 | + } 359 | + } 360 | + 361 | /* resize each row to new width, zero-pad if needed */ 362 | for (i = 0; i < minrow; i++) { 363 | term.line[i] = xrealloc(term.line[i], col * sizeof(Glyph)); 364 | @@ -3976,11 +4044,11 @@ drawregion(int x1, int y1, int x2, int y2) 365 | term.dirty[y] = 0; 366 | 367 | specs = term.specbuf; 368 | - numspecs = xmakeglyphfontspecs(specs, &term.line[y][x1], x2 - x1, x1, y); 369 | + numspecs = xmakeglyphfontspecs(specs, &TLINE(y)[x1], x2 - x1, x1, y); 370 | 371 | i = ox = 0; 372 | for (x = x1; x < x2 && i < numspecs; x++) { 373 | - new = term.line[y][x]; 374 | + new = TLINE(y)[x]; 375 | if (new.mode == ATTR_WDUMMY) 376 | continue; 377 | if (ena_sel && selected(x, y)) 378 | @@ -4000,7 +4068,8 @@ drawregion(int x1, int y1, int x2, int y2) 379 | if (i > 0) 380 | xdrawglyphfontspecs(specs, base, i, ox, y); 381 | } 382 | - xdrawcursor(); 383 | + if (term.scr == 0) 384 | + xdrawcursor(); 385 | } 386 | 387 | void 388 | -------------------------------------------------------------------------------- /funtoo/st-git/st-9999.config.h: -------------------------------------------------------------------------------- 1 | /* See LICENSE file for copyright and license details. */ 2 | 3 | /* 4 | * appearance 5 | * 6 | * font: see http://freedesktop.org/software/fontconfig/fontconfig-user.html 7 | */ 8 | /*char font[] = "ProFont for Powerline:size=10:antialias=false:hinting=true";*/ 9 | char font[] = "GohuFont:size=9:antialias=false:hinting=true"; 10 | /* disable bold, italic and roman fonts globally */ 11 | int disablebold = 1; 12 | int disableitalic = 1; 13 | int disableroman = 0; 14 | 15 | int borderpx = 6; 16 | 17 | /* 18 | * What program is execed by st depends of these precedence rules: 19 | * 1: program passed with -e 20 | * 2: utmp option 21 | * 3: SHELL environment variable 22 | * 4: value of shell in /etc/passwd 23 | * 5: value of shell in config.h 24 | */ 25 | static char shell[] = "/bin/sh"; 26 | static char *utmp = NULL; 27 | static char stty_args[] = "stty raw pass8 nl -echo -iexten -cstopb 38400"; 28 | 29 | /* identification sequence returned in DA and DECID */ 30 | static char vtiden[] = "\033[?6c"; 31 | 32 | /* Kerning / character bounding-box multipliers */ 33 | float cwscale = 1.0; 34 | float chscale = 1.0; 35 | 36 | /* 37 | * word delimiter string 38 | * 39 | * More advanced example: " `'\"()[]{}" 40 | */ 41 | static char worddelimiters[] = " "; 42 | 43 | /* selection timeouts (in milliseconds) */ 44 | unsigned int doubleclicktimeout = 300; 45 | unsigned int tripleclicktimeout = 600; 46 | 47 | /* alt screens */ 48 | int allowaltscreen = 1; 49 | 50 | /* frames per second st should at maximum draw to the screen */ 51 | unsigned int xfps = 120; 52 | unsigned int actionfps = 30; 53 | 54 | /* 55 | * blinking timeout (set to 0 to disable blinking) for the terminal blinking 56 | * attribute. 57 | */ 58 | unsigned int blinktimeout = 800; 59 | 60 | /* 61 | * thickness of underline and bar cursors 62 | */ 63 | unsigned int cursorthickness = 2; 64 | 65 | /* 66 | * bell volume. It must be a value between -100 and 100. Use 0 for disabling 67 | * it 68 | */ 69 | static int bellvolume = 0; 70 | 71 | /* default TERM value */ 72 | char termname[] = "xterm-256color"; 73 | 74 | /* 75 | * spaces per tab 76 | * 77 | * When you are changing this value, don't forget to adapt the »it« value in 78 | * the st.info and appropriately install the st.info in the environment where 79 | * you use this st version. 80 | * 81 | * it#$tabspaces, 82 | * 83 | * Secondly make sure your kernel is not expanding tabs. When running `stty 84 | * -a` »tab0« should appear. You can tell the terminal to not expand tabs by 85 | * running following command: 86 | * 87 | * stty tabs 88 | */ 89 | static unsigned int tabspaces = 8; 90 | 91 | const char *colorname[] = { 92 | 93 | [0] = "#2b303b", 94 | [1] = "#bf616a", 95 | [2] = "#a3be8c", 96 | [3] = "#ebcb8b", 97 | [4] = "#8fa1b3", 98 | [5] = "#b48ead", 99 | [6] = "#96b5b4", 100 | [7] = "#c0c5ce", 101 | 102 | [8] = "#65737e", 103 | [9] = "#bf616a", 104 | [10] = "#a3be8c", 105 | [11] = "#ebcb8b", 106 | [12] = "#8fa1b3", 107 | [13] = "#b48ead", 108 | [14] = "#96b5b4", 109 | [15] = "#eff1f5", 110 | 111 | [256] = "#2b303b", 112 | [257] = "#c0c5ce", 113 | }; 114 | /* }}} */ 115 | /* 116 | * Default colors (colorname index) 117 | * foreground, background, cursor 118 | */ 119 | unsigned int defaultfg = 257; 120 | unsigned int defaultbg = 256; 121 | unsigned int defaultcs = 257; 122 | unsigned int defaultrcs = 256; 123 | 124 | unsigned int defaultitalic = 7; 125 | unsigned int defaultunderline = 7; 126 | 127 | /* 128 | * Default shape of cursor 129 | * 2: Block ("█") 130 | * 4: Underline ("_") 131 | * 6: Bar ("|") 132 | * 7: Snowman ("☃") 133 | */ 134 | unsigned int cursorshape = 2; 135 | 136 | /* 137 | * Default colour and shape of the mouse cursor 138 | */ 139 | unsigned int mouseshape = XC_xterm; 140 | unsigned int mousefg = 257; 141 | unsigned int mousebg = 0; 142 | 143 | 144 | /* 145 | * Default columns and rows numbers 146 | */ 147 | 148 | unsigned int cols = 80; 149 | unsigned int rows = 24; 150 | 151 | 152 | /* 153 | * Color used to display font attributes when fontconfig selected a font which 154 | * doesn't match the ones requested. 155 | */ 156 | unsigned int defaultattr = 11; 157 | 158 | /* 159 | * Internal mouse shortcuts. 160 | * Beware that overloading Button1 will disable the selection. 161 | */ 162 | MouseShortcut mshortcuts[] = { 163 | /* button mask string */ 164 | { Button4, XK_NO_MOD, "\031" }, 165 | { Button5, XK_NO_MOD, "\005" }, 166 | }; 167 | 168 | MouseKey mkeys[] = { 169 | /* button mask function argument */ 170 | { Button4, ShiftMask, kscrollup, {.i = 1} }, 171 | { Button5, ShiftMask, kscrolldown, {.i = 1} }, 172 | }; 173 | 174 | /* Internal keyboard shortcuts. */ 175 | #define MODKEY Mod1Mask 176 | #define TERMMOD (ControlMask|ShiftMask) 177 | 178 | Shortcut shortcuts[] = { 179 | /* mask keysym function argument */ 180 | { XK_ANY_MOD, XK_Break, sendbreak, {.i = 0} }, 181 | { ControlMask, XK_Print, toggleprinter, {.i = 0} }, 182 | { ShiftMask, XK_Print, printscreen, {.i = 0} }, 183 | { XK_ANY_MOD, XK_Print, printsel, {.i = 0} }, 184 | { TERMMOD, XK_Prior, zoom, {.f = +1} }, 185 | { TERMMOD, XK_Next, zoom, {.f = -1} }, 186 | { TERMMOD, XK_Home, zoomreset, {.f = 0} }, 187 | { TERMMOD, XK_C, clipcopy, {.i = 0} }, 188 | { TERMMOD, XK_V, clippaste, {.i = 0} }, 189 | { TERMMOD, XK_Y, selpaste, {.i = 0} }, 190 | { TERMMOD, XK_Num_Lock, numlock, {.i = 0} }, 191 | { TERMMOD, XK_I, iso14755, {.i = 0} }, 192 | { ShiftMask, XK_Page_Up, kscrollup, {.i = -1} }, 193 | { ShiftMask, XK_Page_Down, kscrolldown, {.i = -1} }, 194 | }; 195 | 196 | /* 197 | * Special keys (change & recompile st.info accordingly) 198 | * 199 | * Mask value: 200 | * * Use XK_ANY_MOD to match the key no matter modifiers state 201 | * * Use XK_NO_MOD to match the key alone (no modifiers) 202 | * appkey value: 203 | * * 0: no value 204 | * * > 0: keypad application mode enabled 205 | * * = 2: term.numlock = 1 206 | * * < 0: keypad application mode disabled 207 | * appcursor value: 208 | * * 0: no value 209 | * * > 0: cursor application mode enabled 210 | * * < 0: cursor application mode disabled 211 | * crlf value 212 | * * 0: no value 213 | * * > 0: crlf mode is enabled 214 | * * < 0: crlf mode is disabled 215 | * 216 | * Be careful with the order of the definitions because st searches in 217 | * this table sequentially, so any XK_ANY_MOD must be in the last 218 | * position for a key. 219 | */ 220 | 221 | /* 222 | * If you want keys other than the X11 function keys (0xFD00 - 0xFFFF) 223 | * to be mapped below, add them to this array. 224 | */ 225 | static KeySym mappedkeys[] = { -1 }; 226 | 227 | /* 228 | * State bits to ignore when matching key or button events. By default, 229 | * numlock (Mod2Mask) and keyboard layout (XK_SWITCH_MOD) are ignored. 230 | */ 231 | static uint ignoremod = Mod2Mask|XK_SWITCH_MOD; 232 | 233 | /* 234 | * Override mouse-select while mask is active (when MODE_MOUSE is set). 235 | * Note that if you want to use ShiftMask with selmasks, set this to an other 236 | * modifier, set to 0 to not use it. 237 | */ 238 | uint forceselmod = ShiftMask; 239 | 240 | /* 241 | * This is the huge key array which defines all compatibility to the Linux 242 | * world. Please decide about changes wisely. 243 | */ 244 | static Key key[] = { 245 | /* keysym mask string appkey appcursor crlf */ 246 | { XK_KP_Home, ShiftMask, "\033[2J", 0, -1, 0}, 247 | { XK_KP_Home, ShiftMask, "\033[1;2H", 0, +1, 0}, 248 | { XK_KP_Home, XK_ANY_MOD, "\033[H", 0, -1, 0}, 249 | { XK_KP_Home, XK_ANY_MOD, "\033[1~", 0, +1, 0}, 250 | { XK_KP_Up, XK_ANY_MOD, "\033Ox", +1, 0, 0}, 251 | { XK_KP_Up, XK_ANY_MOD, "\033[A", 0, -1, 0}, 252 | { XK_KP_Up, XK_ANY_MOD, "\033OA", 0, +1, 0}, 253 | { XK_KP_Down, XK_ANY_MOD, "\033Or", +1, 0, 0}, 254 | { XK_KP_Down, XK_ANY_MOD, "\033[B", 0, -1, 0}, 255 | { XK_KP_Down, XK_ANY_MOD, "\033OB", 0, +1, 0}, 256 | { XK_KP_Left, XK_ANY_MOD, "\033Ot", +1, 0, 0}, 257 | { XK_KP_Left, XK_ANY_MOD, "\033[D", 0, -1, 0}, 258 | { XK_KP_Left, XK_ANY_MOD, "\033OD", 0, +1, 0}, 259 | { XK_KP_Right, XK_ANY_MOD, "\033Ov", +1, 0, 0}, 260 | { XK_KP_Right, XK_ANY_MOD, "\033[C", 0, -1, 0}, 261 | { XK_KP_Right, XK_ANY_MOD, "\033OC", 0, +1, 0}, 262 | { XK_KP_Prior, ShiftMask, "\033[5;2~", 0, 0, 0}, 263 | { XK_KP_Prior, XK_ANY_MOD, "\033[5~", 0, 0, 0}, 264 | { XK_KP_Begin, XK_ANY_MOD, "\033[E", 0, 0, 0}, 265 | { XK_KP_End, ControlMask, "\033[J", -1, 0, 0}, 266 | { XK_KP_End, ControlMask, "\033[1;5F", +1, 0, 0}, 267 | { XK_KP_End, ShiftMask, "\033[K", -1, 0, 0}, 268 | { XK_KP_End, ShiftMask, "\033[1;2F", +1, 0, 0}, 269 | { XK_KP_End, XK_ANY_MOD, "\033[4~", 0, 0, 0}, 270 | { XK_KP_Next, ShiftMask, "\033[6;2~", 0, 0, 0}, 271 | { XK_KP_Next, XK_ANY_MOD, "\033[6~", 0, 0, 0}, 272 | { XK_KP_Insert, ShiftMask, "\033[2;2~", +1, 0, 0}, 273 | { XK_KP_Insert, ShiftMask, "\033[4l", -1, 0, 0}, 274 | { XK_KP_Insert, ControlMask, "\033[L", -1, 0, 0}, 275 | { XK_KP_Insert, ControlMask, "\033[2;5~", +1, 0, 0}, 276 | { XK_KP_Insert, XK_ANY_MOD, "\033[4h", -1, 0, 0}, 277 | { XK_KP_Insert, XK_ANY_MOD, "\033[2~", +1, 0, 0}, 278 | { XK_KP_Delete, ControlMask, "\033[M", -1, 0, 0}, 279 | { XK_KP_Delete, ControlMask, "\033[3;5~", +1, 0, 0}, 280 | { XK_KP_Delete, ShiftMask, "\033[2K", -1, 0, 0}, 281 | { XK_KP_Delete, ShiftMask, "\033[3;2~", +1, 0, 0}, 282 | { XK_KP_Delete, XK_ANY_MOD, "\033[P", -1, 0, 0}, 283 | { XK_KP_Delete, XK_ANY_MOD, "\033[3~", +1, 0, 0}, 284 | { XK_KP_Multiply, XK_ANY_MOD, "\033Oj", +2, 0, 0}, 285 | { XK_KP_Add, XK_ANY_MOD, "\033Ok", +2, 0, 0}, 286 | { XK_KP_Enter, XK_ANY_MOD, "\033OM", +2, 0, 0}, 287 | { XK_KP_Enter, XK_ANY_MOD, "\r", -1, 0, -1}, 288 | { XK_KP_Enter, XK_ANY_MOD, "\r\n", -1, 0, +1}, 289 | { XK_KP_Subtract, XK_ANY_MOD, "\033Om", +2, 0, 0}, 290 | { XK_KP_Decimal, XK_ANY_MOD, "\033On", +2, 0, 0}, 291 | { XK_KP_Divide, XK_ANY_MOD, "\033Oo", +2, 0, 0}, 292 | { XK_KP_0, XK_ANY_MOD, "\033Op", +2, 0, 0}, 293 | { XK_KP_1, XK_ANY_MOD, "\033Oq", +2, 0, 0}, 294 | { XK_KP_2, XK_ANY_MOD, "\033Or", +2, 0, 0}, 295 | { XK_KP_3, XK_ANY_MOD, "\033Os", +2, 0, 0}, 296 | { XK_KP_4, XK_ANY_MOD, "\033Ot", +2, 0, 0}, 297 | { XK_KP_5, XK_ANY_MOD, "\033Ou", +2, 0, 0}, 298 | { XK_KP_6, XK_ANY_MOD, "\033Ov", +2, 0, 0}, 299 | { XK_KP_7, XK_ANY_MOD, "\033Ow", +2, 0, 0}, 300 | { XK_KP_8, XK_ANY_MOD, "\033Ox", +2, 0, 0}, 301 | { XK_KP_9, XK_ANY_MOD, "\033Oy", +2, 0, 0}, 302 | { XK_Up, ShiftMask, "\033[1;2A", 0, 0, 0}, 303 | { XK_Up, Mod1Mask, "\033[1;3A", 0, 0, 0}, 304 | { XK_Up, ShiftMask|Mod1Mask,"\033[1;4A", 0, 0, 0}, 305 | { XK_Up, ControlMask, "\033[1;5A", 0, 0, 0}, 306 | { XK_Up, ShiftMask|ControlMask,"\033[1;6A", 0, 0, 0}, 307 | { XK_Up, ControlMask|Mod1Mask,"\033[1;7A", 0, 0, 0}, 308 | { XK_Up,ShiftMask|ControlMask|Mod1Mask,"\033[1;8A", 0, 0, 0}, 309 | { XK_Up, XK_ANY_MOD, "\033[A", 0, -1, 0}, 310 | { XK_Up, XK_ANY_MOD, "\033OA", 0, +1, 0}, 311 | { XK_Down, ShiftMask, "\033[1;2B", 0, 0, 0}, 312 | { XK_Down, Mod1Mask, "\033[1;3B", 0, 0, 0}, 313 | { XK_Down, ShiftMask|Mod1Mask,"\033[1;4B", 0, 0, 0}, 314 | { XK_Down, ControlMask, "\033[1;5B", 0, 0, 0}, 315 | { XK_Down, ShiftMask|ControlMask,"\033[1;6B", 0, 0, 0}, 316 | { XK_Down, ControlMask|Mod1Mask,"\033[1;7B", 0, 0, 0}, 317 | { XK_Down,ShiftMask|ControlMask|Mod1Mask,"\033[1;8B",0, 0, 0}, 318 | { XK_Down, XK_ANY_MOD, "\033[B", 0, -1, 0}, 319 | { XK_Down, XK_ANY_MOD, "\033OB", 0, +1, 0}, 320 | { XK_Left, ShiftMask, "\033[1;2D", 0, 0, 0}, 321 | { XK_Left, Mod1Mask, "\033[1;3D", 0, 0, 0}, 322 | { XK_Left, ShiftMask|Mod1Mask,"\033[1;4D", 0, 0, 0}, 323 | { XK_Left, ControlMask, "\033[1;5D", 0, 0, 0}, 324 | { XK_Left, ShiftMask|ControlMask,"\033[1;6D", 0, 0, 0}, 325 | { XK_Left, ControlMask|Mod1Mask,"\033[1;7D", 0, 0, 0}, 326 | { XK_Left,ShiftMask|ControlMask|Mod1Mask,"\033[1;8D",0, 0, 0}, 327 | { XK_Left, XK_ANY_MOD, "\033[D", 0, -1, 0}, 328 | { XK_Left, XK_ANY_MOD, "\033OD", 0, +1, 0}, 329 | { XK_Right, ShiftMask, "\033[1;2C", 0, 0, 0}, 330 | { XK_Right, Mod1Mask, "\033[1;3C", 0, 0, 0}, 331 | { XK_Right, ShiftMask|Mod1Mask,"\033[1;4C", 0, 0, 0}, 332 | { XK_Right, ControlMask, "\033[1;5C", 0, 0, 0}, 333 | { XK_Right, ShiftMask|ControlMask,"\033[1;6C", 0, 0, 0}, 334 | { XK_Right, ControlMask|Mod1Mask,"\033[1;7C", 0, 0, 0}, 335 | { XK_Right,ShiftMask|ControlMask|Mod1Mask,"\033[1;8C",0, 0, 0}, 336 | { XK_Right, XK_ANY_MOD, "\033[C", 0, -1, 0}, 337 | { XK_Right, XK_ANY_MOD, "\033OC", 0, +1, 0}, 338 | { XK_ISO_Left_Tab, ShiftMask, "\033[Z", 0, 0, 0}, 339 | { XK_Return, Mod1Mask, "\033\r", 0, 0, -1}, 340 | { XK_Return, Mod1Mask, "\033\r\n", 0, 0, +1}, 341 | { XK_Return, XK_ANY_MOD, "\r", 0, 0, -1}, 342 | { XK_Return, XK_ANY_MOD, "\r\n", 0, 0, +1}, 343 | { XK_Insert, ShiftMask, "\033[4l", -1, 0, 0}, 344 | { XK_Insert, ShiftMask, "\033[2;2~", +1, 0, 0}, 345 | { XK_Insert, ControlMask, "\033[L", -1, 0, 0}, 346 | { XK_Insert, ControlMask, "\033[2;5~", +1, 0, 0}, 347 | { XK_Insert, XK_ANY_MOD, "\033[4h", -1, 0, 0}, 348 | { XK_Insert, XK_ANY_MOD, "\033[2~", +1, 0, 0}, 349 | { XK_Delete, ControlMask, "\033[M", -1, 0, 0}, 350 | { XK_Delete, ControlMask, "\033[3;5~", +1, 0, 0}, 351 | { XK_Delete, ShiftMask, "\033[2K", -1, 0, 0}, 352 | { XK_Delete, ShiftMask, "\033[3;2~", +1, 0, 0}, 353 | { XK_Delete, XK_ANY_MOD, "\033[P", -1, 0, 0}, 354 | { XK_Delete, XK_ANY_MOD, "\033[3~", +1, 0, 0}, 355 | { XK_BackSpace, XK_NO_MOD, "\177", 0, 0, 0}, 356 | { XK_BackSpace, Mod1Mask, "\033\177", 0, 0, 0}, 357 | { XK_Home, ShiftMask, "\033[2J", 0, -1, 0}, 358 | { XK_Home, ShiftMask, "\033[1;2H", 0, +1, 0}, 359 | { XK_Home, XK_ANY_MOD, "\033[H", 0, -1, 0}, 360 | { XK_Home, XK_ANY_MOD, "\033[1~", 0, +1, 0}, 361 | { XK_End, ControlMask, "\033[J", -1, 0, 0}, 362 | { XK_End, ControlMask, "\033[1;5F", +1, 0, 0}, 363 | { XK_End, ShiftMask, "\033[K", -1, 0, 0}, 364 | { XK_End, ShiftMask, "\033[1;2F", +1, 0, 0}, 365 | { XK_End, XK_ANY_MOD, "\033[4~", 0, 0, 0}, 366 | { XK_Prior, ControlMask, "\033[5;5~", 0, 0, 0}, 367 | { XK_Prior, ShiftMask, "\033[5;2~", 0, 0, 0}, 368 | { XK_Prior, XK_ANY_MOD, "\033[5~", 0, 0, 0}, 369 | { XK_Next, ControlMask, "\033[6;5~", 0, 0, 0}, 370 | { XK_Next, ShiftMask, "\033[6;2~", 0, 0, 0}, 371 | { XK_Next, XK_ANY_MOD, "\033[6~", 0, 0, 0}, 372 | { XK_F1, XK_NO_MOD, "\033OP" , 0, 0, 0}, 373 | { XK_F1, /* F13 */ ShiftMask, "\033[1;2P", 0, 0, 0}, 374 | { XK_F1, /* F25 */ ControlMask, "\033[1;5P", 0, 0, 0}, 375 | { XK_F1, /* F37 */ Mod4Mask, "\033[1;6P", 0, 0, 0}, 376 | { XK_F1, /* F49 */ Mod1Mask, "\033[1;3P", 0, 0, 0}, 377 | { XK_F1, /* F61 */ Mod3Mask, "\033[1;4P", 0, 0, 0}, 378 | { XK_F2, XK_NO_MOD, "\033OQ" , 0, 0, 0}, 379 | { XK_F2, /* F14 */ ShiftMask, "\033[1;2Q", 0, 0, 0}, 380 | { XK_F2, /* F26 */ ControlMask, "\033[1;5Q", 0, 0, 0}, 381 | { XK_F2, /* F38 */ Mod4Mask, "\033[1;6Q", 0, 0, 0}, 382 | { XK_F2, /* F50 */ Mod1Mask, "\033[1;3Q", 0, 0, 0}, 383 | { XK_F2, /* F62 */ Mod3Mask, "\033[1;4Q", 0, 0, 0}, 384 | { XK_F3, XK_NO_MOD, "\033OR" , 0, 0, 0}, 385 | { XK_F3, /* F15 */ ShiftMask, "\033[1;2R", 0, 0, 0}, 386 | { XK_F3, /* F27 */ ControlMask, "\033[1;5R", 0, 0, 0}, 387 | { XK_F3, /* F39 */ Mod4Mask, "\033[1;6R", 0, 0, 0}, 388 | { XK_F3, /* F51 */ Mod1Mask, "\033[1;3R", 0, 0, 0}, 389 | { XK_F3, /* F63 */ Mod3Mask, "\033[1;4R", 0, 0, 0}, 390 | { XK_F4, XK_NO_MOD, "\033OS" , 0, 0, 0}, 391 | { XK_F4, /* F16 */ ShiftMask, "\033[1;2S", 0, 0, 0}, 392 | { XK_F4, /* F28 */ ControlMask, "\033[1;5S", 0, 0, 0}, 393 | { XK_F4, /* F40 */ Mod4Mask, "\033[1;6S", 0, 0, 0}, 394 | { XK_F4, /* F52 */ Mod1Mask, "\033[1;3S", 0, 0, 0}, 395 | { XK_F5, XK_NO_MOD, "\033[15~", 0, 0, 0}, 396 | { XK_F5, /* F17 */ ShiftMask, "\033[15;2~", 0, 0, 0}, 397 | { XK_F5, /* F29 */ ControlMask, "\033[15;5~", 0, 0, 0}, 398 | { XK_F5, /* F41 */ Mod4Mask, "\033[15;6~", 0, 0, 0}, 399 | { XK_F5, /* F53 */ Mod1Mask, "\033[15;3~", 0, 0, 0}, 400 | { XK_F6, XK_NO_MOD, "\033[17~", 0, 0, 0}, 401 | { XK_F6, /* F18 */ ShiftMask, "\033[17;2~", 0, 0, 0}, 402 | { XK_F6, /* F30 */ ControlMask, "\033[17;5~", 0, 0, 0}, 403 | { XK_F6, /* F42 */ Mod4Mask, "\033[17;6~", 0, 0, 0}, 404 | { XK_F6, /* F54 */ Mod1Mask, "\033[17;3~", 0, 0, 0}, 405 | { XK_F7, XK_NO_MOD, "\033[18~", 0, 0, 0}, 406 | { XK_F7, /* F19 */ ShiftMask, "\033[18;2~", 0, 0, 0}, 407 | { XK_F7, /* F31 */ ControlMask, "\033[18;5~", 0, 0, 0}, 408 | { XK_F7, /* F43 */ Mod4Mask, "\033[18;6~", 0, 0, 0}, 409 | { XK_F7, /* F55 */ Mod1Mask, "\033[18;3~", 0, 0, 0}, 410 | { XK_F8, XK_NO_MOD, "\033[19~", 0, 0, 0}, 411 | { XK_F8, /* F20 */ ShiftMask, "\033[19;2~", 0, 0, 0}, 412 | { XK_F8, /* F32 */ ControlMask, "\033[19;5~", 0, 0, 0}, 413 | { XK_F8, /* F44 */ Mod4Mask, "\033[19;6~", 0, 0, 0}, 414 | { XK_F8, /* F56 */ Mod1Mask, "\033[19;3~", 0, 0, 0}, 415 | { XK_F9, XK_NO_MOD, "\033[20~", 0, 0, 0}, 416 | { XK_F9, /* F21 */ ShiftMask, "\033[20;2~", 0, 0, 0}, 417 | { XK_F9, /* F33 */ ControlMask, "\033[20;5~", 0, 0, 0}, 418 | { XK_F9, /* F45 */ Mod4Mask, "\033[20;6~", 0, 0, 0}, 419 | { XK_F9, /* F57 */ Mod1Mask, "\033[20;3~", 0, 0, 0}, 420 | { XK_F10, XK_NO_MOD, "\033[21~", 0, 0, 0}, 421 | { XK_F10, /* F22 */ ShiftMask, "\033[21;2~", 0, 0, 0}, 422 | { XK_F10, /* F34 */ ControlMask, "\033[21;5~", 0, 0, 0}, 423 | { XK_F10, /* F46 */ Mod4Mask, "\033[21;6~", 0, 0, 0}, 424 | { XK_F10, /* F58 */ Mod1Mask, "\033[21;3~", 0, 0, 0}, 425 | { XK_F11, XK_NO_MOD, "\033[23~", 0, 0, 0}, 426 | { XK_F11, /* F23 */ ShiftMask, "\033[23;2~", 0, 0, 0}, 427 | { XK_F11, /* F35 */ ControlMask, "\033[23;5~", 0, 0, 0}, 428 | { XK_F11, /* F47 */ Mod4Mask, "\033[23;6~", 0, 0, 0}, 429 | { XK_F11, /* F59 */ Mod1Mask, "\033[23;3~", 0, 0, 0}, 430 | { XK_F12, XK_NO_MOD, "\033[24~", 0, 0, 0}, 431 | { XK_F12, /* F24 */ ShiftMask, "\033[24;2~", 0, 0, 0}, 432 | { XK_F12, /* F36 */ ControlMask, "\033[24;5~", 0, 0, 0}, 433 | { XK_F12, /* F48 */ Mod4Mask, "\033[24;6~", 0, 0, 0}, 434 | { XK_F12, /* F60 */ Mod1Mask, "\033[24;3~", 0, 0, 0}, 435 | { XK_F13, XK_NO_MOD, "\033[1;2P", 0, 0, 0}, 436 | { XK_F14, XK_NO_MOD, "\033[1;2Q", 0, 0, 0}, 437 | { XK_F15, XK_NO_MOD, "\033[1;2R", 0, 0, 0}, 438 | { XK_F16, XK_NO_MOD, "\033[1;2S", 0, 0, 0}, 439 | { XK_F17, XK_NO_MOD, "\033[15;2~", 0, 0, 0}, 440 | { XK_F18, XK_NO_MOD, "\033[17;2~", 0, 0, 0}, 441 | { XK_F19, XK_NO_MOD, "\033[18;2~", 0, 0, 0}, 442 | { XK_F20, XK_NO_MOD, "\033[19;2~", 0, 0, 0}, 443 | { XK_F21, XK_NO_MOD, "\033[20;2~", 0, 0, 0}, 444 | { XK_F22, XK_NO_MOD, "\033[21;2~", 0, 0, 0}, 445 | { XK_F23, XK_NO_MOD, "\033[23;2~", 0, 0, 0}, 446 | { XK_F24, XK_NO_MOD, "\033[24;2~", 0, 0, 0}, 447 | { XK_F25, XK_NO_MOD, "\033[1;5P", 0, 0, 0}, 448 | { XK_F26, XK_NO_MOD, "\033[1;5Q", 0, 0, 0}, 449 | { XK_F27, XK_NO_MOD, "\033[1;5R", 0, 0, 0}, 450 | { XK_F28, XK_NO_MOD, "\033[1;5S", 0, 0, 0}, 451 | { XK_F29, XK_NO_MOD, "\033[15;5~", 0, 0, 0}, 452 | { XK_F30, XK_NO_MOD, "\033[17;5~", 0, 0, 0}, 453 | { XK_F31, XK_NO_MOD, "\033[18;5~", 0, 0, 0}, 454 | { XK_F32, XK_NO_MOD, "\033[19;5~", 0, 0, 0}, 455 | { XK_F33, XK_NO_MOD, "\033[20;5~", 0, 0, 0}, 456 | { XK_F34, XK_NO_MOD, "\033[21;5~", 0, 0, 0}, 457 | { XK_F35, XK_NO_MOD, "\033[23;5~", 0, 0, 0}, 458 | }; 459 | 460 | /* 461 | * Selection types' masks. 462 | * Use the same masks as usual. 463 | * Button1Mask is always unset, to make masks match between ButtonPress. 464 | * ButtonRelease and MotionNotify. 465 | * If no match is found, regular selection is used. 466 | */ 467 | uint selmasks[] = { 468 | [SEL_RECTANGULAR] = Mod1Mask, 469 | }; 470 | 471 | /* 472 | * Printable characters in ASCII, used to estimate the advance width 473 | * of single wide characters. 474 | */ 475 | char ascii_printable[] = 476 | " !\"#$%&'()*+,-./0123456789:;<=>?" 477 | "@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_" 478 | "`abcdefghijklmnopqrstuvwxyz{|}~"; 479 | 480 | -------------------------------------------------------------------------------- /funtoo/st-git/st-disable-bold-italic-fonts.diff: -------------------------------------------------------------------------------- 1 | From 1e932656e6ca3a50ec67cafabdb08d711635c504 Mon Sep 17 00:00:00 2001 2 | From: Alex Kozadaev 3 | Date: Fri, 24 Mar 2017 12:11:47 +0000 4 | Subject: [PATCH] disable bold, italic and roman fonts globally 5 | 6 | --- 7 | config.def.h | 6 ++++++ 8 | x.c | 14 +++++++++++--- 9 | 2 files changed, 17 insertions(+), 3 deletions(-) 10 | 11 | diff --git a/config.def.h b/config.def.h 12 | index 877afab..87c4534 100644 13 | --- a/config.def.h 14 | +++ b/config.def.h 15 | @@ -6,6 +6,12 @@ 16 | * font: see http://freedesktop.org/software/fontconfig/fontconfig-user.html 17 | */ 18 | char font[] = "Liberation Mono:pixelsize=12:antialias=true:autohint=true"; 19 | + 20 | +/* disable bold, italic and roman fonts globally */ 21 | +int disablebold = 0; 22 | +int disableitalic = 0; 23 | +int disableroman = 0; 24 | + 25 | int borderpx = 2; 26 | 27 | /* 28 | diff --git a/x.c b/x.c 29 | index 743b084..23e4f0a 100644 30 | --- a/x.c 31 | +++ b/x.c 32 | @@ -158,6 +158,11 @@ typedef struct { 33 | static Fontcache frc[16]; 34 | static int frclen = 0; 35 | 36 | +/* declared in config.h */ 37 | +extern int disablebold; 38 | +extern int disableitalic; 39 | +extern int disableroman; 40 | + 41 | void 42 | getbuttoninfo(XEvent *e) 43 | { 44 | @@ -828,17 +833,20 @@ xloadfonts(char *fontstr, double fontsize) 45 | win.ch = ceilf(dc.font.height * chscale); 46 | 47 | FcPatternDel(pattern, FC_SLANT); 48 | - FcPatternAddInteger(pattern, FC_SLANT, FC_SLANT_ITALIC); 49 | + if (!disableitalic) 50 | + FcPatternAddInteger(pattern, FC_SLANT, FC_SLANT_ITALIC); 51 | if (xloadfont(&dc.ifont, pattern)) 52 | die("st: can't open font %s\n", fontstr); 53 | 54 | FcPatternDel(pattern, FC_WEIGHT); 55 | - FcPatternAddInteger(pattern, FC_WEIGHT, FC_WEIGHT_BOLD); 56 | + if (!disablebold) 57 | + FcPatternAddInteger(pattern, FC_WEIGHT, FC_WEIGHT_BOLD); 58 | if (xloadfont(&dc.ibfont, pattern)) 59 | die("st: can't open font %s\n", fontstr); 60 | 61 | FcPatternDel(pattern, FC_SLANT); 62 | - FcPatternAddInteger(pattern, FC_SLANT, FC_SLANT_ROMAN); 63 | + if (!disableroman) 64 | + FcPatternAddInteger(pattern, FC_SLANT, FC_SLANT_ROMAN); 65 | if (xloadfont(&dc.bfont, pattern)) 66 | die("st: can't open font %s\n", fontstr); 67 | 68 | -- 69 | 2.1.4 70 | 71 | -------------------------------------------------------------------------------- /funtoo/st-git/st-scrollback-20170329-149c0d3.diff: -------------------------------------------------------------------------------- 1 | diff --git a/config.def.h b/config.def.h 2 | index 877afab..3e9cda5 100644 3 | --- a/config.def.h 4 | +++ b/config.def.h 5 | @@ -178,6 +178,8 @@ Shortcut shortcuts[] = { 6 | { TERMMOD, XK_Y, selpaste, {.i = 0} }, 7 | { TERMMOD, XK_Num_Lock, numlock, {.i = 0} }, 8 | { TERMMOD, XK_I, iso14755, {.i = 0} }, 9 | + { ShiftMask, XK_Page_Up, kscrollup, {.i = -1} }, 10 | + { ShiftMask, XK_Page_Down, kscrolldown, {.i = -1} }, 11 | }; 12 | 13 | /* 14 | diff --git a/st.c b/st.c 15 | index ae93ade..b74b9dc 100644 16 | --- a/st.c 17 | +++ b/st.c 18 | @@ -128,6 +128,8 @@ typedef struct { 19 | /* function definitions used in config.h */ 20 | static void clipcopy(const Arg *); 21 | static void clippaste(const Arg *); 22 | +static void kscrolldown(const Arg *); 23 | +static void kscrollup(const Arg *); 24 | static void numlock(const Arg *); 25 | static void selpaste(const Arg *); 26 | static void zoom(const Arg *); 27 | @@ -174,8 +176,8 @@ static void tputtab(int); 28 | static void tputc(Rune); 29 | static void treset(void); 30 | static void tresize(int, int); 31 | -static void tscrollup(int, int); 32 | -static void tscrolldown(int, int); 33 | +static void tscrollup(int, int, int); 34 | +static void tscrolldown(int, int, int); 35 | static void tsetattr(int *, int); 36 | static void tsetchar(Rune, Glyph *, int, int); 37 | static void tsetscroll(int, int); 38 | @@ -448,10 +450,10 @@ tlinelen(int y) 39 | { 40 | int i = term.col; 41 | 42 | - if (term.line[y][i - 1].mode & ATTR_WRAP) 43 | + if (TLINE(y)[i - 1].mode & ATTR_WRAP) 44 | return i; 45 | 46 | - while (i > 0 && term.line[y][i - 1].u == ' ') 47 | + while (i > 0 && TLINE(y)[i - 1].u == ' ') 48 | --i; 49 | 50 | return i; 51 | @@ -513,7 +515,7 @@ selsnap(int *x, int *y, int direction) 52 | * Snap around if the word wraps around at the end or 53 | * beginning of a line. 54 | */ 55 | - prevgp = &term.line[*y][*x]; 56 | + prevgp = &TLINE(*y)[*x]; 57 | prevdelim = ISDELIM(prevgp->u); 58 | for (;;) { 59 | newx = *x + direction; 60 | @@ -528,14 +530,14 @@ selsnap(int *x, int *y, int direction) 61 | yt = *y, xt = *x; 62 | else 63 | yt = newy, xt = newx; 64 | - if (!(term.line[yt][xt].mode & ATTR_WRAP)) 65 | + if (!(TLINE(yt)[xt].mode & ATTR_WRAP)) 66 | break; 67 | } 68 | 69 | if (newx >= tlinelen(newy)) 70 | break; 71 | 72 | - gp = &term.line[newy][newx]; 73 | + gp = &TLINE(newy)[newx]; 74 | delim = ISDELIM(gp->u); 75 | if (!(gp->mode & ATTR_WDUMMY) && (delim != prevdelim 76 | || (delim && gp->u != prevgp->u))) 77 | @@ -556,14 +558,14 @@ selsnap(int *x, int *y, int direction) 78 | *x = (direction < 0) ? 0 : term.col - 1; 79 | if (direction < 0) { 80 | for (; *y > 0; *y += direction) { 81 | - if (!(term.line[*y-1][term.col-1].mode 82 | + if (!(TLINE(*y-1)[term.col-1].mode 83 | & ATTR_WRAP)) { 84 | break; 85 | } 86 | } 87 | } else if (direction > 0) { 88 | for (; *y < term.row-1; *y += direction) { 89 | - if (!(term.line[*y][term.col-1].mode 90 | + if (!(TLINE(*y)[term.col-1].mode 91 | & ATTR_WRAP)) { 92 | break; 93 | } 94 | @@ -594,13 +596,13 @@ getsel(void) 95 | } 96 | 97 | if (sel.type == SEL_RECTANGULAR) { 98 | - gp = &term.line[y][sel.nb.x]; 99 | + gp = &TLINE(y)[sel.nb.x]; 100 | lastx = sel.ne.x; 101 | } else { 102 | - gp = &term.line[y][sel.nb.y == y ? sel.nb.x : 0]; 103 | + gp = &TLINE(y)[sel.nb.y == y ? sel.nb.x : 0]; 104 | lastx = (sel.ne.y == y) ? sel.ne.x : term.col-1; 105 | } 106 | - last = &term.line[y][MIN(lastx, linelen-1)]; 107 | + last = &TLINE(y)[MIN(lastx, linelen-1)]; 108 | while (last >= gp && last->u == ' ') 109 | --last; 110 | 111 | @@ -844,6 +846,9 @@ ttyread(void) 112 | if (buflen > 0) 113 | memmove(buf, ptr, buflen); 114 | 115 | + if (term.scr > 0 && term.scr < HISTSIZE-1) 116 | + term.scr++; 117 | + 118 | return ret; 119 | } 120 | 121 | @@ -853,6 +858,9 @@ ttywrite(const char *s, size_t n) 122 | fd_set wfd, rfd; 123 | ssize_t r; 124 | size_t lim = 256; 125 | + Arg arg = (Arg) { .i = term.scr }; 126 | + 127 | + kscrolldown(&arg); 128 | 129 | /* 130 | * Remember that we are using a pty, which might be a modem line. 131 | @@ -1055,13 +1063,53 @@ tswapscreen(void) 132 | } 133 | 134 | void 135 | -tscrolldown(int orig, int n) 136 | +kscrolldown(const Arg* a) 137 | +{ 138 | + int n = a->i; 139 | + 140 | + if (n < 0) 141 | + n = term.row + n; 142 | + 143 | + if (n > term.scr) 144 | + n = term.scr; 145 | + 146 | + if (term.scr > 0) { 147 | + term.scr -= n; 148 | + selscroll(0, -n); 149 | + tfulldirt(); 150 | + } 151 | +} 152 | + 153 | +void 154 | +kscrollup(const Arg* a) 155 | +{ 156 | + int n = a->i; 157 | + 158 | + if (n < 0) 159 | + n = term.row + n; 160 | + 161 | + if (term.scr <= HISTSIZE-n) { 162 | + term.scr += n; 163 | + selscroll(0, n); 164 | + tfulldirt(); 165 | + } 166 | +} 167 | + 168 | +void 169 | +tscrolldown(int orig, int n, int copyhist) 170 | { 171 | int i; 172 | Line temp; 173 | 174 | LIMIT(n, 0, term.bot-orig+1); 175 | 176 | + if (copyhist) { 177 | + term.histi = (term.histi - 1 + HISTSIZE) % HISTSIZE; 178 | + temp = term.hist[term.histi]; 179 | + term.hist[term.histi] = term.line[term.bot]; 180 | + term.line[term.bot] = temp; 181 | + } 182 | + 183 | tsetdirt(orig, term.bot-n); 184 | tclearregion(0, term.bot-n+1, term.col-1, term.bot); 185 | 186 | @@ -1075,13 +1123,20 @@ tscrolldown(int orig, int n) 187 | } 188 | 189 | void 190 | -tscrollup(int orig, int n) 191 | +tscrollup(int orig, int n, int copyhist) 192 | { 193 | int i; 194 | Line temp; 195 | 196 | LIMIT(n, 0, term.bot-orig+1); 197 | 198 | + if (copyhist) { 199 | + term.histi = (term.histi + 1) % HISTSIZE; 200 | + temp = term.hist[term.histi]; 201 | + term.hist[term.histi] = term.line[orig]; 202 | + term.line[orig] = temp; 203 | + } 204 | + 205 | tclearregion(0, orig, term.col-1, orig+n-1); 206 | tsetdirt(orig+n, term.bot); 207 | 208 | @@ -1130,7 +1185,7 @@ tnewline(int first_col) 209 | int y = term.c.y; 210 | 211 | if (y == term.bot) { 212 | - tscrollup(term.top, 1); 213 | + tscrollup(term.top, 1, 1); 214 | } else { 215 | y++; 216 | } 217 | @@ -1295,14 +1350,14 @@ void 218 | tinsertblankline(int n) 219 | { 220 | if (BETWEEN(term.c.y, term.top, term.bot)) 221 | - tscrolldown(term.c.y, n); 222 | + tscrolldown(term.c.y, n, 0); 223 | } 224 | 225 | void 226 | tdeleteline(int n) 227 | { 228 | if (BETWEEN(term.c.y, term.top, term.bot)) 229 | - tscrollup(term.c.y, n); 230 | + tscrollup(term.c.y, n, 0); 231 | } 232 | 233 | int32_t 234 | @@ -1736,11 +1791,11 @@ csihandle(void) 235 | break; 236 | case 'S': /* SU -- Scroll line up */ 237 | DEFAULT(csiescseq.arg[0], 1); 238 | - tscrollup(term.top, csiescseq.arg[0]); 239 | + tscrollup(term.top, csiescseq.arg[0], 0); 240 | break; 241 | case 'T': /* SD -- Scroll line down */ 242 | DEFAULT(csiescseq.arg[0], 1); 243 | - tscrolldown(term.top, csiescseq.arg[0]); 244 | + tscrolldown(term.top, csiescseq.arg[0], 0); 245 | break; 246 | case 'L': /* IL -- Insert blank lines */ 247 | DEFAULT(csiescseq.arg[0], 1); 248 | @@ -2290,7 +2345,7 @@ eschandle(uchar ascii) 249 | return 0; 250 | case 'D': /* IND -- Linefeed */ 251 | if (term.c.y == term.bot) { 252 | - tscrollup(term.top, 1); 253 | + tscrollup(term.top, 1, 1); 254 | } else { 255 | tmoveto(term.c.x, term.c.y+1); 256 | } 257 | @@ -2303,7 +2358,7 @@ eschandle(uchar ascii) 258 | break; 259 | case 'M': /* RI -- Reverse index */ 260 | if (term.c.y == term.top) { 261 | - tscrolldown(term.top, 1); 262 | + tscrolldown(term.top, 1, 1); 263 | } else { 264 | tmoveto(term.c.x, term.c.y-1); 265 | } 266 | @@ -2490,7 +2545,7 @@ check_control_code: 267 | void 268 | tresize(int col, int row) 269 | { 270 | - int i; 271 | + int i, j; 272 | int minrow = MIN(row, term.row); 273 | int mincol = MIN(col, term.col); 274 | int *bp; 275 | @@ -2530,6 +2585,14 @@ tresize(int col, int row) 276 | term.dirty = xrealloc(term.dirty, row * sizeof(*term.dirty)); 277 | term.tabs = xrealloc(term.tabs, col * sizeof(*term.tabs)); 278 | 279 | + for (i = 0; i < HISTSIZE; i++) { 280 | + term.hist[i] = xrealloc(term.hist[i], col * sizeof(Glyph)); 281 | + for (j = mincol; j < col; j++) { 282 | + term.hist[i][j] = term.c.attr; 283 | + term.hist[i][j].u = ' '; 284 | + } 285 | + } 286 | + 287 | /* resize each row to new width, zero-pad if needed */ 288 | for (i = 0; i < minrow; i++) { 289 | term.line[i] = xrealloc(term.line[i], col * sizeof(Glyph)); 290 | diff --git a/st.h b/st.h 291 | index 44d4938..2d9b028 100644 292 | --- a/st.h 293 | +++ b/st.h 294 | @@ -2,6 +2,7 @@ 295 | 296 | /* Arbitrary sizes */ 297 | #define UTF_SIZ 4 298 | +#define HISTSIZE 2000 299 | 300 | /* macros */ 301 | #define MIN(a, b) ((a) < (b) ? (a) : (b)) 302 | @@ -20,6 +21,9 @@ 303 | #define TRUECOLOR(r,g,b) (1 << 24 | (r) << 16 | (g) << 8 | (b)) 304 | #define IS_TRUECOL(x) (1 << 24 & (x)) 305 | 306 | +#define TLINE(y) ((y) < term.scr ? term.hist[((y) + term.histi - term.scr \ 307 | + + HISTSIZE + 1) % HISTSIZE] : term.line[(y) - term.scr]) 308 | + 309 | enum glyph_attribute { 310 | ATTR_NULL = 0, 311 | ATTR_BOLD = 1 << 0, 312 | @@ -114,6 +118,9 @@ typedef struct { 313 | int col; /* nb col */ 314 | Line *line; /* screen */ 315 | Line *alt; /* alternate screen */ 316 | + Line hist[HISTSIZE]; /* history buffer */ 317 | + int histi; /* history index */ 318 | + int scr; /* scroll back */ 319 | int *dirty; /* dirtyness of lines */ 320 | GlyphFontSpec *specbuf; /* font spec buffer used for rendering */ 321 | TCursor c; /* cursor */ 322 | diff --git a/x.c b/x.c 323 | index b7339e9..2ae8b17 100644 324 | --- a/x.c 325 | +++ b/x.c 326 | @@ -1413,11 +1413,11 @@ drawregion(int x1, int y1, int x2, int y2) 327 | term.dirty[y] = 0; 328 | 329 | specs = term.specbuf; 330 | - numspecs = xmakeglyphfontspecs(specs, &term.line[y][x1], x2 - x1, x1, y); 331 | + numspecs = xmakeglyphfontspecs(specs, &TLINE(y)[x1], x2 - x1, x1, y); 332 | 333 | i = ox = 0; 334 | for (x = x1; x < x2 && i < numspecs; x++) { 335 | - new = term.line[y][x]; 336 | + new = TLINE(y)[x]; 337 | if (new.mode == ATTR_WDUMMY) 338 | continue; 339 | if (ena_sel && selected(x, y)) 340 | @@ -1437,7 +1437,9 @@ drawregion(int x1, int y1, int x2, int y2) 341 | if (i > 0) 342 | xdrawglyphfontspecs(specs, base, i, ox, y); 343 | } 344 | - xdrawcursor(); 345 | + 346 | + if (term.scr == 0) 347 | + xdrawcursor(); 348 | } 349 | 350 | void 351 | -------------------------------------------------------------------------------- /funtoo/st-git/st-scrollback-mouse-20170427-5a10aca.diff: -------------------------------------------------------------------------------- 1 | diff --git a/config.def.h b/config.def.h 2 | index 3e9cda5..a9c65a9 100644 3 | --- a/config.def.h 4 | +++ b/config.def.h 5 | @@ -156,8 +156,14 @@ unsigned int defaultattr = 11; 6 | */ 7 | MouseShortcut mshortcuts[] = { 8 | /* button mask string */ 9 | - { Button4, XK_ANY_MOD, "\031" }, 10 | - { Button5, XK_ANY_MOD, "\005" }, 11 | + { Button4, XK_NO_MOD, "\031" }, 12 | + { Button5, XK_NO_MOD, "\005" }, 13 | +}; 14 | + 15 | +MouseKey mkeys[] = { 16 | + /* button mask function argument */ 17 | + { Button4, ShiftMask, kscrollup, {.i = 1} }, 18 | + { Button5, ShiftMask, kscrolldown, {.i = 1} }, 19 | }; 20 | 21 | /* Internal keyboard shortcuts. */ 22 | diff --git a/st.c b/st.c 23 | index b74b9dc..d33eb5b 100644 24 | --- a/st.c 25 | +++ b/st.c 26 | @@ -237,6 +237,7 @@ static Rune utfmax[UTF_SIZ + 1] = {0x10FFFF, 0x7F, 0x7FF, 0xFFFF, 0x10FFFF}; 27 | /* config.h array lengths */ 28 | size_t colornamelen = LEN(colorname); 29 | size_t mshortcutslen = LEN(mshortcuts); 30 | +size_t mkeyslen = LEN(mkeys); 31 | size_t shortcutslen = LEN(shortcuts); 32 | size_t selmaskslen = LEN(selmasks); 33 | 34 | diff --git a/st.h b/st.h 35 | index 2d9b028..ca90c31 100644 36 | --- a/st.h 37 | +++ b/st.h 38 | @@ -182,6 +182,13 @@ typedef union { 39 | } Arg; 40 | 41 | typedef struct { 42 | + uint b; 43 | + uint mask; 44 | + void (*func)(const Arg *); 45 | + const Arg arg; 46 | +} MouseKey; 47 | + 48 | +typedef struct { 49 | uint mod; 50 | KeySym keysym; 51 | void (*func)(const Arg *); 52 | @@ -271,6 +278,8 @@ extern unsigned int mousebg; 53 | extern unsigned int defaultattr; 54 | extern MouseShortcut mshortcuts[]; 55 | extern size_t mshortcutslen; 56 | +extern MouseKey mkeys[]; 57 | +extern size_t mkeyslen; 58 | extern Shortcut shortcuts[]; 59 | extern size_t shortcutslen; 60 | extern uint forceselmod; 61 | diff --git a/x.c b/x.c 62 | index 495cd90..67dcfdc 100644 63 | --- a/x.c 64 | +++ b/x.c 65 | @@ -248,6 +248,7 @@ bpress(XEvent *e) 66 | { 67 | struct timespec now; 68 | MouseShortcut *ms; 69 | + MouseKey *mk; 70 | 71 | if (IS_SET(MODE_MOUSE) && !(e->xbutton.state & forceselmod)) { 72 | mousereport(e); 73 | @@ -262,6 +263,14 @@ bpress(XEvent *e) 74 | } 75 | } 76 | 77 | + for (mk = mkeys; mk < mkeys + mkeyslen; mk++) { 78 | + if (e->xbutton.button == mk->b 79 | + && match(mk->mask, e->xbutton.state)) { 80 | + mk->func(&mk->arg); 81 | + return; 82 | + } 83 | + } 84 | + 85 | if (e->xbutton.button == Button1) { 86 | clock_gettime(CLOCK_MONOTONIC, &now); 87 | 88 | -------------------------------------------------------------------------------- /openbsd/etc/doas.conf: -------------------------------------------------------------------------------- 1 | permit persist keepenv :wheel 2 | permit nopass keepenv root as root 3 | -------------------------------------------------------------------------------- /openbsd/etc/installurl: -------------------------------------------------------------------------------- 1 | https://ftp.eu.openbsd.org/pub/OpenBSD/ 2 | -------------------------------------------------------------------------------- /openbsd/etc/ksh/colors: -------------------------------------------------------------------------------- 1 | # vim: set syntax=sh 2 | # color variables for exporting 3 | 4 | CRST="$(tput sgr0)" 5 | BOLD="$(tput bold)" 6 | 7 | case $TERM in 8 | rxvt-unicode|xterm|uxterm) 9 | _blk="$(tput setaf 0)" 10 | _red="$(tput setaf 1)" 11 | _grn="$(tput setaf 2)" 12 | _yel="$(tput setaf 3)" 13 | _blu="$(tput setaf 4)" 14 | _mag="$(tput setaf 5)" 15 | _cya="$(tput setaf 6)" 16 | _whi="$(tput setaf 7)" 17 | _BLK="${BOLD}${_blk}" 18 | _RED="${BOLD}${_red}" 19 | _GRN="${BOLD}${_grn}" 20 | _YEL="${BOLD}${_yel}" 21 | _BLU="${BOLD}${_blu}" 22 | _MAG="${BOLD}${_mag}" 23 | _CYA="${BOLD}${_cya}" 24 | _WHI="${BOLD}${_whi}" 25 | ;; 26 | *) 27 | _blk="\e[0;30m" 28 | _red="\e[0;31m" 29 | _grn="\e[0;32m" 30 | _yel="\e[0;33m" 31 | _blu="\e[0;34m" 32 | _mag="\e[0;35m" 33 | _cya="\e[0;36m" 34 | _whi="\e[0;37m" 35 | _BLK="\e[1;30m" 36 | _RED="\e[1;31m" 37 | _GRN="\e[1;32m" 38 | _YEL="\e[1;33m" 39 | _BLU="\e[1;34m" 40 | _MAG="\e[1;35m" 41 | _CYA="\e[1;36m" 42 | _WHI="\e[1;37m" 43 | ;; 44 | esac 45 | -------------------------------------------------------------------------------- /openbsd/etc/ksh/git_prompt: -------------------------------------------------------------------------------- 1 | # ksh git prompt support 2 | # 3 | # Copyright (C) 2006,2007 Shawn O. Pearce 4 | # Distributed under the GNU General Public License, version 2.0. 5 | # 6 | # This script allows you to see repository status in your prompt. 7 | # 8 | # To enable: 9 | # 10 | # 1) Copy this file to somewhere (e.g. ~/.git-prompt.sh). 11 | # 2) Add the following line to your .bashrc/.zshrc: 12 | # source ~/.git-prompt.sh 13 | # 3a) Change your PS1 to call __git_ps1 as 14 | # command-substitution: 15 | # Bash: PS1='[\u@\h \W$(__git_ps1 " (%s)")]\$ ' 16 | # ZSH: setopt PROMPT_SUBST ; PS1='[%n@%m %c$(__git_ps1 " (%s)")]\$ ' 17 | # the optional argument will be used as format string. 18 | # 3b) Alternatively, for a slightly faster prompt, __git_ps1 can 19 | # be used for PROMPT_COMMAND in Bash or for precmd() in Zsh 20 | # with two parameters,
 and , which are strings
 21 | #        you would put in $PS1 before and after the status string
 22 | #        generated by the git-prompt machinery.  e.g.
 23 | #        Bash: PROMPT_COMMAND='__git_ps1 "\u@\h:\w" "\\\$ "'
 24 | #          will show username, at-sign, host, colon, cwd, then
 25 | #          various status string, followed by dollar and SP, as
 26 | #          your prompt.
 27 | #        ZSH:  precmd () { __git_ps1 "%n" ":%~$ " "|%s" }
 28 | #          will show username, pipe, then various status string,
 29 | #          followed by colon, cwd, dollar and SP, as your prompt.
 30 | #        Optionally, you can supply a third argument with a printf
 31 | #        format string to finetune the output of the branch status
 32 | #
 33 | # The repository status will be displayed only if you are currently in a
 34 | # git repository. The %s token is the placeholder for the shown status.
 35 | #
 36 | # The prompt status always includes the current branch name.
 37 | #
 38 | # In addition, if you set GIT_PS1_SHOWDIRTYSTATE to a nonempty value,
 39 | # unstaged (*) and staged (+) changes will be shown next to the branch
 40 | # name.  You can configure this per-repository with the
 41 | # bash.showDirtyState variable, which defaults to true once
 42 | # GIT_PS1_SHOWDIRTYSTATE is enabled.
 43 | #
 44 | # You can also see if currently something is stashed, by setting
 45 | # GIT_PS1_SHOWSTASHSTATE to a nonempty value. If something is stashed,
 46 | # then a '$' will be shown next to the branch name.
 47 | #
 48 | # If you would like to see if there're untracked files, then you can set
 49 | # GIT_PS1_SHOWUNTRACKEDFILES to a nonempty value. If there're untracked
 50 | # files, then a '%' will be shown next to the branch name.  You can
 51 | # configure this per-repository with the bash.showUntrackedFiles
 52 | # variable, which defaults to true once GIT_PS1_SHOWUNTRACKEDFILES is
 53 | # enabled.
 54 | #
 55 | # If you would like to see the difference between HEAD and its upstream,
 56 | # set GIT_PS1_SHOWUPSTREAM="auto".  A "<" indicates you are behind, ">"
 57 | # indicates you are ahead, "<>" indicates you have diverged and "="
 58 | # indicates that there is no difference. You can further control
 59 | # behaviour by setting GIT_PS1_SHOWUPSTREAM to a space-separated list
 60 | # of values:
 61 | #
 62 | #     verbose       show number of commits ahead/behind (+/-) upstream
 63 | #     name          if verbose, then also show the upstream abbrev name
 64 | #     legacy        don't use the '--count' option available in recent
 65 | #                   versions of git-rev-list
 66 | #     git           always compare HEAD to @{upstream}
 67 | #     svn           always compare HEAD to your SVN upstream
 68 | #
 69 | # You can change the separator between the branch name and the above
 70 | # state symbols by setting GIT_PS1_STATESEPARATOR. The default separator
 71 | # is SP.
 72 | #
 73 | # By default, __git_ps1 will compare HEAD to your SVN upstream if it can
 74 | # find one, or @{upstream} otherwise.  Once you have set
 75 | # GIT_PS1_SHOWUPSTREAM, you can override it on a per-repository basis by
 76 | # setting the bash.showUpstream config variable.
 77 | #
 78 | # If you would like to see more information about the identity of
 79 | # commits checked out as a detached HEAD, set GIT_PS1_DESCRIBE_STYLE
 80 | # to one of these values:
 81 | #
 82 | #     contains      relative to newer annotated tag (v1.6.3.2~35)
 83 | #     branch        relative to newer tag or branch (master~4)
 84 | #     describe      relative to older annotated tag (v1.6.3.1-13-gdd42c2f)
 85 | #     default       exactly matching tag
 86 | #
 87 | # If you would like a colored hint about the current dirty state, set
 88 | # GIT_PS1_SHOWCOLORHINTS to a nonempty value. The colors are based on
 89 | # the colored output of "git status -sb" and are available only when
 90 | # using __git_ps1 for PROMPT_COMMAND or precmd.
 91 | #
 92 | # If you would like __git_ps1 to do nothing in the case when the current
 93 | # directory is set up to be ignored by git, then set
 94 | # GIT_PS1_HIDE_IF_PWD_IGNORED to a nonempty value. Override this on the
 95 | # repository level by setting bash.hideIfPwdIgnored to "false".
 96 | 
 97 | # check whether printf supports -v
 98 | __git_printf_supports_v=
 99 | printf -v __git_printf_supports_v -- '%s' yes >/dev/null 2>&1
100 | 
101 | # stores the divergence from upstream in $p
102 | # used by GIT_PS1_SHOWUPSTREAM
103 | __git_ps1_show_upstream ()
104 | {
105 | 	local key value
106 | 	local svn_remote svn_url_pattern count n
107 | 	local upstream=git legacy="" verbose="" name=""
108 | 
109 | 	set -A svn_remote
110 | 	# get some config options from git-config
111 | 	set -A output $(git config -z --get-regexp '^(svn-remote\..*\.url|bash\.showupstream)$' 2>/dev/null | tr '\0\n' '\n ')
112 | 	count=0
113 | 	for idx in ${output[@]}; do
114 | 		if [ $((count % 2)) == 0 ]; then
115 | 			key=${output[$count]}
116 | 			value=${output[$((count+1))]}
117 | 		fi
118 | 
119 | 		case "$key" in
120 | 		bash.showupstream)
121 | 			GIT_PS1_SHOWUPSTREAM="$value"
122 | 			if [[ -z "${GIT_PS1_SHOWUPSTREAM}" ]]; then
123 | 				p=""
124 | 				return
125 | 			fi
126 | 			;;
127 | 		svn-remote.*.url)
128 | 			svn_remote[$((${#svn_remote[@]} + 1))]="$value"
129 | 			svn_url_pattern="$svn_url_pattern\\|$value"
130 | 			upstream=svn+git # default upstream is SVN if available, else git
131 | 			;;
132 | 		esac
133 | 		((count=count+1))
134 | 	done
135 | 
136 | 	# parse configuration values
137 | 	for option in ${GIT_PS1_SHOWUPSTREAM}; do
138 | 		case "$option" in
139 | 		git|svn) upstream="$option" ;;
140 | 		verbose) verbose=1 ;;
141 | 		legacy)  legacy=1  ;;
142 | 		name)    name=1 ;;
143 | 		esac
144 | 	done
145 | 
146 | 	# Find our upstream
147 | 	case "$upstream" in
148 | 	git)    upstream="@{upstream}" ;;
149 | 	svn*)
150 | 		# get the upstream from the "git-svn-id: ..." in a commit message
151 | 		# (git-svn uses essentially the same procedure internally)
152 | 		set -A svn_upstream $(git log --first-parent -1 \
153 | 					--grep="^git-svn-id: \(${svn_url_pattern#??}\)" 2>/dev/null)
154 | 		if [[ 0 -ne ${#svn_upstream[@]} ]]; then
155 | 			svn_upstream=${svn_upstream[${#svn_upstream[@]} - 2]}
156 | 			svn_upstream=${svn_upstream%@*}
157 | 			local n_stop="${#svn_remote[@]}"
158 | 			#for ((n=1; n <= n_stop; n++)); do
159 | 			local count=1;
160 | echo n_stop;
161 | 			for n in n_stop; do
162 | 				svn_upstream=${svn_upstream#${svn_remote[$count]}}
163 | 				((count=count+1))
164 | 			done
165 | 
166 | 			if [[ -z "$svn_upstream" ]]; then
167 | 				# default branch name for checkouts with no layout:
168 | 				upstream=${GIT_SVN_ID:-git-svn}
169 | 			else
170 | 				upstream=${svn_upstream#/}
171 | 			fi
172 | 		elif [[ "svn+git" = "$upstream" ]]; then
173 | 			upstream="@{upstream}"
174 | 		fi
175 | 		;;
176 | 	esac
177 | 
178 | 	# Find how many commits we are ahead/behind our upstream
179 | 	if [[ -z "$legacy" ]]; then
180 | 		count="$(git rev-list --count --left-right \
181 | 				"$upstream"...HEAD 2>/dev/null)"
182 | 	else
183 | 		# produce equivalent output to --count for older versions of git
184 | 		local commits
185 | 		if commits="$(git rev-list --left-right "$upstream"...HEAD 2>/dev/null)"
186 | 		then
187 | 			local commit behind=0 ahead=0
188 | 			for commit in $commits
189 | 			do
190 | 				case "$commit" in
191 | 				"<"*) ((behind++)) ;;
192 | 				*)    ((ahead++))  ;;
193 | 				esac
194 | 			done
195 | 			count="$behind	$ahead"
196 | 		else
197 | 			count=""
198 | 		fi
199 | 	fi
200 | 
201 | 	# calculate the result
202 | 	if [[ -z "$verbose" ]]; then
203 | 		case "$count" in
204 | 		"") # no upstream
205 | 			p="" ;;
206 | 		"0	0") # equal to upstream
207 | 			p="=" ;;
208 | 		"0	"*) # ahead of upstream
209 | 			p=">" ;;
210 | 		*"	0") # behind upstream
211 | 			p="<" ;;
212 | 		*)	    # diverged from upstream
213 | 			p="<>" ;;
214 | 		esac
215 | 	else
216 | 		case "$count" in
217 | 		"") # no upstream
218 | 			p="" ;;
219 | 		"0	0") # equal to upstream
220 | 			p=" u=" ;;
221 | 		"0	"*) # ahead of upstream
222 | 			p=" u+${count#0	}" ;;
223 | 		*"	0") # behind upstream
224 | 			p=" u-${count%	0}" ;;
225 | 		*)	    # diverged from upstream
226 | 			p=" u+${count#*	}-${count%	*}" ;;
227 | 		esac
228 | 		if [[ -n "$count" && -n "$name" ]]; then
229 | 			__git_ps1_upstream_name=$(git rev-parse \
230 | 				--abbrev-ref "$upstream" 2>/dev/null)
231 | 			if [ $pcmode = yes ] && [ $ps1_expanded = yes ]; then
232 | 				p="$p \${__git_ps1_upstream_name}"
233 | 			else
234 | 				p=$(echo "$p ${__git_ps1_upstream_name}" | sed 's/\n//g')
235 | 				# not needed anymore; keep user's
236 | 				# environment clean
237 | 				unset __git_ps1_upstream_name
238 | 			fi
239 | 		fi
240 | 	fi
241 | 
242 | }
243 | 
244 | # Helper function that is meant to be called from __git_ps1.  It
245 | # injects color codes into the appropriate gitstring variables used
246 | # to build a gitstring.
247 | __git_ps1_colorize_gitstring ()
248 | {
249 | 	if [[ -n ${ZSH_VERSION-} ]]; then
250 | 		local c_red='%F{red}'
251 | 		local c_green='%F{green}'
252 | 		local c_lblue='%F{blue}'
253 | 		local c_clear='%f'
254 | 	else
255 | 		# Using \[ and \] around colors is necessary to prevent
256 | 		# issues with command line editing/browsing/completion!
257 | 		local c_red='\[\e[31m\]'
258 | 		local c_green='\[\e[32m\]'
259 | 		local c_lblue='\[\e[1;34m\]'
260 | 		local c_clear='\[\e[0m\]'
261 | 	fi
262 | 	local bad_color=$c_red
263 | 	local ok_color=$c_green
264 | 	local flags_color="$c_lblue"
265 | 
266 | 	local branch_color=""
267 | 	if [ $detached = no ]; then
268 | 		branch_color="$ok_color"
269 | 	else
270 | 		branch_color="$bad_color"
271 | 	fi
272 | 	c="$branch_color$c"
273 | 
274 | 	z="$c_clear$z"
275 | 	if [ "$w" = "*" ]; then
276 | 		w="$bad_color$w"
277 | 	fi
278 | 	if [ -n "$i" ]; then
279 | 		i="$ok_color$i"
280 | 	fi
281 | 	if [ -n "$s" ]; then
282 | 		s="$flags_color$s"
283 | 	fi
284 | 	if [ -n "$u" ]; then
285 | 		u="$bad_color$u"
286 | 	fi
287 | 	r="$c_clear$r"
288 | }
289 | 
290 | __git_eread ()
291 | {
292 | 	local f="$1"
293 | 	shift
294 | 	test -r "$f" && read "$@" <"$f"
295 | }
296 | 
297 | # __git_ps1 accepts 0 or 1 arguments (i.e., format string)
298 | # when called from PS1 using command substitution
299 | # in this mode it prints text to add to bash PS1 prompt (includes branch name)
300 | #
301 | # __git_ps1 requires 2 or 3 arguments when called from PROMPT_COMMAND (pc)
302 | # in that case it _sets_ PS1. The arguments are parts of a PS1 string.
303 | # when two arguments are given, the first is prepended and the second appended
304 | # to the state string when assigned to PS1.
305 | # The optional third parameter will be used as printf format string to further
306 | # customize the output of the git-status string.
307 | # In this mode you can request colored hints using GIT_PS1_SHOWCOLORHINTS=true
308 | __git_ps1 ()
309 | {
310 | 	# preserve exit status
311 | 	local exit=$?
312 | 	local pcmode=no
313 | 	local detached=no
314 | 	local ps1pc_start='\u@\h:\w '
315 | 	local ps1pc_end='\$ '
316 | 	local printf_format=' (%s)'
317 | 
318 | 	case "$#" in
319 | 		2|3)	pcmode=yes
320 | 			ps1pc_start="$1"
321 | 			ps1pc_end="$2"
322 | 			printf_format="${3:-$printf_format}"
323 | 			# set PS1 to a plain prompt so that we can
324 | 			# simply return early if the prompt should not
325 | 			# be decorated
326 | 			PS1="$ps1pc_start$ps1pc_end"
327 | 		;;
328 | 		0|1)	printf_format="${1:-$printf_format}"
329 | 		;;
330 | 		*)	return $exit
331 | 		;;
332 | 	esac
333 | 
334 | 	# ps1_expanded:  This variable is set to 'yes' if the shell
335 | 	# subjects the value of PS1 to parameter expansion:
336 | 	#
337 | 	#   * bash does unless the promptvars option is disabled
338 | 	#   * zsh does not unless the PROMPT_SUBST option is set
339 | 	#   * POSIX shells always do
340 | 	#
341 | 	# If the shell would expand the contents of PS1 when drawing
342 | 	# the prompt, a raw ref name must not be included in PS1.
343 | 	# This protects the user from arbitrary code execution via
344 | 	# specially crafted ref names.  For example, a ref named
345 | 	# 'refs/heads/$(IFS=_;cmd=sudo_rm_-rf_/;$cmd)' might cause the
346 | 	# shell to execute 'sudo rm -rf /' when the prompt is drawn.
347 | 	#
348 | 	# Instead, the ref name should be placed in a separate global
349 | 	# variable (in the __git_ps1_* namespace to avoid colliding
350 | 	# with the user's environment) and that variable should be
351 | 	# referenced from PS1.  For example:
352 | 	#
353 | 	#     __git_ps1_foo=$(do_something_to_get_ref_name)
354 | 	#     PS1="...stuff...\${__git_ps1_foo}...stuff..."
355 | 	#
356 | 	# If the shell does not expand the contents of PS1, the raw
357 | 	# ref name must be included in PS1.
358 | 	#
359 | 	# The value of this variable is only relevant when in pcmode.
360 | 	#
361 | 	# Assume that the shell follows the POSIX specification and
362 | 	# expands PS1 unless determined otherwise.  (This is more
363 | 	# likely to be correct if the user has a non-bash, non-zsh
364 | 	# shell and safer than the alternative if the assumption is
365 | 	# incorrect.)
366 | 	#
367 | 	local ps1_expanded=yes
368 | 	[ -z "${ZSH_VERSION-}" ] || [[ -o PROMPT_SUBST ]] || ps1_expanded=no
369 | 	[ -z "${BASH_VERSION-}" ] || shopt -q promptvars || ps1_expanded=no
370 | 
371 | 	local repo_info rev_parse_exit_code
372 | 	set -A repo_info $(git rev-parse --git-dir --is-inside-git-dir \
373 | 		--is-bare-repository --is-inside-work-tree \
374 | 		--short HEAD 2>/dev/null)
375 | 	rev_parse_exit_code="$?"
376 | 
377 | 	if [ -z "$repo_info" ]; then
378 | 		return $exit
379 | 	fi
380 | 
381 | 	local short_sha=""
382 | 	idx=${#repo_info[@]}
383 | 	((idx=idx-1))
384 | 	if [ "$rev_parse_exit_code" = "0" ]; then
385 | 		short_sha="${repo_info[$idx]}"
386 | 		((idx=idx-1))
387 | 	fi
388 | 	local inside_worktree="${repo_info[$idx]}"
389 | 	((idx=idx-1))
390 | 	local bare_repo="${repo_info[$idx]}"
391 | 	((idx=idx-1))
392 | 	local inside_gitdir="${repo_info[$idx]}"
393 | 	((idx=idx-1))
394 | 	local g="${repo_info[0]}"
395 | 
396 | 	if [ "true" = "$inside_worktree" ] &&
397 | 	   [ -n "${GIT_PS1_HIDE_IF_PWD_IGNORED-}" ] &&
398 | 	   [ "$(git config --bool bash.hideIfPwdIgnored)" != "false" ] &&
399 | 	   git check-ignore -q .
400 | 	then
401 | 		return $exit
402 | 	fi
403 | 
404 | 	local r=""
405 | 	local b=""
406 | 	local step=""
407 | 	local total=""
408 | 	if [ -d "$g/rebase-merge" ]; then
409 | 		__git_eread "$g/rebase-merge/head-name" b
410 | 		__git_eread "$g/rebase-merge/msgnum" step
411 | 		__git_eread "$g/rebase-merge/end" total
412 | 		if [ -f "$g/rebase-merge/interactive" ]; then
413 | 			r="|REBASE-i"
414 | 		else
415 | 			r="|REBASE-m"
416 | 		fi
417 | 	else
418 | 		if [ -d "$g/rebase-apply" ]; then
419 | 			__git_eread "$g/rebase-apply/next" step
420 | 			__git_eread "$g/rebase-apply/last" total
421 | 			if [ -f "$g/rebase-apply/rebasing" ]; then
422 | 				__git_eread "$g/rebase-apply/head-name" b
423 | 				r="|REBASE"
424 | 			elif [ -f "$g/rebase-apply/applying" ]; then
425 | 				r="|AM"
426 | 			else
427 | 				r="|AM/REBASE"
428 | 			fi
429 | 		elif [ -f "$g/MERGE_HEAD" ]; then
430 | 			r="|MERGING"
431 | 		elif [ -f "$g/CHERRY_PICK_HEAD" ]; then
432 | 			r="|CHERRY-PICKING"
433 | 		elif [ -f "$g/REVERT_HEAD" ]; then
434 | 			r="|REVERTING"
435 | 		elif [ -f "$g/BISECT_LOG" ]; then
436 | 			r="|BISECTING"
437 | 		fi
438 | 
439 | 		if [ -n "$b" ]; then
440 | 			:
441 | 		elif [ -h "$g/HEAD" ]; then
442 | 			# symlink symbolic ref
443 | 			b="$(git symbolic-ref HEAD 2>/dev/null)"
444 | 		else
445 | 			local head=""
446 | 			if ! __git_eread "$g/HEAD" head; then
447 | 				return $exit
448 | 			fi
449 | 			# is it a symbolic ref?
450 | 			b="${head#ref: }"
451 | 			if [ "$head" = "$b" ]; then
452 | 				detached=yes
453 | 				b="$(
454 | 				case "${GIT_PS1_DESCRIBE_STYLE-}" in
455 | 				(contains)
456 | 					git describe --contains HEAD ;;
457 | 				(branch)
458 | 					git describe --contains --all HEAD ;;
459 | 				(describe)
460 | 					git describe HEAD ;;
461 | 				(* | default)
462 | 					git describe --tags --exact-match HEAD ;;
463 | 				esac 2>/dev/null)" ||
464 | 
465 | 				b="$short_sha..."
466 | 				b="($b)"
467 | 			fi
468 | 		fi
469 | 	fi
470 | 
471 | 	if [ -n "$step" ] && [ -n "$total" ]; then
472 | 		r="$r $step/$total"
473 | 	fi
474 | 
475 | 	local w=""
476 | 	local i=""
477 | 	local s=""
478 | 	local u=""
479 | 	local c=""
480 | 	local p=""
481 | 
482 | 	if [ "true" = "$inside_gitdir" ]; then
483 | 		if [ "true" = "$bare_repo" ]; then
484 | 			c="BARE:"
485 | 		else
486 | 			b="GIT_DIR!"
487 | 		fi
488 | 	elif [ "true" = "$inside_worktree" ]; then
489 | 		if [ -n "${GIT_PS1_SHOWDIRTYSTATE-}" ] &&
490 | 		   [ "$(git config --bool bash.showDirtyState)" != "false" ]
491 | 		then
492 | 			git diff --no-ext-diff --quiet || w="*"
493 | 			git diff --no-ext-diff --cached --quiet || i="+"
494 | 			if [ -z "$short_sha" ] && [ -z "$i" ]; then
495 | 				i="#"
496 | 			fi
497 | 		fi
498 | 		if [ -n "${GIT_PS1_SHOWSTASHSTATE-}" ] &&
499 | 		   git rev-parse --verify --quiet refs/stash >/dev/null
500 | 		then
501 | 			s="$"
502 | 		fi
503 | 
504 | 		if [ -n "${GIT_PS1_SHOWUNTRACKEDFILES-}" ] &&
505 | 		   [ "$(git config --bool bash.showUntrackedFiles)" != "false" ] &&
506 | 		   git ls-files --others --exclude-standard --directory --no-empty-directory --error-unmatch -- ':/*' >/dev/null 2>/dev/null
507 | 		then
508 | 			u="%${ZSH_VERSION+%}"
509 | 		fi
510 | 
511 | 		if [ -n "${GIT_PS1_SHOWUPSTREAM-}" ]; then
512 | 			__git_ps1_show_upstream
513 | 		fi
514 | 	fi
515 | 
516 | 	local z="${GIT_PS1_STATESEPARATOR-" "}"
517 | 
518 | 	# NO color option unless in PROMPT_COMMAND mode
519 | 	if [ $pcmode = yes ] && [ -n "${GIT_PS1_SHOWCOLORHINTS-}" ]; then
520 | 		__git_ps1_colorize_gitstring
521 | 	fi
522 | 
523 | 	b=${b##refs/heads/}
524 | 	if [ $pcmode = yes ] && [ $ps1_expanded = yes ]; then
525 | 		__git_ps1_branch_name=$b
526 | 		b="\${__git_ps1_branch_name}"
527 | 	fi
528 | 
529 | 	local f="$w$i$s$u"
530 | 	local gitstring="$c$b${f:+$z$f}$r$p"
531 | 
532 | 	if [ $pcmode = yes ]; then
533 | 		if [ "${__git_printf_supports_v-}" != yes ]; then
534 | 			gitstring=$(printf -- "$printf_format" "$gitstring")
535 | 		else
536 | 			printf -v gitstring -- "$printf_format" "$gitstring"
537 | 		fi
538 | 		PS1="$ps1pc_start$gitstring$ps1pc_end"
539 | 	else
540 | 		printf -- "$printf_format" "$gitstring"
541 | 	fi
542 | 
543 | 	return $exit
544 | }
545 | 
546 | 


--------------------------------------------------------------------------------
/openbsd/etc/ksh/ksh_aliases:
--------------------------------------------------------------------------------
 1 | # vim: syntax=sh
 2 | # ksh aliases to make a life just a tad bit more bearable
 3 | 
 4 | # handy dandy system related
 5 | alias ls="colorls -GF"
 6 | alias l="ls"
 7 | alias ll="ls -lhA"
 8 | alias df="df -h"
 9 | alias cp="cp -r"
10 | alias chown="chown -R"
11 | alias mkdir="mkdir -p"
12 | alias md="mkdir -p"
13 | 
14 | alias c="clear"
15 | alias reload=". $HOME/.kshrc"
16 | alias usr1="pkill -USR1"
17 | 
18 | alias ..="cd .."
19 | alias ...="cd ../.."
20 | alias ....="cd ../../.."
21 | 
22 | # package management
23 | alias pkga="doas pkg_add"
24 | alias pkgu="doas pkg_add -u"
25 | alias pkgd="doas pkg_delete"
26 | alias pkgi="pkg_info"
27 | alias pkgq="pkg_info -Q"
28 | alias pkgl="pkg_locate"
29 | 
30 | alias daim="doas make install"
31 | 
32 | # colorized logs for easier perusal
33 | alias dlog="colortail -k  /usr/local/share/examples/colortail/conf.daemon -f /var/log/daemon"
34 | alias mlog="colortail -k  /usr/local/share/examples/colortail/conf.messages -f /var/log/messages"
35 | alias slog="colortail -k  /usr/local/share/examples/colortail/conf.secure -f /var/log/secure"
36 | alias alog="colortail -k  /usr/local/share/examples/colortail/conf.authlog -f /var/log/authlog"
37 | 
38 | # text editors
39 | alias vi="nvim"
40 | alias vim="nvim"
41 | alias e="emacsc"
42 | alias em="emacsc"
43 | 
44 | # misc
45 | alias xclip="xclip -selection clipboard"
46 | alias xr="xrdb -merge ~/.Xresources"
47 | alias dash="dash -l"
48 | 
49 | # git
50 | alias gc="git clone"
51 | alias ga="git add"
52 | alias grm="git rm"
53 | alias gcm="git commit -m"
54 | alias gp="git push"
55 | alias gpom="git push origin master"
56 | alias gpod="git push origin devel"
57 | 


--------------------------------------------------------------------------------
/openbsd/etc/ksh/ksh_env:
--------------------------------------------------------------------------------
 1 | # vim: syntax=sh
 2 | LANG="en_US.UTF-8"
 3 | LC_TYPE="en_US.UTF-8"
 4 | LC_ALL=""
 5 | export LANG LC_TYPE LC_ALL
 6 | 
 7 | PLAN9=/usr/local/plan9
 8 | JDK="/usr/local/jdk-1.8.0/bin"
 9 | PATH=$PATH:$PLAN9/bin:$HOME/bin:$HOME/.bin:$JDK
10 | export PLAN9 JDK PATH
11 | 
12 | AUTOCONF_VERSION=2.69
13 | AUTORECONF_VERSION=2.69
14 | export AUTOCONF_VERSION AUTORECONF_VERSION
15 | 
16 | EDITOR="emacs"
17 | VISUAL="emacs"
18 | export EDITOR VISUAL
19 | 


--------------------------------------------------------------------------------
/openbsd/etc/ksh/ksh_functions:
--------------------------------------------------------------------------------
 1 | # vim: set syntax=sh
 2 | cd() {
 3 | 	command cd "$@";
 4 | 	echo -ne "\033]0;${PWD}\007";
 5 | }
 6 | exitstatus() {
 7 | 	[ $? == 0 ] && echo '✓' || echo '✕'
 8 | }
 9 | rprompt() {
10 | 	printf "%*s" $COLUMNS "$1"
11 | }
12 | line() {
13 | 	printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' -
14 | }
15 | printcolors() {
16 | 	echo -ne "\n"
17 | 	for col in `seq 40 47`; do
18 | 		echo -ne "\033[${col}m    \033[m"
19 | 	done
20 | 	echo -e "\n"
21 | }
22 | 


--------------------------------------------------------------------------------
/openbsd/etc/ksh/ksh_prompt:
--------------------------------------------------------------------------------
 1 | # vim: set syntax=sh
 2 | UID=`id -u`
 3 | ROOT=''
 4 | GIT_PS1_SHOWDIRTYSTATE=1
 5 | GIT_PS1_SHOWSTASHSTATE=1
 6 | GIT_PS1_SHOWUNTRACKEDFILES=1
 7 | #GIT_PS1_SHOWUPSTREAM="auto"
 8 | #GIT_PS1_DESCRIBE_STYLE="branch"
 9 | 
10 | # check to see if uid corresponds to root and modify prompt
11 | case $UID in
12 | 	0)
13 | 		ROOT=' # '
14 | 		set -A ps1c ${_yel} ${_red} ${_RED}
15 | 	;;
16 | 	1000)
17 | 		set -A ps1c ${_grn} ${_BLK} ${_mag}
18 | 	;;
19 | 	*)
20 | 		set -A ps1c ${_GRN} ${_grn} $_{yel}
21 | 	;;
22 | esac
23 | # is this a secure shell connection, if so modify the prompt
24 | if [ -n "$SSH_CLIENT" ] || [ -n "$SSH_TTY" ]; then
25 | 	SSH_PS1="\[${_red}\]ε ⇒ "
26 | else
27 | 	SSH_PS1='';
28 | fi
29 | 
30 | PS1_GIT="\[${_whi}\]\[\$(__git_ps1 '⭠ %s ∷ ')\]\[${CRST}\]"
31 | _PS1="\[${ps1c[0]}\]λ \[${CRST}${ps1c[1]}\]∷\[${CRST}\]"
32 | __PS1="\[${ps1c[2]}\]⇒\[${CRST}\]${ROOT}"
33 | RPS1="\[${_BLK}\]\[\$(tput sc; rprompt \${PWD#$HOME/}; tput rc)\]\[${CRST}\]"
34 | PS1="${RPS1}${SSH_PS1}${_PS1} ${PS1_GIT}${__PS1} "
35 | PS2="\[${ps1c[2]}\]>\[${CRST}\] "
36 | 


--------------------------------------------------------------------------------
/openbsd/etc/mail/smtpd.conf:
--------------------------------------------------------------------------------
1 | table aliases file:/etc/mail/aliases
2 | table secrets db:/etc/mail/secrets.db
3 | 
4 | listen on lo0
5 | accept for local alias  deliver to mbox
6 | accept for any relay via tls+auth://googlemail@smtp.googlemail.com:587 auth 
7 | 


--------------------------------------------------------------------------------
/openbsd/etc/wsconsctl.conf:
--------------------------------------------------------------------------------
1 | keyboard.bell.volume=0
2 | display.screen_off=120000
3 | mouse.tp.tapping=1
4 | display.brightness=25%
5 | 


--------------------------------------------------------------------------------
/openbsd/home/.Xresources:
--------------------------------------------------------------------------------
 1 | !! Xft / font stuff
 2 | Xft.rgba:       rgb
 3 | Xft.hintstyle:  hintslight
 4 | Xft.dpi:        96
 5 | Xft.antialias:  true
 6 | Xft.hinting:    true
 7 | 
 8 | !! colors
 9 | URxvt.cursorColor:  #d7d0c7
10 | URxvt.foreground:   #d7d0c7
11 | URxvt.background:   #151515
12 | st.foreground:      #d7d0c7
13 | st.background:      #151515
14 | 
15 | *.color0:   #101010
16 | *.color8:   #404040
17 | *.color1:   #e84f4f
18 | *.color9:   #d23d3d
19 | *.color2:   #b8d68c
20 | *.color10:  #a0cf5d
21 | *.color3:   #e1aa5d
22 | *.color11:  #f39d21
23 | *.color4:   #7dc1cf
24 | *.color12:  #4e9fb1
25 | *.color5:   #9b64fb
26 | *.color13:  #8542ff
27 | *.color6:   #6d878d
28 | *.color14:  #42717b
29 | *.color7:   #dddddd
30 | *.color15:  #dddddd
31 | 
32 | !! urxvt specific settings
33 | URxvt.termName:         rxvt-unicode
34 | URxvt.geometry:         90x24
35 | URxvt.loginShell:       true
36 | URxvt.internalBorder:   10
37 | URxvt.lineSpace:        0
38 | URxvt*saveLines:        12000
39 | URxvt*scrollBar:        false
40 | URxvt*scrollBar_right:  false
41 | 
42 | URxvt*font: -*-lime.se-*-*-*-*-10-*-*-*-*-*-*-*, xft:Go\ Mono:antialias=true:hinting=slight
43 | URxvt*boldFont: -*-lime.se-*-*-*-*-10-*-*-*-*-*-*-*,, xft:Go\ Mono:antialias=true:hinting=slight
44 | 
45 | !! xst/st specific settings
46 | st.termname:    st-256color
47 | !st.font:        lime.se:size=8:antialias=false:hinting=full
48 | st.font:        scientifica:size=7:hinting=full:antialias=false
49 | st.cwscale:     1.1
50 | st.chscale:     1.1
51 | st.bellvolume:  0
52 | st.borderpx:    10px
53 | 


--------------------------------------------------------------------------------
/openbsd/home/.config/bspwm/bspwmrc:
--------------------------------------------------------------------------------
 1 | #!/bin/sh
 2 | 
 3 | sxhkd &
 4 | 
 5 | bspc monitor -d acme term inet chat mdia misc
 6 | 
 7 | bspc config border_width         4
 8 | bspc config window_gap           10
 9 | 
10 | bspc config split_ratio          0.55
11 | bspc config borderless_monocle   true
12 | bspc config gapless_monocle      true
13 | 
14 | bspc config normal_border_color  "#ececec"
15 | bspc config focused_border_color "#546e7a"
16 | 
17 | bspc config click_to_focus button1
18 | bspc config swallow_first_click true
19 | 


--------------------------------------------------------------------------------
/openbsd/home/.config/i3/config:
--------------------------------------------------------------------------------
  1 | # workspaces
  2 | set $term 1:
  3 | set $code 2:
  4 | set $web 3:
  5 | set $chat 4:
  6 | set $mdia 5:
  7 | set $misc 6:
  8 | # binding modes
  9 | set $resize 
 10 | 
 11 | 
 12 | #font -*-yuki-*-*-*-*-10-*-*-*-*-*-*-*
 13 | font -*-lime.se-*-*-*-*-10-*-*-*-*-*-*-*
 14 | 
 15 | set $mod Mod4
 16 | floating_modifier $mod
 17 | 
 18 | #bindsym $mod+Return exec /usr/X11R6/bin/xterm
 19 | #bindsym $mod+p exec /usr/local/bin/dmenu_run -fn 'yuki:size=7:antialias=false:hinting=full'
 20 | bindsym $mod+p exec /usr/local/bin/dmenu_run -fn 'lime.se:size=8:antialias=false:hinting=full'
 21 | 
 22 | bindsym $mod+Return exec /usr/local/bin/urxvtc	
 23 | #bindsym $mod+p exec /home/jamppa/bin/dmenu_custom
 24 | 
 25 | bindsym $mod+Shift+c kill
 26 | 
 27 | bindsym $mod+j focus left
 28 | bindsym $mod+k focus down
 29 | bindsym $mod+l focus up
 30 | bindsym $mod+odiaeresis focus right
 31 | 
 32 | bindsym $mod+Left focus left
 33 | bindsym $mod+Down focus down
 34 | bindsym $mod+Up focus up
 35 | bindsym $mod+Right focus right
 36 | 
 37 | bindsym $mod+Shift+j move left
 38 | bindsym $mod+Shift+k move down
 39 | bindsym $mod+Shift+l move up
 40 | bindsym $mod+Shift+odiaeresis move right
 41 | 
 42 | bindsym $mod+Shift+Left move left
 43 | bindsym $mod+Shift+Down move down
 44 | bindsym $mod+Shift+Up move up
 45 | bindsym $mod+Shift+Right move right
 46 | 
 47 | bindsym $mod+h split h
 48 | bindsym $mod+v split v
 49 | 
 50 | bindsym $mod+f fullscreen toggle
 51 | bindsym $mod+s layout stacking
 52 | bindsym $mod+w layout tabbed
 53 | bindsym $mod+e layout toggle split
 54 | 
 55 | bindsym $mod+Shift+space floating toggle
 56 | bindsym $mod+space focus mode_toggle
 57 | 
 58 | bindsym $mod+a focus parent
 59 | bindsym $mod+d focus child
 60 | 
 61 | bindsym $mod+1 workspace number $term
 62 | bindsym $mod+2 workspace number $code
 63 | bindsym $mod+3 workspace number $web
 64 | bindsym $mod+4 workspace number $chat
 65 | bindsym $mod+5 workspace number $mdia
 66 | bindsym $mod+6 workspace number $misc
 67 | #bindsym $mod+7 workspace 7
 68 | #bindsym $mod+8 workspace 8
 69 | #bindsym $mod+9 workspace 9
 70 | #bindsym $mod+0 workspace 10
 71 | 
 72 | bindsym $mod+Shift+1 move container to workspace number $term
 73 | bindsym $mod+Shift+2 move container to workspace number $code
 74 | bindsym $mod+Shift+3 move container to workspace number $web
 75 | bindsym $mod+Shift+4 move container to workspace number $chat
 76 | bindsym $mod+Shift+5 move container to workspace number $mdia
 77 | bindsym $mod+Shift+6 move container to workspace number $misc
 78 | #bindsym $mod+Shift+7 move container to workspace 7
 79 | #bindsym $mod+Shift+8 move container to workspace 8
 80 | #bindsym $mod+Shift+9 move container to workspace 9
 81 | #bindsym $mod+Shift+0 move container to workspace 10
 82 | 
 83 | bindsym $mod+Shift+r reload
 84 | bindsym $mod+Shift+q restart
 85 | bindsym $mod+Shift+e exec "i3-nagbar -t warning -m 'You pressed the exit shortcut. Do you really want to exit i3? This will end your X session.' -b 'Yes, exit i3' 'i3-msg exit'"
 86 | 
 87 | assign [class="acme"] $code
 88 | assign [class="Chromium-browser"] $web
 89 | assign [class="Firefox"] $web
 90 | assign [class="mpv"] $mdia
 91 | assign [class="Sxiv"] $mdia
 92 | 
 93 | for_window [window_role="pop-up"] floating enable
 94 | for_window [window_role="task_dialog"] floating enable
 95 | 
 96 | bindsym $mod+r mode "$resize"
 97 | 
 98 | # resize window (you can also use the mouse for that)
 99 | mode "$resize" {
100 | 	bindsym $mod+j resize shrink width 1 px or 1 ppt
101 | 	bindsym $mod+k resize grow height 1 px or 1 ppt
102 | 	bindsym $mod+l resize shrink height 1 px or 1 ppt
103 | 	bindsym $mod+odiaeresis resize grow width 1 px or 1 ppt
104 | 
105 | 	bindsym Shift+j resize shrink width 5 px or 5 ppt
106 | 	bindsym Shift+k resize grow height 5 px or 5 ppt
107 | 	bindsym Shift+l resize shrink height 5 px or 5 ppt
108 | 	bindsym Shift+odiaeresis resize grow width 5 px or 5 ppt
109 | 
110 | 	bindsym j resize shrink width 10 px or 10 ppt
111 | 	bindsym k resize grow height 10 px or 10 ppt
112 | 	bindsym l resize shrink height 10 px or 10 ppt
113 | 	bindsym odiaeresis resize grow width 10 px or 10 ppt
114 | 
115 | 	bindsym $mod+Left resize shrink width 1 px or 1 ppt
116 | 	bindsym $mod+Down resize grow height 1 px or 1 ppt
117 | 	bindsym $mod+Up resize shrink height 1 px or 1 ppt
118 | 	bindsym $mod+Right resize grow width 1 px or 1 ppt
119 | 
120 | 	bindsym Shift+Left resize shrink width 5 px or 5 ppt
121 | 	bindsym Shift+Down resize grow height 5 px or 5 ppt
122 | 	bindsym Shift+Up resize shrink height 5 px or 5 ppt
123 | 	bindsym Shift+Right resize grow width 5 px or 5 ppt
124 | 
125 | 	bindsym Left resize shrink width 10 px or 10 ppt
126 | 	bindsym Down resize grow height 10 px or 10 ppt
127 | 	bindsym Up resize shrink height 10 px or 10 ppt
128 | 	bindsym Right resize grow width 10 px or 10 ppt
129 | 
130 | 	bindsym Return mode "default"
131 | 	bindsym Escape mode "default"
132 | 	bindsym $mod+r mode "default"
133 | }
134 | 
135 | new_window 1pixel
136 | client.focused          #888888 #333333 #DDDDDD #888888   #888888
137 | client.focused_inactive #333333 #3F3F3F #DDDDDD #333333   #333333
138 | client.unfocused        #333333 #222222 #666666 #292D2E   #222222
139 | client.urgent           #CCCCCC #222222 #DDDDDD #CCCCCC   #CCCCCC
140 | client.placeholder      #333333 #151515 #888888 #333333   #333333
141 | 
142 | client.background       #151515
143 | 
144 | bar {
145 | 	status_command i3status
146 | 	position top
147 | 	font pango: lime.se, Siji 8
148 | 	strip_workspace_numbers yes
149 | 
150 | 	colors {
151 | 		background #101010
152 | 		statusline #DDDDDD
153 | #		separator  #555555
154 | 		separator  #151515
155 | 
156 | #		focused_workspace  #555555 #333333 #DDDDDD
157 | #		active_workspace   #555555 #222222 #DDDDDD
158 | #		inactive_workspace #555555 #222222 #666666
159 | #		urgent_workspace   #555555 #BBBBBB #222222
160 | #		binding_mode       #555555 #BBBBBB #222222
161 | 		focused_workspace  #101010 #101010 #CCCCCC
162 | 		active_workspace   #101010 #101010 #999999
163 | 		inactive_workspace #101010 #101010 #7F7F7F
164 | 		urgent_workspace   #101010 #101010 #FFFFFF
165 | 		binding_mode       #101010 #101010 #5a5a5a
166 | 	}
167 | }
168 | 


--------------------------------------------------------------------------------
/openbsd/home/.config/i3status/config:
--------------------------------------------------------------------------------
 1 | general {
 2 | 	output_format = "i3bar"
 3 | 	colors = true
 4 | 	interval = 5
 5 | 	markup = "pango"
 6 | 
 7 | 	separator = false
 8 | 
 9 | 	color_good = "#a0cf5d"
10 | 	color_bad = "#e84f4f"
11 | 	color_degraded = "#aaaaaa"
12 | 	color_separator = "#555555"
13 | }
14 | 
15 | order += "wireless iwn0"
16 | order += "ethernet enc0"
17 | #order += "disk /home"
18 | #order += "load"
19 | #order += "cpu_temperature 0"
20 | order += "battery 0"
21 | order += "tztime local"
22 | order += "tztime date"
23 | 
24 | wireless iwn0 {
25 | 	format_up = " %essid  %ip"
26 | 	format_down = ""
27 | }
28 | 
29 | ethernet enc0 {
30 | 	format_up = "E: %ip (%speed)"
31 | 	format_down = ""
32 | }
33 | battery 0 {
34 | 	format = "%status %percentage"
35 | 	format_down = ""
36 | #	status_chr = "⚡ charging"
37 | 	status_chr = ""
38 | 	status_bat = ""
39 | 	status_unk = "UNK"
40 | 	status_full = ""
41 | 	path = "/sys/class/power_supply/BAT%d/uevent"
42 | 	low_threshold = 20
43 | }
44 | 
45 | load {
46 | 	format = " %5min"
47 | }
48 | 
49 | #cpu_temperature 0 {
50 | #	format = " %degrees"
51 | #	path = "/sys/devices/platform/coretemp.0/temp1_input"
52 | #}
53 | 
54 | disk "/home" {
55 | 	format = " %avail available at "
56 | 	prefix_type = g
57 | }
58 | 
59 | tztime local {
60 | 	format = " %time"
61 | 	format_time = "%H:%M"
62 | }
63 | 
64 | tztime date {
65 | 	format =" %time "
66 | 	format_time = "%Y-%m-%d"
67 | }
68 | 


--------------------------------------------------------------------------------
/openbsd/home/.config/nvim/init.vim:
--------------------------------------------------------------------------------
  1 | call plug#begin('~/.config/nvim/plugged')
  2 | 	Plug 'godlygeek/tabular'
  3 | 	Plug 'scrooloose/nerdcommenter'
  4 | 	Plug 'scrooloose/nerdtree'
  5 | 	Plug 'tpope/vim-fugitive'
  6 | 	Plug 'vim-syntastic/syntastic'
  7 | 	Plug 'raimondi/delimitmate'
  8 | 	Plug 'PotatoesMaster/i3-vim-syntax'
  9 | 	Plug 'dylanaraps/wal.vim'
 10 | call plug#end()
 11 | 
 12 | set encoding=utf-8
 13 | set fileencoding=utf-8
 14 | set clipboard^=unnamed,unnamedplus
 15 | 
 16 | set modeline
 17 | set modelines=2
 18 | 
 19 | set ttimeout
 20 | set ttimeoutlen=100
 21 | set ignorecase
 22 | set smartcase
 23 | set gdefault
 24 | 
 25 | filetype indent on
 26 | set autoindent
 27 | set smartindent
 28 | 
 29 | set showmatch
 30 | set number
 31 | set formatoptions+=o
 32 | set tabstop=4
 33 | set shiftwidth=4
 34 | set linespace=0
 35 | set nojoinspaces
 36 | set cursorline
 37 | set ruler
 38 | 
 39 | set foldmethod=syntax
 40 | set foldlevelstart=99
 41 | 
 42 | set splitbelow
 43 | set splitright
 44 | 
 45 | if !&scrolloff
 46 | 	set scrolloff=3
 47 | endif
 48 | if !&sidescrolloff
 49 | 	set sidescrolloff=5
 50 | endif
 51 | 
 52 | set nostartofline
 53 | set listchars=tab:◗◗,trail:⋆,extends:>,precedes:<,nbsp:⋆
 54 | set list
 55 | set autochdir
 56 | set isfname-=:
 57 | set isfname-==
 58 | set isfname-=+
 59 | 
 60 | set statusline=\ \ \ \ %F\ %y\ %m
 61 | set statusline+=%#warningmsg#
 62 | set statusline+=%{SyntasticStatuslineFlag()}
 63 | set statusline+=%*
 64 | 
 65 | let g:syntastic_always_populate_loc_list = 1
 66 | let g:syntastic_auto_loc_list = 1
 67 | let g:syntastic_check_on_open = 1
 68 | let g:syntastic_check_on_wq = 1
 69 | 
 70 | let g:NERDSpaceDelims = 1
 71 | let g:NERDTrimTrailingWhitespace = 1
 72 | 
 73 | if &undolevels < 200
 74 | 	set undolevels=200
 75 | endif
 76 | 
 77 | set wildmode=list:longest
 78 | set wildchar=
 79 | 
 80 | if &t_Co == 8 && $TERM !~# '^linux'
 81 | 	set t_Co=16
 82 | endif
 83 | color term
 84 | "colorscheme wal
 85 | "highlight ExtraWhitespace ctermbg=gray guibg=gray
 86 | "match ExtraWhitespace /\s\+$\|\t/
 87 | highlight Comment ctermfg=darkgray
 88 | "highlight CursorLineNr ctermfg=gray
 89 | highlight Cursorline ctermbg=black ctermfg=2
 90 | highlight Statusline ctermbg=black cterm=none ctermfg=2
 91 | highlight StatuslineNC ctermbg=none cterm=none ctermfg=black
 92 | highlight VertSplit cterm=none ctermfg=black
 93 | set diffopt+=iwhite
 94 | set fillchars+=vert:║,stl:,stlnc:
 95 | 
 96 | function! NumberToggle()
 97 | 	if(&relativenumber == 1)
 98 | 		set nornu
 99 | 		set number
100 | 	else
101 | 		set rnu
102 | 	endif
103 | endfunc
104 | 
105 | command! W w !doas tee %
106 | command! Tab Tabularize
107 | command! S source ~/.config/nvim/init.vim
108 | 
109 | let mapleader="\"
110 | 
111 | if maparg('', 'n') ==# ''
112 | 	nnoremap   :nohlsearch
113 | endif
114 | 
115 | inoremap kj 
116 | inoremap jk 
117 | nnoremap ; :
118 | nnoremap  G
119 | nnoremap  gg
120 | nnoremap j gj
121 | nnoremap k gk
122 | inoremap  
123 | inoremap  
124 | nnoremap  w
125 | 
126 | nnoremap r :call NumberToggle()
127 | nnoremap w :w
128 | nnoremap t :Tabularize / \zs
129 | 
130 | map  :NERDTreeToggle
131 | 
132 | vmap y "+y
133 | vmap d "+d
134 | nmap p "+p
135 | nmap P "+P
136 | 
137 | nmap l :bnext
138 | nmap h :bprevious
139 | 
140 | " global substitution
141 | nmap s :%s//g
142 | 
143 | " split navigation
144 | inoremap            h
145 | inoremap            j
146 | inoremap            k
147 | inoremap            l
148 | nnoremap            h
149 | nnoremap            j
150 | nnoremap            k
151 | nnoremap            l
152 | 
153 | " terminal
154 | au BufEnter * if &buftype == 'terminal' | :startinsert | endif
155 | au TermOpen * setlocal nonumber
156 | tnoremap  
157 | tnoremap jk    
158 | tnoremap kj     
159 | tnoremap  h
160 | tnoremap  j
161 | tnoremap  k
162 | tnoremap  l
163 | 


--------------------------------------------------------------------------------
/openbsd/home/.config/sxhkd/sxhkdrc:
--------------------------------------------------------------------------------
 1 | super + Return
 2 | 	9term -s -f '/usr/local/plan9/font/mntcarlo/mntcarlo.font'
 3 | 
 4 | super + @space
 5 | 	dmenu_run -fn 'ProFontWindows:size=9:antialias=false' -nf '#444444' -nb '#ececec' -sf '#ececec' -sb '#546e7a'
 6 | 
 7 | super + Escape
 8 | 	pkill -USR1 -x sxhkd
 9 | 
10 | super + alt + Escape
11 | 	bspc quit
12 | 
13 | super + {_,shift + }w
14 | 	bspc node -{c,k}
15 | 
16 | super + m
17 | 	bspc desktop -l next
18 | 
19 | super + y
20 | 	bspc query -N -n focused.automatic && bspc node -n last.!automatic || bspc node last.leaf -n focused
21 | 
22 | super + g
23 | 	bspc node -s biggest
24 | 
25 | super + {t,shift + t,s,f}
26 | 	bspc node -t {tiled,pseudo_tiled,floating,fullscreen}
27 | 
28 | super + ctrl + {x,y,z}
29 | 	bspc node -g {locked,sticky,private}
30 | 
31 | super + {_,shift + }{h,j,k,l}
32 | 	bspc node -{f,s} {west,south,north,east}
33 | 
34 | super + {p,b,comma,period}
35 | 	bspc node -f @{parent,brother,first,second}
36 | 
37 | super + {_,shift + }c
38 | 	bspc node -f {next,prev}.local
39 | 	
40 | super + {_,shift + } Tab
41 | 	bspc node -f {next,prev}.local
42 | 
43 | super + bracket{left,right}
44 | 	bspc desktop -f {prev,next}.local
45 | 
46 | super + {o,i}
47 | 	bspc wm -h off; \
48 | 	bspc node {older,newer} -f; \
49 | 	bspc wm -h on
50 | 
51 | super + {_,shift + }{1-9,0}
52 | 	bspc {desktop -f,node -d} '^{1-9,10}'
53 | 
54 | super + ctrl + {h,j,k,l}
55 | 	bspc node -p {west,south,north,east}
56 | 
57 | super + ctrl + {1-9}
58 | 	bspc node -o 0.{1-9}
59 | 
60 | super + ctrl + space
61 | 	bspc node -p cancel
62 | 
63 | super + ctrl + shift + space
64 | 	bspc query -N -d | xargs -I id -n 1 bspc node id -p cancel
65 | 
66 | super + alt + {h,j,k,l}
67 | 	bspc node -z {left -20 0,bottom 0 20,top 0 -20,right 20 0}
68 | 
69 | super + alt + shift + {h,j,k,l}
70 | 	bspc node -z {right -20 0,top 0 20,bottom 0 -20,left 20 0}
71 | 
72 | super + {Left,Down,Up,Right}
73 | 	bspc node -v {-20 0,0 20,0 -20,20 0}
74 | 


--------------------------------------------------------------------------------
/openbsd/home/.cwmrc:
--------------------------------------------------------------------------------
 1 | # vim: set syntax=sh
 2 | gap         14 0 0 0
 3 | borderwidth 2
 4 | snapdist    5
 5 | 
 6 | fontname "-*-lime.se-*-*-*-*-10-*-*-*-*-*-*-*"
 7 | #fontname "yuki:size=7:antialias=false:hinting=full"
 8 | 
 9 | color activeborder   "#6f6f6f"
10 | color inactiveborder "#3f3f3f"
11 | color menubg         "#151515"
12 | color menufg         "#d7d0c7"
13 | color font           "#d7d0c7"
14 | color selfont        "#151515"
15 | 
16 | command term           "st -g 80x17"
17 | command "          st" "st -g 80x17"
18 | command "         vim" "st -c vim -T vim -g 94x44 -e nvim"
19 | command "        tmux" "st -g 85x31 -T tmux -e tmux atach-session"
20 | command "        chrm" chrome
21 | command "         tor" tor-browser
22 | command "        gimp" gimp
23 | command "        offc" libreoffice
24 | 
25 | # command "        acme" /home/jamppa/.bin/p9p/acme-start.sh
26 | 
27 | sticky     yes
28 | unbind-key all
29 | 
30 | bind-key 4-Return terminal
31 | bind-key 4-p      "/home/jamppa/bin/dmenu_custom"
32 | 
33 | bind-key 4-h window-move-left-big
34 | bind-key 4-j window-move-down-big
35 | bind-key 4-k window-move-up-big
36 | bind-key 4-l window-move-right-big
37 | 
38 | bind-key S4-h window-resize-left-big
39 | bind-key S4-j window-resize-down-big
40 | bind-key S4-k window-resize-up-big
41 | bind-key S4-l window-resize-right-big
42 | 
43 | bind-key 4-x  window-maximize
44 | bind-key 4-z  window-vmaximize
45 | bind-key S4-t window-htile
46 | bind-key 4-t  window-vtile
47 | 
48 | bind-key 4-f window-group
49 | bind-key 4-1 group-toggle-1
50 | bind-key 4-2 group-toggle-2
51 | bind-key 4-3 group-toggle-3
52 | bind-key 4-4 group-toggle-4
53 | bind-key 4-5 group-toggle-5
54 | bind-key 4-6 group-toggle-6
55 | bind-key 4-7 group-toggle-7
56 | bind-key 4-8 group-toggle-8
57 | 
58 | bind-key S4-1 window-movetogroup-1
59 | bind-key S4-2 window-movetogroup-2
60 | bind-key S4-3 window-movetogroup-3
61 | bind-key S4-4 window-movetogroup-4
62 | bind-key S4-5 window-movetogroup-5
63 | bind-key S4-6 window-movetogroup-6
64 | bind-key S4-7 window-movetogroup-7
65 | bind-key S4-8 window-movetogroup-8
66 | 
67 | bind-key 4-Tab  window-cycle
68 | bind-key S4-Tab window-rcycle
69 | 
70 | bind-key 4-c  window-hide
71 | bind-key S4-c window-delete
72 | 
73 | unbind-mouse M-1
74 | unbind-mouse M-2
75 | unbind-mouse M-3
76 | bind-mouse   4-1 window-move
77 | bind-mouse   4-2 window-lower
78 | bind-mouse   4-3 window-resize
79 | 
80 | bind-key 4-s  menu-window
81 | bind-key S4-r restart
82 | bind-key S4-q quit
83 | 
84 | 


--------------------------------------------------------------------------------
/openbsd/home/.kshrc:
--------------------------------------------------------------------------------
1 | . /etc/ksh.kshrc
2 | . /etc/ksh/colors
3 | . /etc/ksh/ksh_aliases
4 | . /etc/ksh/ksh_functions
5 | . /etc/ksh/git_prompt
6 | . /etc/ksh/ksh_prompt
7 | . /etc/ksh/ksh_env
8 | echo -ne "\033]0;${PWD}\007";
9 | 


--------------------------------------------------------------------------------
/openbsd/home/.math.xmodmap:
--------------------------------------------------------------------------------
 1 | ! alpha
 2 | keycode  38 = a A U03B1 U2200 U03B1 U2200
 3 | ! beta
 4 | keycode  56 = b B U03B2 U2211 U03B2 U2211
 5 | ! gamma
 6 | keycode  42 = g G U03B3 U0393 U03B3 U0393
 7 | ! delta
 8 | keycode  40 = d D U03B4 U0394 U03B4 U0394
 9 | ! epsilon / euler's number
10 | keycode  26 = e E  U03B5 U2147 U03B5 U2147
11 | ! lambda
12 | keycode  46 = l L U03BB U039B U03BB U039B 
13 | ! pi
14 | keycode  33 = p P U03C0 U220F U03C0 U220F
15 | ! mu / there doesn't exist
16 | keycode 58 = m M U03BC U2204 U03BC U2204
17 | ! sigma
18 | keycode 39 = s S U03C3 U03A3 U03C3 U03A3
19 | ! omega
20 | keycode 32 = o O U03C9 U03A9 U03C9 U03A9
21 | ! zeta, integers
22 | keycode 52 = z Z U03B6 U2124 U03B6 U2124
23 | ! rho / real numbers
24 | keycode 27 = r R U03C1 U211D U03C1 U211D
25 | ! imaginary numbers / iota
26 | keycode 31 = i I U2148 U03B9 U2148 U03B9
27 | 
28 | ! natural n / there exists
29 | keycode 57 = n N U2115 U2203 U2115 U2203
30 | ! square root, rational n
31 | keycode 24 = q Q U221A U211A U221A U211A
32 | ! complex n
33 | keycode 54 = c C U2102 U2102 U2102 U2102
34 | ! imaginary n
35 | keycode 44 = j J U2149 U2149 U2149 U2149
36 | 
37 | ! dot / ring operators
38 | keycode 51 = apostrophe asterisk U22C5 U2218 U22C5 U2218
39 | ! increment / unary sum operator
40 | keycode 61 = minus underscore U2206 U2211 U2206 U2211
41 | 
42 | ! member / subset
43 | keycode 59 = comma semicolon U220B U2283 U220B U2283
44 | ! element / superset
45 | keycode 60 = period colon U2208 U2282 U2208 U2282
46 | ! union / intersection
47 | keycode 30 = u U U222A U2229 U222A U2229
48 | 
49 | ! for all
50 | keycode 41 = f F U2200 U2200 U2200 U2200
51 | 
52 | ! arrows
53 | !keycode 102 = Right U2192 U21E8 U21FE U21E8
54 | !keycode 100 = Left U2190 U21E6 U21FD U21E6
55 | 


--------------------------------------------------------------------------------
/openbsd/home/.profile:
--------------------------------------------------------------------------------
 1 | PLAN9=/usr/local/plan9
 2 | PATH=$HOME/bin:$HOME/.bin:$HOME/.bin/p9p:/bin:/sbin:/usr/bin:/usr/sbin:/usr/X11R6/bin:/usr/local/bin:/usr/local/sbin:/usr/games:$PLAN9/bin:.
 3 | export PLAN9 PATH HOME
 4 | 
 5 | export font=/mnt/font/yuki/7/font
 6 | 
 7 | case `echo $0` in
 8 | 	*ksh)
 9 | 		export ENV=$HOME/.kshrc
10 | 		;;
11 | 	*dash)
12 | 		export ENV=$HOME/.dashrc
13 | 		;;
14 | 	*)
15 | 		;;
16 | esac
17 | 


--------------------------------------------------------------------------------
/openbsd/home/.tmux/.tmux.conf.lime:
--------------------------------------------------------------------------------
 1 | # bondage
 2 | unbind C-b
 3 | set-option -g prefix C-a
 4 | bind-key C-a send-prefix
 5 | 
 6 | bind -n M-Left select-pane -L
 7 | bind -n M-Right select-pane -R
 8 | bind -n M-Up select-pane -U
 9 | bind -n M-Down select-pane -D
10 | 
11 | bind C-p run "tmux set-buffer \"$(xclip -o)\"; tmux paste-buffer"
12 | bind C-y run "tmux show-buffer | xclip -selection clipboard"
13 | 
14 | bind r source-file ~/.tmux.conf
15 | bind s copy-mode
16 | bind a send-prefix
17 | 
18 | # misc init
19 | set -g default-terminal "screen-256color"
20 | set -g mouse on
21 | setw -gq utf8 on
22 | set -g base-index 1
23 | 
24 | # title of the year
25 | set-option -g set-titles on
26 | set-option -g set-titles-string "#S > #T > #W "
27 | 
28 | # bells and whistles
29 | set-option -g visual-activity off
30 | set-option -g visual-bell off
31 | set-option -g visual-silence off
32 | set-window-option -g monitor-activity off
33 | 
34 | # mode citizen
35 | setw -g mode-bg colour6
36 | setw -g mode-fg colour0
37 | setw -g clock-mode-colour colour6
38 | setw -g mode-attr bold
39 | setw -g mode-fg colour249
40 | setw -g mode-bg colour238
41 | 
42 | # oh, the pane... the pane of it all
43 | set -g pane-border-bg default
44 | set -g pane-border-fg colour236
45 | set -g pane-active-border-bg default
46 | set -g pane-active-border-fg colour240
47 | 
48 | # the patient' crashing. iv stat
49 | set -g status-fg colour6
50 | set -g status-bg colour234
51 | set -g status-interval 2
52 | set -g status-justify centre
53 | set -g status-position top
54 | set -g status-attr dim
55 | 
56 | set -g status-left '#[fg=colour234,bg=colour233]°±²'
57 | set -g status-right '#[fg=colour234,bg=colour233]²±°'
58 | 
59 | setw -g window-status-current-fg colour2
60 | setw -g window-status-current-bg colour238
61 | setw -g window-status-current-attr bold
62 | setw -g window-status-current-format '#[fg=colour238,bg=colour234]°±²#[fg=colour2,bg=colour238]#I#[fg=colour246]:#[fg=colour255]#W#[fg=colour238,bg=colour234]²±°'
63 | 
64 | setw -g window-status-fg colour6
65 | setw -g window-status-bg colour236
66 | setw -g window-status-attr none
67 | setw -g window-status-format '#[fg=colour236,bg=colour234]°±²#[fg=colour6,bg=colour236]#I#[fg=colour241]:#[fg=colour250]#W#[fg=colour236,bg=colour234]²±°'
68 | 
69 | # message of hope
70 | set -g message-attr bold
71 | set -g message-fg colour244
72 | set -g message-bg colour234
73 | set -g message-command-fg colour2
74 | set -g message-command-bg colour234
75 | 


--------------------------------------------------------------------------------
/openbsd/home/.tmux/.tmux.conf.scientifica:
--------------------------------------------------------------------------------
 1 | # bondage
 2 | unbind C-b
 3 | set-option -g prefix C-a
 4 | bind-key C-a send-prefix
 5 | 
 6 | bind -n M-Left select-pane -L
 7 | bind -n M-Right select-pane -R
 8 | bind -n M-Up select-pane -U
 9 | bind -n M-Down select-pane -D
10 | 
11 | bind C-p run "tmux set-buffer \"$(xclip -o)\"; tmux paste-buffer"
12 | bind C-y run "tmux show-buffer | xclip -selection clipboard"
13 | 
14 | bind r source-file ~/.tmux.conf
15 | bind s copy-mode
16 | bind a send-prefix
17 | 
18 | # misc init
19 | set -g mouse on
20 | setw -gq utf8 on
21 | set -g base-index 1
22 | 
23 | # title of the year
24 | set -g default-terminal "screen-256color"
25 | set-option -g set-titles on
26 | set-option -g set-titles-string "#S > #T > #W "
27 | 
28 | # bells and whistles
29 | set-option -g visual-activity off
30 | set-option -g visual-bell off
31 | set-option -g visual-silence off
32 | set-window-option -g monitor-activity off
33 | 
34 | # mode citizen
35 | setw -g mode-bg colour6
36 | setw -g mode-fg colour0
37 | setw -g clock-mode-colour colour6
38 | setw -g mode-attr bold
39 | setw -g mode-fg colour249
40 | setw -g mode-bg colour238
41 | 
42 | # oh, the pane... the pane of it all
43 | set -g pane-border-bg default
44 | set -g pane-border-fg colour236
45 | set -g pane-active-border-bg default
46 | set -g pane-active-border-fg colour240
47 | 
48 | # the patient' crashing. iv stat
49 | set -g status-fg colour6
50 | set -g status-bg colour234
51 | set -g status-interval 2
52 | set -g status-justify centre
53 | set -g status-position top
54 | set -g status-attr dim
55 | 
56 | set -g status-left '#[fg=colour234,bg=colour233]░▒▓'
57 | set -g status-right '#[fg=colour234,bg=colour233]▓▒░'
58 | 
59 | setw -g window-status-current-fg colour2
60 | setw -g window-status-current-bg colour238
61 | setw -g window-status-current-attr bold
62 | setw -g window-status-current-format '#[fg=colour238,bg=colour234]░▒▓#[fg=colour2,bg=colour238] #I#[fg=colour246]:#[fg=colour255]#W #[fg=colour238,bg=colour234]▓▒░'
63 | 
64 | setw -g window-status-fg colour6
65 | setw -g window-status-bg colour236
66 | setw -g window-status-attr none
67 | setw -g window-status-format '#[fg=colour236,bg=colour234]░▒▓#[fg=colour6,bg=colour236] #I#[fg=colour241]:#[fg=colour250]#W #[fg=colour236,bg=colour234]▓▒░'
68 | 
69 | # message of hope
70 | set -g message-attr bold
71 | set -g message-fg colour244
72 | set -g message-bg colour234
73 | set -g message-command-fg colour2
74 | set -g message-command-bg colour234
75 | 


--------------------------------------------------------------------------------
/openbsd/home/.tmux/.tmux.conf.ssh.lime:
--------------------------------------------------------------------------------
 1 | # vim: set syntax=tmux
 2 | unbind C-b
 3 | set-option -g prefix C-a
 4 | bind-key C-a send-prefix
 5 | bind r source-file ~/.tmux.conf
 6 | bind -n M-Left select-pane -L
 7 | bind -n M-Right select-pane -R
 8 | bind -n M-Up select-pane -U
 9 | bind -n M-Down select-pane -D
10 | bind s copy-mode
11 | 
12 | set -g default-terminal "screen-256color"
13 | set -g mouse on
14 | set -g base-index 1
15 | set-option -g allow-rename off
16 | 
17 | set-option -g visual-activity off
18 | set-option -g visual-bell off
19 | set-option -g visual-silence off
20 | set-window-option -g monitor-activity off
21 | 
22 | set -g pane-border-bg colour235
23 | set -g pane-border-fg colour238
24 | set -g pane-active-border-bg colour236
25 | set -g pane-active-border-fg colour255
26 | 
27 | set -g status on
28 | set -g status-bg default
29 | set -g status-position bottom
30 | set -g status-attr dim
31 | set -g status-left '#[fg=colour245,bg=colour233]#(echo `whoami`)#[fg=colour237]@#[fg=colour132]#H #[fg=colour240]#S #[fg=colour233,bg=colour234]²±°'
32 | set -g status-right '#[fg=colour233,bg=colour234]°±²#[fg=colour240,bg=colour233] #[fg=colour238]%H#[fg=colour237]:#[fg=colour238]%M #[fg=colour6]%a#[fg=colour240] %d %h #[fg=colour237]%Y'
33 | set -g status-right-length 50
34 | set -g status-left-length 50
35 | 
36 | set -g status-justify centre
37 | 
38 | set -g status-fg colour6
39 | set -g status-bg colour234
40 | 
41 | setw -g window-status-current-fg colour2
42 | setw -g window-status-current-bg colour238
43 | setw -g window-status-current-attr bold
44 | setw -g window-status-current-format '#[fg=colour238,bg=colour234]°±²#[fg=colour2,bg=colour238]#I#[fg=colour246]:#[fg=colour255]#W#[fg=colour238,bg=colour234]²±°'
45 | 
46 | setw -g window-status-fg colour6
47 | setw -g window-status-bg colour236
48 | setw -g window-status-attr none
49 | setw -g window-status-format '#[fg=colour236,bg=colour234]°±²#[fg=colour6,bg=colour236]#I#[fg=colour241]:#[fg=colour250]#W#[fg=colour236,bg=colour234]²±°'
50 | 


--------------------------------------------------------------------------------
/openbsd/home/.tmux/.tmux.conf.ssh.scientifica:
--------------------------------------------------------------------------------
 1 | unbind C-b
 2 | set-option -g prefix C-a
 3 | bind-key C-a send-prefix
 4 | bind r source-file ~/.tmux.conf
 5 | bind -n M-Left select-pane -L
 6 | bind -n M-Right select-pane -R
 7 | bind -n M-Up select-pane -U
 8 | bind -n M-Down select-pane -D
 9 | bind s copy-mode
10 | 
11 | set -g mouse on
12 | set -g base-index 1
13 | set-option -g allow-rename off
14 | 
15 | # loud or quiet?
16 | set-option -g visual-activity on
17 | set-option -g visual-bell on
18 | set-option -g visual-silence off
19 | set-window-option -g monitor-activity off
20 | #set-option -g bell-action other
21 | 
22 | set -g default-terminal "screen-256color"
23 | 
24 | # }
25 | # The panes {
26 | 
27 | set -g pane-border-bg colour235
28 | set -g pane-border-fg colour238
29 | set -g pane-active-border-bg colour236
30 | set -g pane-active-border-fg colour255
31 | 
32 | # }
33 | # The statusbar {
34 | 
35 | set -g status on
36 | set -g status-bg default
37 | set -g status-position bottom
38 | set -g status-attr dim
39 | set -g status-left '#[fg=colour245,bg=colour233]#(echo `whoami`)#[fg=colour237]@#[fg=colour132]#H #[fg=colour240]#S #[fg=colour233,bg=colour234]▓▒░'
40 | set -g status-right '#[fg=colour233,bg=colour234]░▒▓#[fg=colour240,bg=colour233] #[fg=colour238]%H#[fg=colour237]:#[fg=colour238]%M #[fg=colour6]%a#[fg=colour240] %d %h #[fg=colour237]%Y'
41 | set -g status-right-length 50
42 | set -g status-left-length 50
43 | 
44 | set -g status-justify centre
45 | 
46 | set -g status-fg colour6
47 | set -g status-bg colour234
48 | 
49 | setw -g window-status-current-fg colour2
50 | setw -g window-status-current-bg colour238
51 | setw -g window-status-current-attr bold
52 | setw -g window-status-current-format '#[fg=colour238,bg=colour234]░▒▓#[fg=colour2,bg=colour238] #I#[fg=colour246]:#[fg=colour255]#W #[fg=colour238,bg=colour234]▓▒░'
53 | 
54 | 
55 | 
56 | setw -g window-status-fg colour6
57 | setw -g window-status-bg colour236
58 | setw -g window-status-attr none
59 | setw -g window-status-format '#[fg=colour236,bg=colour234]░▒▓#[fg=colour6,bg=colour236] #I#[fg=colour241]:#[fg=colour250]#W #[fg=colour236,bg=colour234]▓▒░'
60 | 
61 | 


--------------------------------------------------------------------------------
/openbsd/home/.weechat/weechat.conf:
--------------------------------------------------------------------------------
  1 | #
  2 | # weechat -- weechat.conf
  3 | #
  4 | 
  5 | [debug]
  6 | 
  7 | [startup]
  8 | command_after_plugins = ""
  9 | command_before_plugins = ""
 10 | display_logo = on
 11 | display_version = on
 12 | sys_rlimit = ""
 13 | 
 14 | [look]
 15 | align_end_of_lines = message
 16 | bar_more_down = "++"
 17 | bar_more_left = "óó"
 18 | bar_more_right = "òò"
 19 | bar_more_up = "--"
 20 | bare_display_exit_on_input = on
 21 | bare_display_time_format = "%H:%M"
 22 | buffer_auto_renumber = on
 23 | buffer_notify_default = highlight
 24 | buffer_position = end
 25 | buffer_search_case_sensitive = off
 26 | buffer_search_force_default = off
 27 | buffer_search_regex = off
 28 | buffer_search_where = prefix_message
 29 | buffer_time_format = "${color:238}%H${color:241}%M"
 30 | color_basic_force_bold = off
 31 | color_inactive_buffer = off
 32 | color_inactive_message = on
 33 | color_inactive_prefix = on
 34 | color_inactive_prefix_buffer = off
 35 | color_inactive_time = off
 36 | color_inactive_window = off
 37 | color_nick_offline = off
 38 | color_pairs_auto_reset = 5
 39 | color_real_white = off
 40 | command_chars = ""
 41 | command_incomplete = off
 42 | confirm_quit = off
 43 | confirm_upgrade = off
 44 | day_change = on
 45 | day_change_message_1date = "-- %a, %d %b %Y --"
 46 | day_change_message_2dates = "-- %%a, %%d %%b %%Y (%a, %d %b %Y) --"
 47 | eat_newline_glitch = off
 48 | emphasized_attributes = ""
 49 | highlight = ""
 50 | highlight_regex = ""
 51 | highlight_tags = ""
 52 | hotlist_add_conditions = "${away} || ${buffer.num_displayed} == 2"
 53 | hotlist_buffer_separator = ","
 54 | hotlist_count_max = 0
 55 | hotlist_count_min_msg = 100
 56 | hotlist_names_count = 0
 57 | hotlist_names_length = 0
 58 | hotlist_names_level = 12
 59 | hotlist_names_merged_buffers = off
 60 | hotlist_prefix = ""
 61 | hotlist_remove = merged
 62 | hotlist_short_names = on
 63 | hotlist_sort = group_time_asc
 64 | hotlist_suffix = ""
 65 | hotlist_unique_numbers = on
 66 | input_cursor_scroll = 20
 67 | input_share = none
 68 | input_share_overwrite = off
 69 | input_undo_max = 32
 70 | item_away_message = on
 71 | item_buffer_filter = "*"
 72 | item_buffer_zoom = "!"
 73 | item_mouse_status = "M"
 74 | item_time_format = "%H:%M"
 75 | jump_current_to_previous_buffer = on
 76 | jump_previous_buffer_when_closing = on
 77 | jump_smart_back_to_buffer = on
 78 | key_bind_safe = on
 79 | key_grab_delay = 800
 80 | mouse = off
 81 | mouse_timer_delay = 100
 82 | nick_color_force = ""
 83 | nick_color_hash = djb2
 84 | nick_color_stop_chars = "_|["
 85 | nick_prefix = ""
 86 | nick_suffix = ""
 87 | paste_auto_add_newline = on
 88 | paste_bracketed = on
 89 | paste_bracketed_timer_delay = 10
 90 | paste_max_lines = 1
 91 | prefix_action = " û"
 92 | prefix_align = right
 93 | prefix_align_max = 30
 94 | prefix_align_min = 0
 95 | prefix_align_more = " "
 96 | prefix_align_more_after = on
 97 | prefix_buffer_align = right
 98 | prefix_buffer_align_max = 0
 99 | prefix_buffer_align_more = " "
100 | prefix_buffer_align_more_after = on
101 | prefix_error = "=!="
102 | prefix_join = "¯"
103 | prefix_network = "û"
104 | prefix_quit = "®"
105 | prefix_same_nick = " "
106 | prefix_suffix = ""
107 | quote_nick_prefix = "<"
108 | quote_nick_suffix = ">"
109 | quote_time_format = "%H:%M:%S"
110 | read_marker = line
111 | read_marker_always_show = off
112 | read_marker_string = "- "
113 | save_config_on_exit = on
114 | save_layout_on_exit = none
115 | scroll_amount = 3
116 | scroll_bottom_after_switch = off
117 | scroll_page_percent = 100
118 | search_text_not_found_alert = on
119 | separator_horizontal = "Í"
120 | separator_vertical = "º"
121 | tab_width = 1
122 | time_format = "%Y.%b.%d"
123 | window_auto_zoom = off
124 | window_separator_horizontal = on
125 | window_separator_vertical = on
126 | window_title = ""WeeChat ${info:version}"
127 | word_chars_highlight = "!\u00A0,-,_,|,alnum"
128 | word_chars_input = "!\u00A0,-,_,|,alnum"
129 | 
130 | [palette]
131 | 
132 | [color]
133 | bar_more = lightmagenta
134 | chat = default
135 | chat_bg = default
136 | chat_buffer = white
137 | chat_channel = white
138 | chat_day_change = cyan
139 | chat_delimiters = 243
140 | chat_highlight = default
141 | chat_highlight_bg = 236
142 | chat_host = 239
143 | chat_inactive_buffer = default
144 | chat_inactive_window = default
145 | chat_nick = lightcyan
146 | chat_nick_colors = "cyan,lightcyan,green,lightgreen,blue,lightblue,magenta,lightmagenta"
147 | chat_nick_offline = default
148 | chat_nick_offline_highlight = default
149 | chat_nick_offline_highlight_bg = blue
150 | chat_nick_other = cyan
151 | chat_nick_prefix = green
152 | chat_nick_self = white
153 | chat_nick_suffix = green
154 | chat_prefix_action = white
155 | chat_prefix_buffer = 238
156 | chat_prefix_buffer_inactive_buffer = default
157 | chat_prefix_error = yellow
158 | chat_prefix_join = lightgreen
159 | chat_prefix_more = lightmagenta
160 | chat_prefix_network = magenta
161 | chat_prefix_quit = lightred
162 | chat_prefix_suffix = green
163 | chat_read_marker = magenta
164 | chat_read_marker_bg = default
165 | chat_server = brown
166 | chat_tags = red
167 | chat_text_found = yellow
168 | chat_text_found_bg = lightmagenta
169 | chat_time = green
170 | chat_time_delimiters = brown
171 | chat_value = cyan
172 | chat_value_null = blue
173 | emphasized = yellow
174 | emphasized_bg = magenta
175 | input_actions = lightgreen
176 | input_text_not_found = red
177 | item_away = yellow
178 | nicklist_away = cyan
179 | nicklist_group = green
180 | separator = 236
181 | status_count_highlight = magenta
182 | status_count_msg = 69
183 | status_count_other = default
184 | status_count_private = green
185 | status_data_highlight = lightmagenta
186 | status_data_msg = 79
187 | status_data_other = default
188 | status_data_private = lightgreen
189 | status_filter = green
190 | status_more = 79
191 | status_mouse = green
192 | status_name = white
193 | status_name_ssl = lightgreen
194 | status_nicklist_count = default
195 | status_number = 238
196 | status_time = default
197 | 
198 | [completion]
199 | base_word_until_cursor = on
200 | command_inline = on
201 | default_template = "%(nicks)|%(irc_channels)"
202 | nick_add_space = on
203 | nick_completer = ":"
204 | nick_first_only = off
205 | nick_ignore_chars = "[]`_-^"
206 | partial_completion_alert = on
207 | partial_completion_command = off
208 | partial_completion_command_arg = off
209 | partial_completion_count = on
210 | partial_completion_other = off
211 | 
212 | [history]
213 | display_default = 5
214 | max_buffer_lines_minutes = 0
215 | max_buffer_lines_number = 4096
216 | max_commands = 100
217 | max_visited_buffers = 50
218 | 
219 | [proxy]
220 | 
221 | [network]
222 | connection_timeout = 60
223 | gnutls_ca_file = "/etc/ssl/certs/ca-certificates.crt"
224 | gnutls_handshake_timeout = 30
225 | proxy_curl = ""
226 | 
227 | [plugin]
228 | autoload = "*"
229 | debug = off
230 | extension = ".so,.dll"
231 | path = "%h/plugins"
232 | save_config_on_unload = on
233 | 
234 | [bar]
235 | buffers.color_bg = default
236 | buffers.color_delim = default
237 | buffers.color_fg = default
238 | buffers.conditions = ""
239 | buffers.filling_left_right = vertical
240 | buffers.filling_top_bottom = columns_vertical
241 | buffers.hidden = on
242 | buffers.items = "buffers"
243 | buffers.position = top
244 | buffers.priority = 0
245 | buffers.separator = on
246 | buffers.size = 0
247 | buffers.size_max = 0
248 | buffers.type = root
249 | input.color_bg = default
250 | input.color_delim = cyan
251 | input.color_fg = default
252 | input.conditions = ""
253 | input.filling_left_right = vertical
254 | input.filling_top_bottom = horizontal
255 | input.hidden = off
256 | input.items = ",buffer_name+(away),ð,[hotlist],[input_search],[input_paste],scroll,input_text"
257 | input.position = bottom
258 | input.priority = 1000
259 | input.separator = off
260 | input.size = 1
261 | input.size_max = 0
262 | input.type = window
263 | isetbar.color_bg = default
264 | isetbar.color_delim = cyan
265 | isetbar.color_fg = default
266 | isetbar.conditions = ""
267 | isetbar.filling_left_right = vertical
268 | isetbar.filling_top_bottom = horizontal
269 | isetbar.hidden = on
270 | isetbar.items = "isetbar_help"
271 | isetbar.position = top
272 | isetbar.priority = 0
273 | isetbar.separator = on
274 | isetbar.size = 3
275 | isetbar.size_max = 3
276 | isetbar.type = window
277 | nicklist.color_bg = default
278 | nicklist.color_delim = cyan
279 | nicklist.color_fg = default
280 | nicklist.conditions = "${nicklist}"
281 | nicklist.filling_left_right = vertical
282 | nicklist.filling_top_bottom = columns_vertical
283 | nicklist.hidden = on
284 | nicklist.items = "buffer_nicklist"
285 | nicklist.position = right
286 | nicklist.priority = 200
287 | nicklist.separator = on
288 | nicklist.size = 0
289 | nicklist.size_max = 0
290 | nicklist.type = window
291 | status.color_bg = default
292 | status.color_delim = cyan
293 | status.color_fg = default
294 | status.conditions = ""
295 | status.filling_left_right = vertical
296 | status.filling_top_bottom = horizontal
297 | status.hidden = on
298 | status.items = "[buffer_zoom],[hotlist],scroll"
299 | status.position = top
300 | status.priority = 500
301 | status.separator = off
302 | status.size = 1
303 | status.size_max = 0
304 | status.type = window
305 | title.color_bg = default
306 | title.color_delim = cyan
307 | title.color_fg = default
308 | title.conditions = ""
309 | title.filling_left_right = vertical
310 | title.filling_top_bottom = horizontal
311 | title.hidden = on
312 | title.items = "buffer_title"
313 | title.position = top
314 | title.priority = 500
315 | title.separator = off
316 | title.size = 1
317 | title.size_max = 0
318 | title.type = window
319 | 
320 | [layout]
321 | 
322 | [notify]
323 | 
324 | [filter]
325 | irc_smart = on;*;irc_smart_filter;*
326 | 
327 | [key]
328 | ctrl-? = "/input delete_previous_char"
329 | ctrl-A = "/input move_beginning_of_line"
330 | ctrl-B = "/input move_previous_char"
331 | ctrl-C_ = "/input insert \x1F"
332 | ctrl-Cb = "/input insert \x02"
333 | ctrl-Cc = "/input insert \x03"
334 | ctrl-Ci = "/input insert \x1D"
335 | ctrl-Co = "/input insert \x0F"
336 | ctrl-Cv = "/input insert \x16"
337 | ctrl-D = "/input delete_next_char"
338 | ctrl-E = "/input move_end_of_line"
339 | ctrl-F = "/input move_next_char"
340 | ctrl-H = "/input delete_previous_char"
341 | ctrl-I = "/input complete_next"
342 | ctrl-J = "/input return"
343 | ctrl-K = "/input delete_end_of_line"
344 | ctrl-L = "/window refresh"
345 | ctrl-M = "/input return"
346 | ctrl-N = "/buffer +1"
347 | ctrl-P = "/buffer -1"
348 | ctrl-R = "/input search_text_here"
349 | ctrl-Sctrl-U = "/input set_unread"
350 | ctrl-T = "/input transpose_chars"
351 | ctrl-U = "/input delete_beginning_of_line"
352 | ctrl-W = "/input delete_previous_word"
353 | ctrl-X = "/input switch_active_buffer"
354 | ctrl-Y = "/input clipboard_paste"
355 | meta-meta2-1~ = "/window scroll_top"
356 | meta-meta2-23~ = "/bar scroll nicklist * b"
357 | meta-meta2-24~ = "/bar scroll nicklist * e"
358 | meta-meta2-4~ = "/window scroll_bottom"
359 | meta-meta2-5~ = "/window scroll_up"
360 | meta-meta2-6~ = "/window scroll_down"
361 | meta-meta2-7~ = "/window scroll_top"
362 | meta-meta2-8~ = "/window scroll_bottom"
363 | meta-meta2-A = "/buffer -1"
364 | meta-meta2-B = "/buffer +1"
365 | meta-meta2-C = "/buffer +1"
366 | meta-meta2-D = "/buffer -1"
367 | meta-* = "/window bare"
368 | meta-+ = "/input grab_key_command"
369 | meta-- = "/filter toggle @"
370 | meta-/ = "/input jump_last_buffer_displayed"
371 | meta-0 = "/buffer *10"
372 | meta-1 = "/buffer *1"
373 | meta-2 = "/buffer *2"
374 | meta-3 = "/buffer *3"
375 | meta-4 = "/buffer *4"
376 | meta-5 = "/buffer *5"
377 | meta-6 = "/buffer *6"
378 | meta-7 = "/buffer *7"
379 | meta-8 = "/buffer *8"
380 | meta-9 = "/buffer *9"
381 | meta-< = "/input jump_previously_visited_buffer"
382 | meta-= = "/filter toggle"
383 | meta-> = "/input jump_next_visited_buffer"
384 | meta-OA = "/input history_global_previous"
385 | meta-OB = "/input history_global_next"
386 | meta-OC = "/input move_next_word"
387 | meta-OD = "/input move_previous_word"
388 | meta-OF = "/input move_end_of_line"
389 | meta-OH = "/input move_beginning_of_line"
390 | meta-Oa = "/input history_global_previous"
391 | meta-Ob = "/input history_global_next"
392 | meta-Oc = "/input move_next_word"
393 | meta-Od = "/input move_previous_word"
394 | meta2-15~ = "/buffer -1"
395 | meta2-17~ = "/buffer +1"
396 | meta2-18~ = "/window -1"
397 | meta2-19~ = "/window +1"
398 | meta2-1;3A = "/buffer -1"
399 | meta2-1;3B = "/buffer +1"
400 | meta2-1;3C = "/buffer +1"
401 | meta2-1;3D = "/buffer -1"
402 | meta2-1;3F = "/window scroll_bottom"
403 | meta2-1;3H = "/window scroll_top"
404 | meta2-1;5A = "/input history_global_previous"
405 | meta2-1;5B = "/input history_global_next"
406 | meta2-1;5C = "/input move_next_word"
407 | meta2-1;5D = "/input move_previous_word"
408 | meta2-1~ = "/input move_beginning_of_line"
409 | meta2-200~ = "/input paste_start"
410 | meta2-201~ = "/input paste_stop"
411 | meta2-20~ = "/bar scroll title * -30%"
412 | meta2-21~ = "/bar scroll title * +30%"
413 | meta2-23;3~ = "/bar scroll nicklist * b"
414 | meta2-23~ = "/bar scroll nicklist * -100%"
415 | meta2-24;3~ = "/bar scroll nicklist * e"
416 | meta2-24~ = "/bar scroll nicklist * +100%"
417 | meta2-3~ = "/input delete_next_char"
418 | meta2-4~ = "/input move_end_of_line"
419 | meta2-5;3~ = "/window scroll_up"
420 | meta2-5~ = "/window page_up"
421 | meta2-6;3~ = "/window scroll_down"
422 | meta2-6~ = "/window page_down"
423 | meta2-7~ = "/input move_beginning_of_line"
424 | meta2-8~ = "/input move_end_of_line"
425 | meta2-A = "/input history_previous"
426 | meta2-B = "/input history_next"
427 | meta2-C = "/input move_next_char"
428 | meta2-D = "/input move_previous_char"
429 | meta2-F = "/input move_end_of_line"
430 | meta2-G = "/window page_down"
431 | meta2-H = "/input move_beginning_of_line"
432 | meta2-I = "/window page_up"
433 | meta2-Z = "/input complete_previous"
434 | meta2-[E = "/buffer -1"
435 | meta-_ = "/input redo"
436 | meta-a = "/input jump_smart"
437 | meta-b = "/input move_previous_word"
438 | meta-d = "/input delete_next_word"
439 | meta-f = "/input move_next_word"
440 | meta-h = "/window left"
441 | meta-j = "/window down"
442 | meta-jmeta-f = "/buffer -"
443 | meta-jmeta-l = "/buffer +"
444 | meta-jmeta-r = "/server raw"
445 | meta-jmeta-s = "/server jump"
446 | meta-j01 = "/buffer *1"
447 | meta-j02 = "/buffer *2"
448 | meta-j03 = "/buffer *3"
449 | meta-j04 = "/buffer *4"
450 | meta-j05 = "/buffer *5"
451 | meta-j06 = "/buffer *6"
452 | meta-j07 = "/buffer *7"
453 | meta-j08 = "/buffer *8"
454 | meta-j09 = "/buffer *9"
455 | meta-j10 = "/buffer *10"
456 | meta-j11 = "/buffer *11"
457 | meta-j12 = "/buffer *12"
458 | meta-j13 = "/buffer *13"
459 | meta-j14 = "/buffer *14"
460 | meta-j15 = "/buffer *15"
461 | meta-j16 = "/buffer *16"
462 | meta-j17 = "/buffer *17"
463 | meta-j18 = "/buffer *18"
464 | meta-j19 = "/buffer *19"
465 | meta-j20 = "/buffer *20"
466 | meta-j21 = "/buffer *21"
467 | meta-j22 = "/buffer *22"
468 | meta-j23 = "/buffer *23"
469 | meta-j24 = "/buffer *24"
470 | meta-j25 = "/buffer *25"
471 | meta-j26 = "/buffer *26"
472 | meta-j27 = "/buffer *27"
473 | meta-j28 = "/buffer *28"
474 | meta-j29 = "/buffer *29"
475 | meta-j30 = "/buffer *30"
476 | meta-j31 = "/buffer *31"
477 | meta-j32 = "/buffer *32"
478 | meta-j33 = "/buffer *33"
479 | meta-j34 = "/buffer *34"
480 | meta-j35 = "/buffer *35"
481 | meta-j36 = "/buffer *36"
482 | meta-j37 = "/buffer *37"
483 | meta-j38 = "/buffer *38"
484 | meta-j39 = "/buffer *39"
485 | meta-j40 = "/buffer *40"
486 | meta-j41 = "/buffer *41"
487 | meta-j42 = "/buffer *42"
488 | meta-j43 = "/buffer *43"
489 | meta-j44 = "/buffer *44"
490 | meta-j45 = "/buffer *45"
491 | meta-j46 = "/buffer *46"
492 | meta-j47 = "/buffer *47"
493 | meta-j48 = "/buffer *48"
494 | meta-j49 = "/buffer *49"
495 | meta-j50 = "/buffer *50"
496 | meta-j51 = "/buffer *51"
497 | meta-j52 = "/buffer *52"
498 | meta-j53 = "/buffer *53"
499 | meta-j54 = "/buffer *54"
500 | meta-j55 = "/buffer *55"
501 | meta-j56 = "/buffer *56"
502 | meta-j57 = "/buffer *57"
503 | meta-j58 = "/buffer *58"
504 | meta-j59 = "/buffer *59"
505 | meta-j60 = "/buffer *60"
506 | meta-j61 = "/buffer *61"
507 | meta-j62 = "/buffer *62"
508 | meta-j63 = "/buffer *63"
509 | meta-j64 = "/buffer *64"
510 | meta-j65 = "/buffer *65"
511 | meta-j66 = "/buffer *66"
512 | meta-j67 = "/buffer *67"
513 | meta-j68 = "/buffer *68"
514 | meta-j69 = "/buffer *69"
515 | meta-j70 = "/buffer *70"
516 | meta-j71 = "/buffer *71"
517 | meta-j72 = "/buffer *72"
518 | meta-j73 = "/buffer *73"
519 | meta-j74 = "/buffer *74"
520 | meta-j75 = "/buffer *75"
521 | meta-j76 = "/buffer *76"
522 | meta-j77 = "/buffer *77"
523 | meta-j78 = "/buffer *78"
524 | meta-j79 = "/buffer *79"
525 | meta-j80 = "/buffer *80"
526 | meta-j81 = "/buffer *81"
527 | meta-j82 = "/buffer *82"
528 | meta-j83 = "/buffer *83"
529 | meta-j84 = "/buffer *84"
530 | meta-j85 = "/buffer *85"
531 | meta-j86 = "/buffer *86"
532 | meta-j87 = "/buffer *87"
533 | meta-j88 = "/buffer *88"
534 | meta-j89 = "/buffer *89"
535 | meta-j90 = "/buffer *90"
536 | meta-j91 = "/buffer *91"
537 | meta-j92 = "/buffer *92"
538 | meta-j93 = "/buffer *93"
539 | meta-j94 = "/buffer *94"
540 | meta-j95 = "/buffer *95"
541 | meta-j96 = "/buffer *96"
542 | meta-j97 = "/buffer *97"
543 | meta-j98 = "/buffer *98"
544 | meta-j99 = "/buffer *99"
545 | meta-k = "/window up"
546 | meta-l = "/window right"
547 | meta-m = "/mute mouse toggle"
548 | meta-n = "/window scroll_next_highlight"
549 | meta-p = "/window scroll_previous_highlight"
550 | meta-r = "/input delete_line"
551 | meta-s = "/mute aspell toggle"
552 | meta-u = "/window scroll_unread"
553 | meta-wmeta-meta2-A = "/window up"
554 | meta-wmeta-meta2-B = "/window down"
555 | meta-wmeta-meta2-C = "/window right"
556 | meta-wmeta-meta2-D = "/window left"
557 | meta-wmeta2-1;3A = "/window up"
558 | meta-wmeta2-1;3B = "/window down"
559 | meta-wmeta2-1;3C = "/window right"
560 | meta-wmeta2-1;3D = "/window left"
561 | meta-wmeta-b = "/window balance"
562 | meta-wmeta-s = "/window swap"
563 | meta-x = "/input zoom_merged_buffer"
564 | meta-z = "/window zoom"
565 | ctrl-_ = "/input undo"
566 | 
567 | [key_search]
568 | ctrl-I = "/input search_switch_where"
569 | ctrl-J = "/input search_stop_here"
570 | ctrl-M = "/input search_stop_here"
571 | ctrl-Q = "/input search_stop"
572 | ctrl-R = "/input search_switch_regex"
573 | meta2-A = "/input search_previous"
574 | meta2-B = "/input search_next"
575 | meta-c = "/input search_switch_case"
576 | 
577 | [key_cursor]
578 | ctrl-J = "/cursor stop"
579 | ctrl-M = "/cursor stop"
580 | meta-meta2-A = "/cursor move area_up"
581 | meta-meta2-B = "/cursor move area_down"
582 | meta-meta2-C = "/cursor move area_right"
583 | meta-meta2-D = "/cursor move area_left"
584 | meta2-1;3A = "/cursor move area_up"
585 | meta2-1;3B = "/cursor move area_down"
586 | meta2-1;3C = "/cursor move area_right"
587 | meta2-1;3D = "/cursor move area_left"
588 | meta2-A = "/cursor move up"
589 | meta2-B = "/cursor move down"
590 | meta2-C = "/cursor move right"
591 | meta2-D = "/cursor move left"
592 | @item(buffer_nicklist):K = "/window ${_window_number};/kickban ${nick}"
593 | @item(buffer_nicklist):b = "/window ${_window_number};/ban ${nick}"
594 | @item(buffer_nicklist):k = "/window ${_window_number};/kick ${nick}"
595 | @item(buffer_nicklist):q = "/window ${_window_number};/query ${nick};/cursor stop"
596 | @item(buffer_nicklist):w = "/window ${_window_number};/whois ${nick}"
597 | @chat:Q = "hsignal:chat_quote_time_prefix_message;/cursor stop"
598 | @chat:m = "hsignal:chat_quote_message;/cursor stop"
599 | @chat:q = "hsignal:chat_quote_prefix_message;/cursor stop"
600 | 
601 | [key_mouse]
602 | @bar(buffers):ctrl-wheeldown = "hsignal:buffers_mouse"
603 | @bar(buffers):ctrl-wheelup = "hsignal:buffers_mouse"
604 | @bar(input):button2 = "/input grab_mouse_area"
605 | @bar(nicklist):button1-gesture-down = "/bar scroll nicklist ${_window_number} +100%"
606 | @bar(nicklist):button1-gesture-down-long = "/bar scroll nicklist ${_window_number} e"
607 | @bar(nicklist):button1-gesture-up = "/bar scroll nicklist ${_window_number} -100%"
608 | @bar(nicklist):button1-gesture-up-long = "/bar scroll nicklist ${_window_number} b"
609 | @chat(perl.iset):button1 = "hsignal:iset_mouse"
610 | @chat(perl.iset):button2* = "hsignal:iset_mouse"
611 | @chat(perl.iset):wheeldown = "/repeat 5 /iset **down"
612 | @chat(perl.iset):wheelup = "/repeat 5 /iset **up"
613 | @chat(script.scripts):button1 = "/window ${_window_number};/script go ${_chat_line_y}"
614 | @chat(script.scripts):button2 = "/window ${_window_number};/script go ${_chat_line_y};/script installremove -q ${script_name_with_extension}"
615 | @chat(script.scripts):wheeldown = "/script down 5"
616 | @chat(script.scripts):wheelup = "/script up 5"
617 | @item(buffer_nicklist):button1 = "/window ${_window_number};/query ${nick}"
618 | @item(buffer_nicklist):button1-gesture-left = "/window ${_window_number};/kick ${nick}"
619 | @item(buffer_nicklist):button1-gesture-left-long = "/window ${_window_number};/kickban ${nick}"
620 | @item(buffer_nicklist):button2 = "/window ${_window_number};/whois ${nick}"
621 | @item(buffer_nicklist):button2-gesture-left = "/window ${_window_number};/ban ${nick}"
622 | @item(buffers):button1* = "hsignal:buffers_mouse"
623 | @item(buffers):button2* = "hsignal:buffers_mouse"
624 | @bar:wheeldown = "/bar scroll ${_bar_name} ${_window_number} +20%"
625 | @bar:wheelup = "/bar scroll ${_bar_name} ${_window_number} -20%"
626 | @chat:button1 = "/window ${_window_number}"
627 | @chat:button1-gesture-left = "/window ${_window_number};/buffer -1"
628 | @chat:button1-gesture-left-long = "/window ${_window_number};/buffer 1"
629 | @chat:button1-gesture-right = "/window ${_window_number};/buffer +1"
630 | @chat:button1-gesture-right-long = "/window ${_window_number};/input jump_last_buffer"
631 | @chat:ctrl-wheeldown = "/window scroll_horiz -window ${_window_number} +10%"
632 | @chat:ctrl-wheelup = "/window scroll_horiz -window ${_window_number} -10%"
633 | @chat:wheeldown = "/window scroll_down -window ${_window_number}"
634 | @chat:wheelup = "/window scroll_up -window ${_window_number}"
635 | @*:button3 = "/cursor go ${_x},${_y}"
636 | 


--------------------------------------------------------------------------------
/openbsd/home/.xinitrc:
--------------------------------------------------------------------------------
 1 | xrdb -merge $HOME/.Xresources &
 2 | xset -b &
 3 | xset +fp /home/jamppa/.fonts
 4 | xset +fp /usr/local/share/fonts
 5 | xset fp rehash &
 6 | 
 7 | setxkbmap -option ctrl:nocaps &
 8 | xmodmap -e 'keysym Menu = Super_L' &
 9 | xmodmap $HOME/.math.xmodmap &
10 | 
11 | xsetroot -cursor_name left_ptr &
12 | #wal -R
13 | $HOME/.fehbg &
14 | 
15 | cwm_panel &
16 | emacs --daemon &
17 | emacs-client &
18 | exec cwm
19 | 
20 | #exec i3
21 | #exec bspwm
22 | 
23 | ## wmutils stuff
24 | #$HOME/bin/wmutils/lpanel &
25 | #sxhkd &
26 | #while true; do
27 | #	wew | $HOME/bin/wmutils/yawee;
28 | #done
29 | 


--------------------------------------------------------------------------------
/openbsd/home/bin/cwm_panel:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | . cwm_panel_var
3 | FONT="-*-lime.se-*-*-*-*-10-*-*-*-*-*-*-*"
4 | ICON="-*-siji-*-*-*-*-10-*-*-*-*-*-*-*"
5 | ICON2="-*-tewi-medium-*-*-*-11-*-*-*-*-*-*-*"
6 | cwm_panel_bar | lemonbar -F "#FFFFFF" -B "#101010" -d \
7 |                          -f "$lfont" -f "$lfont2" -f "$lfont3" "$@"
8 | 


--------------------------------------------------------------------------------
/openbsd/home/bin/cwm_panel_bar:
--------------------------------------------------------------------------------
 1 | #!/usr/bin/env bash
 2 | #
 3 | # z3bra - (c) wtfpl 2014
 4 | # Fetch infos on your computer, and print them to stdout every second.
 5 | 
 6 | . cwm_panel_var
 7 | 
 8 | calendar() {
 9 | 	echo " `date '+%a %d/%m/%Y'`"
10 | }
11 | 
12 | clock() {
13 |     echo " `date '+%H:%M'`"
14 | }
15 | battStat() {
16 | 	battery=`apm -l`
17 | 	battcharge=`apm -a`
18 | 	if [ $battcharge -eq 1 ]; then
19 | 		echo " ${battery}%"
20 | 	elif [ $battery -eq 100 ]; then
21 | 		echo " ${battery}%"
22 | 	elif [ $battery -le 25 ]; then
23 | 		echo " ${battery}%"
24 | 	else
25 | 		echo " ${battery}%"
26 | 	fi
27 | }
28 | curWinTitle() {
29 | 	title=`xtitle $(pfw)`
30 | 		[ -z "$title" ] && echo "" \
31 | 		|| echo "${title} ${seprtrdefc}${lseparator}"
32 | }
33 | nowPlaying() {
34 | 	if [ "$(mpc current)" ]; then
35 | 		echo "$rseparator `mpc current | cut -c 1-50`"
36 | 	else
37 | 		echo ""
38 | 	fi  
39 | }
40 | cpuTemp() {
41 | 	_cpuTemp=`sysctl -n hw.sensors.cpu0.temp0 | awk '{ print $1 }'`
42 | 	echo " $_cpuTemp"
43 | }
44 | groupStat() {
45 | 	cur=`xprop -root _NET_CURRENT_DESKTOP | awk '{print $3}'`
46 | #	tot=`xprop -root _NET_NUMBER_OF_DESKTOPS | awk '{print $3}'`
47 | 	tot=8
48 | 
49 | 	for wid in `xprop -root | sed '/_LIST(WINDOW)/!d;s/.*# //;s/,//g'`; do
50 | 		if grep -q 'IsViewable' <<< $(xwininfo -id $wid); then
51 | 			grp=`xprop -id $wid _NET_WM_DESKTOP | awk '{print $3}'`
52 | 			shown="$shown $grp"
53 | 		fi
54 | 	done
55 | 
56 | 	for g in `seq 1 $((tot))`; do
57 | 		if test $g -eq $cur; then
58 | 			line="${line}${grpcur}"
59 | 		elif grep -q $g <<< "$shown"; then
60 | 			line="${line}${grpshown}"
61 | 		else
62 | 			line="${line}${grpavail}"
63 | 		fi
64 | 	done
65 | 
66 | 	echo $line
67 | }
68 | 
69 | while :; do
70 |  	buf=""
71 | 	buf="${buf}%{l}" #lemonbar align left
72 | 	buf="${buf}%{F#101010}$lseparator"
73 | 	buf="${buf}$(groupStat) ${seprtrdefc}$lseparator"
74 | 	buf="${buf} $cwintitle$(curWinTitle)"
75 | #	buf="${buf}%{c}" #lemonbar align center
76 | 	buf="${buf}%{r}" # lemonbar align right
77 | 	buf="${buf} %{F#4f4f4f}$(nowPlaying)"
78 | 	buf="${buf} %{F#666666}$rseparator$(cpuTemp)$degrees"
79 | 	buf="${buf} %{F#7f7f7f}$rseparator$(battStat)"
80 | 	buf="${buf} %{F#999999}$rseparator$(clock)"
81 | 	buf="${buf} %{F#bbbbbb}$rseparator$(calendar)"
82 | 	buf="${buf}%{F#101010}$rseparator"
83 | 
84 | 	echo $buf
85 | 	sleep 1
86 | done
87 | 


--------------------------------------------------------------------------------
/openbsd/home/bin/cwm_panel_var:
--------------------------------------------------------------------------------
 1 | lfont="-*-lime.se-*-*-*-*-10-*-*-*-*-*-*-*"
 2 | lfont2="-*-siji-*-*-*-*-10-*-*-*-*-*-*-*"
 3 | lfont3="-*-tewi-medium-*-*-*-11-*-*-*-*-*-*-*"
 4 | 
 5 | fgcolor="#FFFFFF"
 6 | bgcolor="#101010"
 7 | 
 8 | seprtrdefc="%{F#4f4f4f}"
 9 | lseparator=""
10 | rseparator=""
11 | degrees="%{T3}°%{T0}C"
12 | #extrabutton="㐆"
13 | 
14 | grpcur="%{F#BBBBBB}"
15 | grpshown="%{F#888888}"
16 | grpavail="%{F#333333}"
17 | 
18 | cwintitle="%{F#888888}"
19 | 


--------------------------------------------------------------------------------
/openbsd/home/bin/dmenu_custom:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | . "${HOME}/.cache/wal/colors.sh"
3 | #FONT="lime.se:size=8:antialias=false:hinting=full"
4 | FONT="scientifica:size=7"
5 | 
6 | dmenu_run -fn "$FONT" -nb "$color0" -nf "$color15"\
7 |           -sb "$color1" -sf "$color15" $@
8 | 


--------------------------------------------------------------------------------
/openbsd/home/lib/profile:
--------------------------------------------------------------------------------
 1 | plan9=/usr/local/plan9
 2 | 
 3 | _prompt='λΔ'
 4 | tab='	'
 5 | 
 6 | uid=`{id -u}
 7 | switch($uid) {
 8 | 	case 0
 9 | 		prompt=($_prompt'# ' $tab)
10 | 	case *
11 | 		prompt=($_prompt'% ' $tab)
12 | }
13 | 
14 | MANPAGER=nobs
15 | PAGER=nobs
16 | TERM=dumb
17 | 
18 | fn cd {
19 | 	builtin cd $1 &&
20 | 	awd
21 | }
22 | fn ls {
23 | 	builtin lc -F $*
24 | }
25 | fn ll {
26 | 	builtin lc -lsF $*
27 | }
28 | fn df {
29 | 	builtin df -h $*
30 | }
31 | fn ga {
32 | 	git add $*
33 | }
34 | fn gcm {
35 | 	git commit -m ''$*''
36 | }
37 | fn gpom {
38 | 	git push origin master
39 | }
40 | fn daim {
41 | 	doas make install
42 | }
43 | fn .. {
44 | 	cd ..
45 | }
46 | fn ... {
47 | 	cd ../..
48 | }
49 | fn .... {
50 | 	cd ../../..
51 | }
52 | fn pkga {
53 | 	doas pkg_add $*
54 | }
55 | 
56 | . $plan9/lib/acme.rc
57 | 


--------------------------------------------------------------------------------