dotfiles

Unnamed repository; edit this file 'description' to name the repository.
git clone git://edryd.org/dotfiles
Log | Files | Refs

commit d7ac6533c4c36ad2bf9fa341e7d75987ea44672f
parent 8dec7fdc1d50c1e6b9be9ba6c0412a35c322bc6f
Author: Ed van Bruggen <edvb54@gmail.com>
Date:   Fri, 10 Mar 2017 18:16:39 -0800

Move config.h to sl

Diffstat:
Makefile | 24+++++++++++++-----------
config.h/dmenu.config.h | 23-----------------------
config.h/dvtm.config.h | 214-------------------------------------------------------------------------------
config.h/dwm.config.h | 175-------------------------------------------------------------------------------
config.h/slock.config.h | 12------------
config.h/st.config.h | 431-------------------------------------------------------------------------------
config.h/tabbed.config.h | 66------------------------------------------------------------------
sl/dmenu.h | 23+++++++++++++++++++++++
sl/dvtm.h | 214+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
sl/dwm.h | 175+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
sl/slock.h | 12++++++++++++
sl/st.h | 468+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
sl/tabbed.h | 66++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
13 files changed, 971 insertions(+), 932 deletions(-)

diff --git a/Makefile b/Makefile @@ -1,6 +1,6 @@ CURDIR ?= $(.CURDIR) TARGET = ~/remote -TARGETCONH = ~/remote/code/downloads +TARGETSL = ~/code/downloads symlinks = bash_profile \ bashrc \ @@ -22,18 +22,20 @@ symlinks = bash_profile \ vimrc.bundles \ zshrc -confighlink = dmenu \ - tabbed \ - st +sllinks = dmenu \ + dwm \ + slock \ + st \ + tabbed all: @echo to install dotfiles to $(TARGET) run \'make install\' install-dotfiles: $(symlinks) -install-config.h: $(symlinks) +install-sl: $(sllinks) -install: $(symlinks) $(confighlink) +install: $(symlinks) $(sllinks) ln -fsn $(CURDIR)/bin $(TARGET)/bin $(symlinks): @@ -47,10 +49,10 @@ $(symlinks): fi ln -sn $(CURDIR)/$@ $(TARGET)/.$@ -$(confighlink): - @if [ -e $(TARGETCONH)/$@ ]; then \ - echo ln -fsn $(CURDIR)/config.h/$@.config.h $(TARGETCONH)/$@/config.h; \ - ln -fsn $(CURDIR)/config.h/$@.config.h $(TARGETCONH)/$@/config.h; \ +$(sllinks): + @if [ -e $(TARGETSL)/$@ ]; then \ + echo ln -fsn $(CURDIR)/sl/$@.h $(TARGETSL)/$@/config.h; \ + ln -fsn $(CURDIR)/sl/$@.h $(TARGETSL)/$@/config.h; \ fi -.PHONY: all install-dotfiles install-config.h install $(symlinks) $(confighlink) +.PHONY: all install-dotfiles install-sl install $(symlinks) $(sllinks) diff --git a/config.h/dmenu.config.h b/config.h/dmenu.config.h @@ -1,23 +0,0 @@ -/* See LICENSE file for copyright and license details. */ -/* Default settings; can be overriden by command line. */ - -static int topbar = 1; /* -b option; if 0, dmenu appears at bottom */ -/* -fn option overrides fonts[0]; default X11 font or font set */ -static const char *fonts[] = { - "FantasqueSansMono-Regular:pixelsize=18" -}; -static const char *prompt = NULL; /* -p option; prompt to the elft of input field */ -static const char *colors[SchemeLast][2] = { - /* fg bg */ - [SchemeNorm] = { "#EEE8D5", "#073642" }, - [SchemeSel] = { "#EEE8D5", "#B58900" }, - [SchemeOut] = { "#EEE8D5", "#CB4B16" }, -}; -/* -l option; if nonzero, dmenu uses vertical list with given number of lines */ -static unsigned int lines = 0; - -/* - * Characters not considered part of a word while deleting words - * for example: " /?\"&[]" - */ -static const char worddelimiters[] = " "; diff --git a/config.h/dvtm.config.h b/config.h/dvtm.config.h @@ -1,214 +0,0 @@ -/* valid curses attributes are listed below they can be ORed - * - * A_NORMAL Normal display (no highlight) - * A_STANDOUT Best highlighting mode of the terminal. - * A_UNDERLINE Underlining - * A_REVERSE Reverse video - * A_BLINK Blinking - * A_DIM Half bright - * A_BOLD Extra bright or bold - * A_PROTECT Protected mode - * A_INVIS Invisible or blank mode - */ - -enum { - DEFAULT, - BLUE, -}; - -static Color colors[] = { - [DEFAULT] = { .fg = -1, .bg = -1, .fg256 = -1, .bg256 = -1, }, - [BLUE] = { .fg = COLOR_BLUE, .bg = -1, .fg256 = 24, .bg256 = -1, }, -}; - -#define COLOR(c) COLOR_PAIR(colors[c].pair) -/* curses attributes for the currently focused window */ -#define SELECTED_ATTR (COLOR(BLUE) | A_NORMAL) -/* curses attributes for normal (not selected) windows */ -#define NORMAL_ATTR (COLOR(DEFAULT) | A_NORMAL) -/* curses attributes for a window with pending urgent flag */ -#define URGENT_ATTR NORMAL_ATTR -/* curses attributes for the status bar */ -#define BAR_ATTR (COLOR(BLUE) | A_NORMAL) -/* status bar (command line option -s) position */ -#define BAR_POS BAR_BOTTOM /* BAR_BOTTOM, BAR_OFF */ -/* whether status bar should be hidden if only one client exists */ -#define BAR_AUTOHIDE false -/* master width factor [0.1 .. 0.9] */ -#define MFACT 0.5 -/* number of clients in master area */ -#define NMASTER 1 -/* scroll back buffer size in lines */ -#define SCROLL_HISTORY 500 -/* printf format string for the tag in the status bar */ -#define TAG_SYMBOL "[%s]" -/* curses attributes for the currently selected tags */ -#define TAG_SEL (COLOR(BLUE) | A_BOLD) -/* curses attributes for not selected tags which contain no windows */ -#define TAG_NORMAL (COLOR(DEFAULT) | A_NORMAL) -/* curses attributes for not selected tags which contain windows */ -#define TAG_OCCUPIED (COLOR(BLUE) | A_NORMAL) -/* curses attributes for not selected tags which with urgent windows */ -#define TAG_URGENT (COLOR(BLUE) | A_NORMAL | A_BLINK) - -const char tags[][8] = { "1", "2", "3", "4", "5" }; - -#include "tile.c" -#include "grid.c" -#include "bstack.c" -#include "fullscreen.c" - -/* by default the first layout entry is used */ -static Layout layouts[] = { - { "[]=", tile }, - { "+++", grid }, - { "TTT", bstack }, - { "[ ]", fullscreen }, -}; - -#define MOD CTRL('g') - -/* you can at most specifiy MAX_ARGS (3) number of arguments */ -static KeyBinding bindings[] = { - { { MOD, 'c', }, { create, { NULL } } }, - { { MOD, 'C', }, { create, { NULL, NULL, "$CWD" } } }, - { { MOD, 'x', }, { killclient, { NULL } } }, - { { MOD, 'j', }, { focusnext, { NULL } } }, - { { MOD, 'J', }, { focusnextnm, { NULL } } }, - { { MOD, 'K', }, { focusprevnm, { NULL } } }, - { { MOD, 'k', }, { focusprev, { NULL } } }, - { { MOD, 'f', }, { setlayout, { "[]=" } } }, - { { MOD, 'g', }, { setlayout, { "+++" } } }, - { { MOD, 'b', }, { setlayout, { "TTT" } } }, - { { MOD, 'm', }, { setlayout, { "[ ]" } } }, - { { MOD, ' ', }, { setlayout, { NULL } } }, - { { MOD, 'i', }, { incnmaster, { "+1" } } }, - { { MOD, 'd', }, { incnmaster, { "-1" } } }, - { { MOD, 'h', }, { setmfact, { "-0.05" } } }, - { { MOD, 'l', }, { setmfact, { "+0.05" } } }, - { { MOD, '.', }, { toggleminimize, { NULL } } }, - { { MOD, 's', }, { togglebar, { NULL } } }, - { { MOD, 'S', }, { togglebarpos, { NULL } } }, - { { MOD, 'M', }, { togglemouse, { NULL } } }, - { { MOD, '\n', }, { zoom , { NULL } } }, - { { MOD, '\r', }, { zoom , { NULL } } }, - { { MOD, '\t', }, { focuslast, { NULL } } }, - { { MOD, 'q', }, { quit, { NULL } } }, - { { MOD, 'a', }, { togglerunall, { NULL } } }, - { { MOD, CTRL('L'), }, { redraw, { NULL } } }, - { { MOD, 'r', }, { redraw, { NULL } } }, - { { MOD, 'e', }, { copymode, { NULL } } }, - { { MOD, '/', }, { copymode, { "/" } } }, - { { MOD, 'p', }, { paste, { NULL } } }, - { { MOD, KEY_PPAGE, }, { scrollback, { "-1" } } }, - { { MOD, KEY_NPAGE, }, { scrollback, { "1" } } }, - { { MOD, '?', }, { create, { "man dvtm", "dvtm help" } } }, - { { MOD, MOD, }, { send, { (const char []){MOD, 0} } } }, - { { KEY_PPAGE, }, { scrollback, { "-1" } } }, - { { KEY_NPAGE, }, { scrollback, { "1" } } }, - { { MOD, '0', }, { view, { NULL } } }, - { { MOD, '1', }, { view, { tags[0] } } }, - { { MOD, '2', }, { view, { tags[1] } } }, - { { MOD, '3', }, { view, { tags[2] } } }, - { { MOD, '4', }, { view, { tags[3] } } }, - { { MOD, '5', }, { view, { tags[4] } } }, - { { MOD, 'v', '0' }, { view, { NULL } } }, - { { MOD, 'v', '1' }, { view, { tags[0] } } }, - { { MOD, 'v', '2' }, { view, { tags[1] } } }, - { { MOD, 'v', '3' }, { view, { tags[2] } } }, - { { MOD, 'v', '4' }, { view, { tags[3] } } }, - { { MOD, 'v', '5' }, { view, { tags[4] } } }, - { { MOD, 'v', '\t', }, { viewprevtag, { NULL } } }, - { { MOD, 't', '0' }, { tag, { NULL } } }, - { { MOD, 't', '1' }, { tag, { tags[0] } } }, - { { MOD, 't', '2' }, { tag, { tags[1] } } }, - { { MOD, 't', '3' }, { tag, { tags[2] } } }, - { { MOD, 't', '4' }, { tag, { tags[3] } } }, - { { MOD, 't', '5' }, { tag, { tags[4] } } }, - { { MOD, 'V', '1' }, { toggleview, { tags[0] } } }, - { { MOD, 'V', '2' }, { toggleview, { tags[1] } } }, - { { MOD, 'V', '3' }, { toggleview, { tags[2] } } }, - { { MOD, 'V', '4' }, { toggleview, { tags[3] } } }, - { { MOD, 'V', '5' }, { toggleview, { tags[4] } } }, - { { MOD, 'T', '1' }, { toggletag, { tags[0] } } }, - { { MOD, 'T', '2' }, { toggletag, { tags[1] } } }, - { { MOD, 'T', '3' }, { toggletag, { tags[2] } } }, - { { MOD, 'T', '4' }, { toggletag, { tags[3] } } }, - { { MOD, 'T', '5' }, { toggletag, { tags[4] } } }, -}; - -static const ColorRule colorrules[] = { - { "", A_NORMAL, &colors[DEFAULT] }, /* default */ -}; - -/* possible values for the mouse buttons are listed below: - * - * BUTTON1_PRESSED mouse button 1 down - * BUTTON1_RELEASED mouse button 1 up - * BUTTON1_CLICKED mouse button 1 clicked - * BUTTON1_DOUBLE_CLICKED mouse button 1 double clicked - * BUTTON1_TRIPLE_CLICKED mouse button 1 triple clicked - * BUTTON2_PRESSED mouse button 2 down - * BUTTON2_RELEASED mouse button 2 up - * BUTTON2_CLICKED mouse button 2 clicked - * BUTTON2_DOUBLE_CLICKED mouse button 2 double clicked - * BUTTON2_TRIPLE_CLICKED mouse button 2 triple clicked - * BUTTON3_PRESSED mouse button 3 down - * BUTTON3_RELEASED mouse button 3 up - * BUTTON3_CLICKED mouse button 3 clicked - * BUTTON3_DOUBLE_CLICKED mouse button 3 double clicked - * BUTTON3_TRIPLE_CLICKED mouse button 3 triple clicked - * BUTTON4_PRESSED mouse button 4 down - * BUTTON4_RELEASED mouse button 4 up - * BUTTON4_CLICKED mouse button 4 clicked - * BUTTON4_DOUBLE_CLICKED mouse button 4 double clicked - * BUTTON4_TRIPLE_CLICKED mouse button 4 triple clicked - * BUTTON_SHIFT shift was down during button state change - * BUTTON_CTRL control was down during button state change - * BUTTON_ALT alt was down during button state change - * ALL_MOUSE_EVENTS report all button state changes - * REPORT_MOUSE_POSITION report mouse movement - */ - -#ifdef NCURSES_MOUSE_VERSION -# define CONFIG_MOUSE /* compile in mouse support if we build against ncurses */ -#endif - -#define ENABLE_MOUSE true /* whether to enable mouse events by default */ - -#ifdef CONFIG_MOUSE -static Button buttons[] = { - { BUTTON1_CLICKED, { mouse_focus, { NULL } } }, - { BUTTON1_DOUBLE_CLICKED, { mouse_fullscreen, { "[ ]" } } }, - { BUTTON2_CLICKED, { mouse_zoom, { NULL } } }, - { BUTTON3_CLICKED, { mouse_minimize, { NULL } } }, -}; -#endif /* CONFIG_MOUSE */ - -static Cmd commands[] = { - { "create", { create, { NULL } } }, -}; - -/* gets executed when dvtm is started */ -static Action actions[] = { - { create, { NULL } }, -}; - -static char const * const keytable[] = { - /* add your custom key escape sequences */ -}; - -/* editor to use for copy mode. If neither of DVTM_EDITOR, EDITOR and PAGER is - * set the first entry is chosen. Otherwise the array is consulted for supported - * options. A %d in argv is replaced by the line number at which the file should - * be opened. If filter is true the editor is expected to work even if stdout is - * redirected (i.e. not a terminal). - */ -static Editor editors[] = { - { .name = "vis", .argv = { "vis", "+%d", "-", NULL }, .filter = true }, - { .name = "sandy", .argv = { "sandy", "-d", "-", NULL }, .filter = true }, - { .name = "dvtm-editor", .argv = { "dvtm-editor", "-", NULL }, .filter = true }, - { .name = "vim", .argv = { "vim", "+%d", "-", NULL }, .filter = false }, - { .name = "less", .argv = { "less", "+%d", NULL }, .filter = false }, - { .name = "more", .argv = { "more", "+%d", NULL }, .filter = false }, -}; diff --git a/config.h/dwm.config.h b/config.h/dwm.config.h @@ -1,175 +0,0 @@ -/* See LICENSE file for copyright and license details. */ - -/* appearance */ -static const char *fonts[] = { - "FantasqueSansMono-Regular:pixelsize=18" -}; -static const char dmenufont[] = "monospace:size=10"; -static const char normbordercolor[] = "#002b36"; -static const char normbgcolor[] = "#073642"; -static const char normfgcolor[] = "#93A1A1"; -static const char selbordercolor[] = "#268bd2"; -static const char selbgcolor[] = "#268bd2"; -static const char selfgcolor[] = "#eee8d5"; -static const char normmarkcolor[] = "#859900"; /*border color for marked client*/ -static const char selmarkcolor[] = "#2aa198"; /*border color for marked client on focus*/ -static const char urgbordercolor[] = "#dc322f"; -static const unsigned int borderpx = 1; /* border pixel of windows */ -static const unsigned int gappx = 6; /* gap pixel between windows */ -static const unsigned int snap = 32; /* snap pixel */ -static const unsigned int systraypinning = 0; /* 0: sloppy systray follows selected monitor, >0: pin systray to monitor X */ -static const unsigned int systrayspacing = 2; /* systray spacing */ -static const int systraypinningfailfirst = 1; /* 1: if pinning fails, display systray on the first monitor, 0: display systray on the last monitor*/ -static const int showsystray = 1; /* 0 means no systray */ -static const int showbar = 1; /* 0 means no bar */ -static const int topbar = 1; /* 0 means bottom bar */ - -/* tagging */ -static const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" }; - -static const Rule rules[] = { - /* class instance title tags mask isfloating monitor */ - { NULL, NULL, "bar", 0, 1, -1 }, -}; - -/* layout(s) */ -static const float mfact = 0.55; /* factor of master area size [0.05..0.95] */ -static const int nmaster = 1; /* number of clients in master area */ -static const int resizehints = 0; /* 1 means respect size hints in tiled resizals */ - -#include "htile.c" -#include "deck.c" -#include "centered.c" -#include "fibonacci.c" -#include "gaplessgrid.c" -#include "horizgrid.c" -#include "tcl.c" -static const Layout layouts[] = { - /* symbol arrange function */ - { "[]=", tile }, - { "><>", NULL }, /* floating */ - { "", htile }, - { "D ", deck }, - { "[o]", centered }, - { "[@]", spiral }, - { "[\\]", dwindle }, - { "###", gaplessgrid }, - { "###", horizgrid }, - { "|||", tcl }, - { "[M]", monocle }, -}; - -/* key definitions */ -#define MODKEY Mod4Mask -#define TAGKEYS(KEY,TAG) \ - { MODKEY, KEY, view, {.ui = 1 << TAG} }, \ - { MODKEY|ControlMask, KEY, toggleview, {.ui = 1 << TAG} }, \ - { MODKEY|ShiftMask, KEY, tag, {.ui = 1 << TAG} }, \ - { MODKEY|ControlMask|ShiftMask, KEY, toggletag, {.ui = 1 << TAG} }, - -/* helper for spawning shell commands in the pre dwm-5.0 fashion */ -#define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } } - -/* commands */ -static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn() */ -static const char *dmenucmd[] = { "menu.sh", NULL }; -static const char *termcmd[] = { "tabbed", "-c", "st", "-w", NULL }; -static const char *calcmd[] = { "gsimplecal", NULL }; - -#include "push.c" -#include "shiftview.c" -#include "switchcol.c" -#include "zoomswap.c" -static Key keys[] = { - /* modifier key function argument */ - { MODKEY, XK_z, spawn, {.v = dmenucmd } }, - { MODKEY, XK_t, spawn, {.v = termcmd } }, - { MODKEY, XK_b, togglebar, {0} }, - - { MODKEY, XK_l, focusstack, {.i = +1 } }, - { MODKEY, XK_h, focusstack, {.i = -1 } }, - { MODKEY|ShiftMask, XK_l, pushdown, {0} }, - { MODKEY|ShiftMask, XK_h, pushup, {0} }, - { MODKEY|Mod1Mask, XK_l, shiftview, {.i = +1 } }, - { MODKEY|Mod1Mask, XK_h, shiftview, {.i = -1 } }, - { MODKEY, XK_i, incnmaster, {.i = +1 } }, - { MODKEY, XK_d, incnmaster, {.i = -1 } }, - { MODKEY, XK_j, setmfact, {.f = -0.05} }, - { MODKEY, XK_k, setmfact, {.f = +0.05} }, - { MODKEY|ShiftMask, XK_j, setcfact, {.f = +0.25} }, - { MODKEY|ShiftMask, XK_k, setcfact, {.f = -0.25} }, - { MODKEY|ShiftMask, XK_o, setcfact, {.f = 0.00} }, - - { MODKEY, XK_Return, switchcol, {0} }, - { MODKEY|ShiftMask, XK_Return, zoomswap, {0} }, - { MODKEY, XK_Tab, view, {0} }, - { MODKEY|ShiftMask, XK_x, killclient, {0} }, - - { MODKEY, XK_semicolon,togglemark, {0} }, - { Mod1Mask, XK_Tab, swapfocus, {0} }, - { Mod1Mask|ShiftMask, XK_Tab, swapclient, {0} }, - - { MODKEY|ControlMask, XK_t, setlayout, {.v = &layouts[0]} }, - { MODKEY|ControlMask, XK_f, setlayout, {.v = &layouts[1]} }, - { MODKEY|ControlMask, XK_h, setlayout, {.v = &layouts[2]} }, - { MODKEY|ControlMask, XK_d, setlayout, {.v = &layouts[3]} }, - { MODKEY|ControlMask, XK_c, setlayout, {.v = &layouts[4]} }, - { MODKEY|ControlMask, XK_s, setlayout, {.v = &layouts[5]} }, - { MODKEY|ControlMask|ShiftMask, XK_s, setlayout, {.v = &layouts[6]} }, - { MODKEY|ControlMask, XK_g, setlayout, {.v = &layouts[7]} }, - { MODKEY|ControlMask|ShiftMask, XK_g, setlayout, {.v = &layouts[8]} }, - { MODKEY|ControlMask, XK_r, setlayout, {.v = &layouts[9]} }, - { MODKEY|ControlMask, XK_m, setlayout, {.v = &layouts[10]} }, - { MODKEY, XK_space, setlayout, {0} }, - - { Mod1Mask, XK_space, togglefloating, {0} }, - { MODKEY, XK_0, view, {.ui = ~0 } }, - { MODKEY|ShiftMask, XK_0, tag, {.ui = ~0 } }, - - { MODKEY, XK_comma, focusmon, {.i = -1 } }, - { MODKEY, XK_period, focusmon, {.i = +1 } }, - { MODKEY|ShiftMask, XK_comma, tagmon, {.i = -1 } }, - { MODKEY|ShiftMask, XK_period, tagmon, {.i = +1 } }, - TAGKEYS( XK_1, 0) - TAGKEYS( XK_2, 1) - TAGKEYS( XK_3, 2) - TAGKEYS( XK_4, 3) - TAGKEYS( XK_5, 4) - TAGKEYS( XK_6, 5) - TAGKEYS( XK_7, 6) - TAGKEYS( XK_8, 7) - TAGKEYS( XK_9, 8) - { MODKEY|ShiftMask, XK_q, quit, {0} }, -}; - -/* button definitions */ -/* click can be ClkLtSymbol, ClkStatusText, ClkWinTitle, ClkClientWin, or ClkRootWin */ -static Button buttons[] = { - /* click event mask button function argument */ - { ClkLtSymbol, 0, Button1, setlayout, {0} }, - { ClkLtSymbol, 0, Button3, setlayout, {.v = &layouts[2]} }, - { ClkWinTitle, 0, Button2, zoom, {0} }, - { ClkStatusText, 0, Button1, spawn, {.v = calcmd } }, - { ClkClientWin, Mod1Mask, Button1, movemouse, {0} }, - { ClkClientWin, MODKEY, Button2, togglefloating, {0} }, - { ClkClientWin, Mod1Mask, Button3, resizemouse, {0} }, - { ClkTagBar, 0, Button1, view, {0} }, - { ClkTagBar, 0, Button3, toggleview, {0} }, - { ClkTagBar, MODKEY, Button1, tag, {0} }, - { ClkTagBar, MODKEY, Button3, toggletag, {0} }, -}; - -#define NUMCOLORS 8 -static const char colors[NUMCOLORS][MAXCOLORS][8] = { - // border fg bg - { "#002b36", "#93A1A1", "#073642" }, // normal - { "#268bd2", "#eee8d5", "#268bd2" }, // selected - { "#002b36", "#b58900", "#073642" }, // yellow - { "#002b36", "#cb4b16", "#073642" }, // orange - { "#002b36", "#dc322f", "#073642" }, // red - { "#002b36", "#d33682", "#073642" }, // pink - { "#002b36", "#6c71c4", "#073642" }, // violet - /* { "#002b36", "#268bd2", "#073642" }, // blue */ - /* { "#002b36", "#2aa198", "#073642" }, // cyan */ - { "#002b36", "#859900", "#073642" } // green -}; diff --git a/config.h/slock.config.h b/config.h/slock.config.h @@ -1,12 +0,0 @@ -/* user and group to drop privileges to */ -static const char *user = "nobody"; -static const char *group = "nogroup"; - -static const char *colorname[NUMCOLS] = { - [INIT] = "#002b36", /* after initialization */ - [INPUT] = "#268bd2", /* during input */ - [FAILED] = "#dc322f", /* wrong password */ -}; - -/* treat a cleared input like a wrong password (color) */ -static const int failonclear = 0; diff --git a/config.h/st.config.h b/config.h/st.config.h @@ -1,431 +0,0 @@ -/* See LICENSE file for copyright and license details. */ - -/* - * appearance - * - * font: see http://freedesktop.org/software/fontconfig/fontconfig-user.html - */ -static char font[] = "FantasqueSansMono:pixelsize=18:antialias=false:autohint=false"; -static int borderpx = 2; -static int histsize = 2000; - -/* - * What program is execed by st depends of these precedence rules: - * 1: program passed with -e - * 2: utmp option - * 3: SHELL environment variable - * 4: value of shell in /etc/passwd - * 5: value of shell in config.h - */ -static char shell[] = "/bin/sh"; -static char *utmp = NULL; -static char stty_args[] = "stty raw pass8 nl -echo -iexten -cstopb 38400"; - -/* identification sequence returned in DA and DECID */ -static char vtiden[] = "\033[?6c"; - -/* Kerning / character bounding-box multipliers */ -static float cwscale = 1.0; -static float chscale = 1.0; - -/* - * word delimiter string - * - * More advanced example: " `'\"()[]{}" - */ -static char worddelimiters[] = " "; - -/* selection timeouts (in milliseconds) */ -static unsigned int doubleclicktimeout = 300; -static unsigned int tripleclicktimeout = 600; - -/* alt screens */ -static int allowaltscreen = 1; - -/* frames per second st should at maximum draw to the screen */ -static unsigned int xfps = 120; -static unsigned int actionfps = 30; - -/* - * blinking timeout (set to 0 to disable blinking) for the terminal blinking - * attribute. - */ -static unsigned int blinktimeout = 800; - -/* - * thickness of underline and bar cursors - */ -static unsigned int cursorthickness = 2; - -/* - * bell volume. It must be a value between -100 and 100. Use 0 for disabling - * it - */ -static int bellvolume = 0; - -/* default TERM value */ -static char termname[] = "st-256color"; - -static unsigned int tabspaces = 8; - -/* Terminal colors (16 first used in escape sequence) */ -static const char *colorname[] = { - /* solarized dark */ - "#073642", /* 0: black */ - "#dc322f", /* 1: red */ - "#859900", /* 2: green */ - "#b58900", /* 3: yellow */ - "#268bd2", /* 4: blue */ - "#d33682", /* 5: magenta */ - "#2aa198", /* 6: cyan */ - "#eee8d5", /* 7: white */ - "#002b36", /* 8: brblack */ - "#cb4b16", /* 9: brred */ - "#586e75", /* 10: brgreen */ - "#657b83", /* 11: bryellow */ - "#839496", /* 12: brblue */ - "#6c71c4", /* 13: brmagenta*/ - "#93a1a1", /* 14: brcyan */ - "#fdf6e3", /* 15: brwhite */ - - [255] = 0, - - /* more colors can be added after 255 to use with DefaultXX */ - "#cccccc", - "#555555", -}; - -/* bg opacity */ -static const int alpha = 0xdd; - -/* - * Default colors (colorname index) - * foreground, background, cursor, reverse cursor - */ -static unsigned int defaultfg = 12; -static unsigned int defaultbg = 8; -static unsigned int defaultcs = 14; -static unsigned int defaultrcs = 257; - -/* - * Default shape of cursor - * 2: Block ("█") - * 4: Underline ("_") - * 6: Bar ("|") - * 7: Snowman ("☃") - */ -static unsigned int cursorshape = 2; - -/* - * Default colour and shape of the mouse cursor - */ -static unsigned int mouseshape = XC_xterm; -static unsigned int mousefg = 7; -static unsigned int mousebg = 0; - -/* - * Colors used, when the specific fg == defaultfg. So in reverse mode this - * will reverse too. Another logic would only make the simple feature too - * complex. - */ -static unsigned int defaultitalic = 11; -static unsigned int defaultunderline = 7; - -/* - * Internal mouse shortcuts. - * Beware that overloading Button1 will disable the selection. - */ -static MouseShortcut mshortcuts[] = { - /* button mask string */ - { Button4, XK_ANY_MOD, "\031" }, - { Button5, XK_ANY_MOD, "\005" }, -}; - -/* Internal keyboard shortcuts. */ -#define MODKEY Mod1Mask - -static Shortcut shortcuts[] = { - /* mask keysym function argument */ - { XK_ANY_MOD, XK_Break, sendbreak, {.i = 0} }, - { ControlMask, XK_Print, toggleprinter, {.i = 0} }, - { ShiftMask, XK_Print, printscreen, {.i = 0} }, - { XK_ANY_MOD, XK_Print, printsel, {.i = 0} }, - { MODKEY|ShiftMask, XK_Prior, xzoom, {.f = +1} }, - { MODKEY|ShiftMask, XK_Next, xzoom, {.f = -1} }, - { MODKEY|ShiftMask, XK_Home, xzoomreset, {.f = 0} }, - { ShiftMask, XK_Insert, selpaste, {.i = 0} }, - { MODKEY|ShiftMask, XK_Insert, clippaste, {.i = 0} }, - { MODKEY|ShiftMask, XK_C, clipcopy, {.i = 0} }, - { MODKEY|ShiftMask, XK_V, clippaste, {.i = 0} }, - { MODKEY, XK_Num_Lock, numlock, {.i = 0} }, - { XK_ANY_MOD, XK_Page_Up, kscrollup, {.i = -1} }, - { XK_ANY_MOD, XK_Page_Down, kscrolldown, {.i = -1} }, -}; - -/* - * Special keys (change & recompile st.info accordingly) - * - * Mask value: - * * Use XK_ANY_MOD to match the key no matter modifiers state - * * Use XK_NO_MOD to match the key alone (no modifiers) - * appkey value: - * * 0: no value - * * > 0: keypad application mode enabled - * * = 2: term.numlock = 1 - * * < 0: keypad application mode disabled - * appcursor value: - * * 0: no value - * * > 0: cursor application mode enabled - * * < 0: cursor application mode disabled - * crlf value - * * 0: no value - * * > 0: crlf mode is enabled - * * < 0: crlf mode is disabled - * - * Be careful with the order of the definitions because st searches in - * this table sequentially, so any XK_ANY_MOD must be in the last - * position for a key. - */ - -/* - * If you want keys other than the X11 function keys (0xFD00 - 0xFFFF) - * to be mapped below, add them to this array. - */ -static KeySym mappedkeys[] = { -1 }; - -/* - * State bits to ignore when matching key or button events. By default, - * numlock (Mod2Mask) and keyboard layout (XK_SWITCH_MOD) are ignored. - */ -static uint ignoremod = Mod2Mask|XK_SWITCH_MOD; - -/* - * Override mouse-select while mask is active (when MODE_MOUSE is set). - * Note that if you want to use ShiftMask with selmasks, set this to an other - * modifier, set to 0 to not use it. - */ -static uint forceselmod = ShiftMask; - -/* - * This is the huge key array which defines all compatibility to the Linux - * world. Please decide about changes wisely. - */ -static Key key[] = { - /* keysym mask string appkey appcursor crlf */ - { XK_KP_Home, ShiftMask, "\033[2J", 0, -1, 0}, - { XK_KP_Home, ShiftMask, "\033[1;2H", 0, +1, 0}, - { XK_KP_Home, XK_ANY_MOD, "\033[H", 0, -1, 0}, - { XK_KP_Home, XK_ANY_MOD, "\033[1~", 0, +1, 0}, - { XK_KP_Up, XK_ANY_MOD, "\033Ox", +1, 0, 0}, - { XK_KP_Up, XK_ANY_MOD, "\033[A", 0, -1, 0}, - { XK_KP_Up, XK_ANY_MOD, "\033OA", 0, +1, 0}, - { XK_KP_Down, XK_ANY_MOD, "\033Or", +1, 0, 0}, - { XK_KP_Down, XK_ANY_MOD, "\033[B", 0, -1, 0}, - { XK_KP_Down, XK_ANY_MOD, "\033OB", 0, +1, 0}, - { XK_KP_Left, XK_ANY_MOD, "\033Ot", +1, 0, 0}, - { XK_KP_Left, XK_ANY_MOD, "\033[D", 0, -1, 0}, - { XK_KP_Left, XK_ANY_MOD, "\033OD", 0, +1, 0}, - { XK_KP_Right, XK_ANY_MOD, "\033Ov", +1, 0, 0}, - { XK_KP_Right, XK_ANY_MOD, "\033[C", 0, -1, 0}, - { XK_KP_Right, XK_ANY_MOD, "\033OC", 0, +1, 0}, - { XK_KP_Prior, ShiftMask, "\033[5;2~", 0, 0, 0}, - { XK_KP_Prior, XK_ANY_MOD, "\033[5~", 0, 0, 0}, - { XK_KP_Begin, XK_ANY_MOD, "\033[E", 0, 0, 0}, - { XK_KP_End, ControlMask, "\033[J", -1, 0, 0}, - { XK_KP_End, ControlMask, "\033[1;5F", +1, 0, 0}, - { XK_KP_End, ShiftMask, "\033[K", -1, 0, 0}, - { XK_KP_End, ShiftMask, "\033[1;2F", +1, 0, 0}, - { XK_KP_End, XK_ANY_MOD, "\033[4~", 0, 0, 0}, - { XK_KP_Next, ShiftMask, "\033[6;2~", 0, 0, 0}, - { XK_KP_Next, XK_ANY_MOD, "\033[6~", 0, 0, 0}, - { XK_KP_Insert, ShiftMask, "\033[2;2~", +1, 0, 0}, - { XK_KP_Insert, ShiftMask, "\033[4l", -1, 0, 0}, - { XK_KP_Insert, ControlMask, "\033[L", -1, 0, 0}, - { XK_KP_Insert, ControlMask, "\033[2;5~", +1, 0, 0}, - { XK_KP_Insert, XK_ANY_MOD, "\033[4h", -1, 0, 0}, - { XK_KP_Insert, XK_ANY_MOD, "\033[2~", +1, 0, 0}, - { XK_KP_Delete, ControlMask, "\033[M", -1, 0, 0}, - { XK_KP_Delete, ControlMask, "\033[3;5~", +1, 0, 0}, - { XK_KP_Delete, ShiftMask, "\033[2K", -1, 0, 0}, - { XK_KP_Delete, ShiftMask, "\033[3;2~", +1, 0, 0}, - { XK_KP_Delete, XK_ANY_MOD, "\033[P", -1, 0, 0}, - { XK_KP_Delete, XK_ANY_MOD, "\033[3~", +1, 0, 0}, - { XK_KP_Multiply, XK_ANY_MOD, "\033Oj", +2, 0, 0}, - { XK_KP_Add, XK_ANY_MOD, "\033Ok", +2, 0, 0}, - { XK_KP_Enter, XK_ANY_MOD, "\033OM", +2, 0, 0}, - { XK_KP_Enter, XK_ANY_MOD, "\r", -1, 0, -1}, - { XK_KP_Enter, XK_ANY_MOD, "\r\n", -1, 0, +1}, - { XK_KP_Subtract, XK_ANY_MOD, "\033Om", +2, 0, 0}, - { XK_KP_Decimal, XK_ANY_MOD, "\033On", +2, 0, 0}, - { XK_KP_Divide, XK_ANY_MOD, "\033Oo", +2, 0, 0}, - { XK_KP_0, XK_ANY_MOD, "\033Op", +2, 0, 0}, - { XK_KP_1, XK_ANY_MOD, "\033Oq", +2, 0, 0}, - { XK_KP_2, XK_ANY_MOD, "\033Or", +2, 0, 0}, - { XK_KP_3, XK_ANY_MOD, "\033Os", +2, 0, 0}, - { XK_KP_4, XK_ANY_MOD, "\033Ot", +2, 0, 0}, - { XK_KP_5, XK_ANY_MOD, "\033Ou", +2, 0, 0}, - { XK_KP_6, XK_ANY_MOD, "\033Ov", +2, 0, 0}, - { XK_KP_7, XK_ANY_MOD, "\033Ow", +2, 0, 0}, - { XK_KP_8, XK_ANY_MOD, "\033Ox", +2, 0, 0}, - { XK_KP_9, XK_ANY_MOD, "\033Oy", +2, 0, 0}, - { XK_Up, ShiftMask, "\033[1;2A", 0, 0, 0}, - { XK_Up, ControlMask, "\033[1;5A", 0, 0, 0}, - { XK_Up, Mod1Mask, "\033[1;3A", 0, 0, 0}, - { XK_Up, XK_ANY_MOD, "\033[A", 0, -1, 0}, - { XK_Up, XK_ANY_MOD, "\033OA", 0, +1, 0}, - { XK_Down, ShiftMask, "\033[1;2B", 0, 0, 0}, - { XK_Down, ControlMask, "\033[1;5B", 0, 0, 0}, - { XK_Down, Mod1Mask, "\033[1;3B", 0, 0, 0}, - { XK_Down, XK_ANY_MOD, "\033[B", 0, -1, 0}, - { XK_Down, XK_ANY_MOD, "\033OB", 0, +1, 0}, - { XK_Left, ShiftMask, "\033[1;2D", 0, 0, 0}, - { XK_Left, ControlMask, "\033[1;5D", 0, 0, 0}, - { XK_Left, Mod1Mask, "\033[1;3D", 0, 0, 0}, - { XK_Left, XK_ANY_MOD, "\033[D", 0, -1, 0}, - { XK_Left, XK_ANY_MOD, "\033OD", 0, +1, 0}, - { XK_Right, ShiftMask, "\033[1;2C", 0, 0, 0}, - { XK_Right, ControlMask, "\033[1;5C", 0, 0, 0}, - { XK_Right, Mod1Mask, "\033[1;3C", 0, 0, 0}, - { XK_Right, XK_ANY_MOD, "\033[C", 0, -1, 0}, - { XK_Right, XK_ANY_MOD, "\033OC", 0, +1, 0}, - { XK_ISO_Left_Tab, ShiftMask, "\033[Z", 0, 0, 0}, - { XK_Return, Mod1Mask, "\033\r", 0, 0, -1}, - { XK_Return, Mod1Mask, "\033\r\n", 0, 0, +1}, - { XK_Return, XK_ANY_MOD, "\r", 0, 0, -1}, - { XK_Return, XK_ANY_MOD, "\r\n", 0, 0, +1}, - { XK_Insert, ShiftMask, "\033[4l", -1, 0, 0}, - { XK_Insert, ShiftMask, "\033[2;2~", +1, 0, 0}, - { XK_Insert, ControlMask, "\033[L", -1, 0, 0}, - { XK_Insert, ControlMask, "\033[2;5~", +1, 0, 0}, - { XK_Insert, XK_ANY_MOD, "\033[4h", -1, 0, 0}, - { XK_Insert, XK_ANY_MOD, "\033[2~", +1, 0, 0}, - { XK_Delete, ControlMask, "\033[M", -1, 0, 0}, - { XK_Delete, ControlMask, "\033[3;5~", +1, 0, 0}, - { XK_Delete, ShiftMask, "\033[2K", -1, 0, 0}, - { XK_Delete, ShiftMask, "\033[3;2~", +1, 0, 0}, - { XK_Delete, XK_ANY_MOD, "\033[P", -1, 0, 0}, - { XK_Delete, XK_ANY_MOD, "\033[3~", +1, 0, 0}, - { XK_BackSpace, XK_NO_MOD, "\177", 0, 0, 0}, - { XK_Home, ShiftMask, "\033[2J", 0, -1, 0}, - { XK_Home, ShiftMask, "\033[1;2H", 0, +1, 0}, - { XK_Home, XK_ANY_MOD, "\033[H", 0, -1, 0}, - { XK_Home, XK_ANY_MOD, "\033[1~", 0, +1, 0}, - { XK_End, ControlMask, "\033[J", -1, 0, 0}, - { XK_End, ControlMask, "\033[1;5F", +1, 0, 0}, - { XK_End, ShiftMask, "\033[K", -1, 0, 0}, - { XK_End, ShiftMask, "\033[1;2F", +1, 0, 0}, - { XK_End, XK_ANY_MOD, "\033[4~", 0, 0, 0}, - { XK_Prior, ControlMask, "\033[5;5~", 0, 0, 0}, - { XK_Prior, ShiftMask, "\033[5;2~", 0, 0, 0}, - { XK_Prior, XK_ANY_MOD, "\033[5~", 0, 0, 0}, - { XK_Next, ControlMask, "\033[6;5~", 0, 0, 0}, - { XK_Next, ShiftMask, "\033[6;2~", 0, 0, 0}, - { XK_Next, XK_ANY_MOD, "\033[6~", 0, 0, 0}, - { XK_F1, XK_NO_MOD, "\033OP" , 0, 0, 0}, - { XK_F1, /* F13 */ ShiftMask, "\033[1;2P", 0, 0, 0}, - { XK_F1, /* F25 */ ControlMask, "\033[1;5P", 0, 0, 0}, - { XK_F1, /* F37 */ Mod4Mask, "\033[1;6P", 0, 0, 0}, - { XK_F1, /* F49 */ Mod1Mask, "\033[1;3P", 0, 0, 0}, - { XK_F1, /* F61 */ Mod3Mask, "\033[1;4P", 0, 0, 0}, - { XK_F2, XK_NO_MOD, "\033OQ" , 0, 0, 0}, - { XK_F2, /* F14 */ ShiftMask, "\033[1;2Q", 0, 0, 0}, - { XK_F2, /* F26 */ ControlMask, "\033[1;5Q", 0, 0, 0}, - { XK_F2, /* F38 */ Mod4Mask, "\033[1;6Q", 0, 0, 0}, - { XK_F2, /* F50 */ Mod1Mask, "\033[1;3Q", 0, 0, 0}, - { XK_F2, /* F62 */ Mod3Mask, "\033[1;4Q", 0, 0, 0}, - { XK_F3, XK_NO_MOD, "\033OR" , 0, 0, 0}, - { XK_F3, /* F15 */ ShiftMask, "\033[1;2R", 0, 0, 0}, - { XK_F3, /* F27 */ ControlMask, "\033[1;5R", 0, 0, 0}, - { XK_F3, /* F39 */ Mod4Mask, "\033[1;6R", 0, 0, 0}, - { XK_F3, /* F51 */ Mod1Mask, "\033[1;3R", 0, 0, 0}, - { XK_F3, /* F63 */ Mod3Mask, "\033[1;4R", 0, 0, 0}, - { XK_F4, XK_NO_MOD, "\033OS" , 0, 0, 0}, - { XK_F4, /* F16 */ ShiftMask, "\033[1;2S", 0, 0, 0}, - { XK_F4, /* F28 */ ControlMask, "\033[1;5S", 0, 0, 0}, - { XK_F4, /* F40 */ Mod4Mask, "\033[1;6S", 0, 0, 0}, - { XK_F4, /* F52 */ Mod1Mask, "\033[1;3S", 0, 0, 0}, - { XK_F5, XK_NO_MOD, "\033[15~", 0, 0, 0}, - { XK_F5, /* F17 */ ShiftMask, "\033[15;2~", 0, 0, 0}, - { XK_F5, /* F29 */ ControlMask, "\033[15;5~", 0, 0, 0}, - { XK_F5, /* F41 */ Mod4Mask, "\033[15;6~", 0, 0, 0}, - { XK_F5, /* F53 */ Mod1Mask, "\033[15;3~", 0, 0, 0}, - { XK_F6, XK_NO_MOD, "\033[17~", 0, 0, 0}, - { XK_F6, /* F18 */ ShiftMask, "\033[17;2~", 0, 0, 0}, - { XK_F6, /* F30 */ ControlMask, "\033[17;5~", 0, 0, 0}, - { XK_F6, /* F42 */ Mod4Mask, "\033[17;6~", 0, 0, 0}, - { XK_F6, /* F54 */ Mod1Mask, "\033[17;3~", 0, 0, 0}, - { XK_F7, XK_NO_MOD, "\033[18~", 0, 0, 0}, - { XK_F7, /* F19 */ ShiftMask, "\033[18;2~", 0, 0, 0}, - { XK_F7, /* F31 */ ControlMask, "\033[18;5~", 0, 0, 0}, - { XK_F7, /* F43 */ Mod4Mask, "\033[18;6~", 0, 0, 0}, - { XK_F7, /* F55 */ Mod1Mask, "\033[18;3~", 0, 0, 0}, - { XK_F8, XK_NO_MOD, "\033[19~", 0, 0, 0}, - { XK_F8, /* F20 */ ShiftMask, "\033[19;2~", 0, 0, 0}, - { XK_F8, /* F32 */ ControlMask, "\033[19;5~", 0, 0, 0}, - { XK_F8, /* F44 */ Mod4Mask, "\033[19;6~", 0, 0, 0}, - { XK_F8, /* F56 */ Mod1Mask, "\033[19;3~", 0, 0, 0}, - { XK_F9, XK_NO_MOD, "\033[20~", 0, 0, 0}, - { XK_F9, /* F21 */ ShiftMask, "\033[20;2~", 0, 0, 0}, - { XK_F9, /* F33 */ ControlMask, "\033[20;5~", 0, 0, 0}, - { XK_F9, /* F45 */ Mod4Mask, "\033[20;6~", 0, 0, 0}, - { XK_F9, /* F57 */ Mod1Mask, "\033[20;3~", 0, 0, 0}, - { XK_F10, XK_NO_MOD, "\033[21~", 0, 0, 0}, - { XK_F10, /* F22 */ ShiftMask, "\033[21;2~", 0, 0, 0}, - { XK_F10, /* F34 */ ControlMask, "\033[21;5~", 0, 0, 0}, - { XK_F10, /* F46 */ Mod4Mask, "\033[21;6~", 0, 0, 0}, - { XK_F10, /* F58 */ Mod1Mask, "\033[21;3~", 0, 0, 0}, - { XK_F11, XK_NO_MOD, "\033[23~", 0, 0, 0}, - { XK_F11, /* F23 */ ShiftMask, "\033[23;2~", 0, 0, 0}, - { XK_F11, /* F35 */ ControlMask, "\033[23;5~", 0, 0, 0}, - { XK_F11, /* F47 */ Mod4Mask, "\033[23;6~", 0, 0, 0}, - { XK_F11, /* F59 */ Mod1Mask, "\033[23;3~", 0, 0, 0}, - { XK_F12, XK_NO_MOD, "\033[24~", 0, 0, 0}, - { XK_F12, /* F24 */ ShiftMask, "\033[24;2~", 0, 0, 0}, - { XK_F12, /* F36 */ ControlMask, "\033[24;5~", 0, 0, 0}, - { XK_F12, /* F48 */ Mod4Mask, "\033[24;6~", 0, 0, 0}, - { XK_F12, /* F60 */ Mod1Mask, "\033[24;3~", 0, 0, 0}, - { XK_F13, XK_NO_MOD, "\033[1;2P", 0, 0, 0}, - { XK_F14, XK_NO_MOD, "\033[1;2Q", 0, 0, 0}, - { XK_F15, XK_NO_MOD, "\033[1;2R", 0, 0, 0}, - { XK_F16, XK_NO_MOD, "\033[1;2S", 0, 0, 0}, - { XK_F17, XK_NO_MOD, "\033[15;2~", 0, 0, 0}, - { XK_F18, XK_NO_MOD, "\033[17;2~", 0, 0, 0}, - { XK_F19, XK_NO_MOD, "\033[18;2~", 0, 0, 0}, - { XK_F20, XK_NO_MOD, "\033[19;2~", 0, 0, 0}, - { XK_F21, XK_NO_MOD, "\033[20;2~", 0, 0, 0}, - { XK_F22, XK_NO_MOD, "\033[21;2~", 0, 0, 0}, - { XK_F23, XK_NO_MOD, "\033[23;2~", 0, 0, 0}, - { XK_F24, XK_NO_MOD, "\033[24;2~", 0, 0, 0}, - { XK_F25, XK_NO_MOD, "\033[1;5P", 0, 0, 0}, - { XK_F26, XK_NO_MOD, "\033[1;5Q", 0, 0, 0}, - { XK_F27, XK_NO_MOD, "\033[1;5R", 0, 0, 0}, - { XK_F28, XK_NO_MOD, "\033[1;5S", 0, 0, 0}, - { XK_F29, XK_NO_MOD, "\033[15;5~", 0, 0, 0}, - { XK_F30, XK_NO_MOD, "\033[17;5~", 0, 0, 0}, - { XK_F31, XK_NO_MOD, "\033[18;5~", 0, 0, 0}, - { XK_F32, XK_NO_MOD, "\033[19;5~", 0, 0, 0}, - { XK_F33, XK_NO_MOD, "\033[20;5~", 0, 0, 0}, - { XK_F34, XK_NO_MOD, "\033[21;5~", 0, 0, 0}, - { XK_F35, XK_NO_MOD, "\033[23;5~", 0, 0, 0}, -}; - -/* - * Selection types' masks. - * Use the same masks as usual. - * Button1Mask is always unset, to make masks match between ButtonPress. - * ButtonRelease and MotionNotify. - * If no match is found, regular selection is used. - */ -static uint selmasks[] = { - [SEL_RECTANGULAR] = Mod1Mask, -}; - -/* - * Printable characters in ASCII, used to estimate the advance width - * of single wide characters. - */ -static char ascii_printable[] = - " !\"#$%&'()*+,-./0123456789:;<=>?" - "@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_" - "`abcdefghijklmnopqrstuvwxyz{|}~"; - diff --git a/config.h/tabbed.config.h b/config.h/tabbed.config.h @@ -1,66 +0,0 @@ -/* See LICENSE file for copyright and license details. */ - -/* appearance */ -static const char font[] = "FantasqueSansMono:pixelsize=18:antialias=false:autohint=false"; -static const char* normbgcolor = "#073642"; -static const char* normfgcolor = "#657B83"; -static const char* selbgcolor = "#EEE8D5"; -static const char* selfgcolor = "#657B83"; -static const char* urgbgcolor = "#B58900"; -static const char* urgfgcolor = "#657B83"; -static const char before[] = "<"; -static const char after[] = ">"; -static const char titletrim[] = "..."; -static const int tabwidth = 125; -static const Bool foreground = True; -static Bool urgentswitch = False; - -/* - * Where to place a new tab when it is opened. When npisrelative is True, - * then the current position is changed + newposition. If npisrelative - * is False, then newposition is an absolute position. - */ -static int newposition = 1; -static Bool npisrelative = True; - -#define SETPROP(p) { \ - .v = (char *[]){ "/bin/sh", "-c", \ - "prop=\"`xwininfo -children -id $1 | grep '^ 0x' |" \ - "sed -e's@^ *\\(0x[0-9a-f]*\\) \"\\([^\"]*\\)\".*@\\1 \\2@' |" \ - "xargs -0 printf %b | dmenu -i -c -l 10`\" &&" \ - "xprop -id $1 -f $0 8s -set $0 \"$prop\"", \ - p, winid, NULL \ - } \ -} - -#define MODKEY ControlMask -static Key keys[] = { - /* modifier key function argument */ - { MODKEY|ShiftMask, XK_Return, focusonce, { 0 } }, - { MODKEY|ShiftMask, XK_Return, spawn, { 0 } }, - { MODKEY|ShiftMask, XK_t, spawn, SETPROP("_TABBED_SELECT_TAB") }, - - { MODKEY|ShiftMask, XK_l, rotate, { .i = +1 } }, - { MODKEY|ShiftMask, XK_h, rotate, { .i = -1 } }, - { MODKEY|ShiftMask, XK_j, movetab, { .i = -1 } }, - { MODKEY|ShiftMask, XK_k, movetab, { .i = +1 } }, - { MODKEY, XK_Tab, rotate, { .i = 0 } }, - - { MODKEY, XK_1, move, { .i = 0 } }, - { MODKEY, XK_2, move, { .i = 1 } }, - { MODKEY, XK_3, move, { .i = 2 } }, - { MODKEY, XK_4, move, { .i = 3 } }, - { MODKEY, XK_5, move, { .i = 4 } }, - { MODKEY, XK_6, move, { .i = 5 } }, - { MODKEY, XK_7, move, { .i = 6 } }, - { MODKEY, XK_8, move, { .i = 7 } }, - { MODKEY, XK_9, move, { .i = 8 } }, - { MODKEY, XK_0, move, { .i = 9 } }, - - { MODKEY|ShiftMask, XK_q, killclient, { 0 } }, - - { MODKEY|ShiftMask, XK_u, focusurgent, { 0 } }, - { MODKEY|Mod1Mask, XK_u, toggle, { .v = (void*) &urgentswitch } }, - - { 0, XK_F11, fullscreen, { 0 } }, -}; diff --git a/sl/dmenu.h b/sl/dmenu.h @@ -0,0 +1,23 @@ +/* See LICENSE file for copyright and license details. */ +/* Default settings; can be overriden by command line. */ + +static int topbar = 1; /* -b option; if 0, dmenu appears at bottom */ +/* -fn option overrides fonts[0]; default X11 font or font set */ +static const char *fonts[] = { + "FantasqueSansMono-Regular:pixelsize=18" +}; +static const char *prompt = NULL; /* -p option; prompt to the elft of input field */ +static const char *colors[SchemeLast][2] = { + /* fg bg */ + [SchemeNorm] = { "#EEE8D5", "#073642" }, + [SchemeSel] = { "#EEE8D5", "#B58900" }, + [SchemeOut] = { "#EEE8D5", "#CB4B16" }, +}; +/* -l option; if nonzero, dmenu uses vertical list with given number of lines */ +static unsigned int lines = 0; + +/* + * Characters not considered part of a word while deleting words + * for example: " /?\"&[]" + */ +static const char worddelimiters[] = " "; diff --git a/sl/dvtm.h b/sl/dvtm.h @@ -0,0 +1,214 @@ +/* valid curses attributes are listed below they can be ORed + * + * A_NORMAL Normal display (no highlight) + * A_STANDOUT Best highlighting mode of the terminal. + * A_UNDERLINE Underlining + * A_REVERSE Reverse video + * A_BLINK Blinking + * A_DIM Half bright + * A_BOLD Extra bright or bold + * A_PROTECT Protected mode + * A_INVIS Invisible or blank mode + */ + +enum { + DEFAULT, + BLUE, +}; + +static Color colors[] = { + [DEFAULT] = { .fg = -1, .bg = -1, .fg256 = -1, .bg256 = -1, }, + [BLUE] = { .fg = COLOR_BLUE, .bg = -1, .fg256 = 24, .bg256 = -1, }, +}; + +#define COLOR(c) COLOR_PAIR(colors[c].pair) +/* curses attributes for the currently focused window */ +#define SELECTED_ATTR (COLOR(BLUE) | A_NORMAL) +/* curses attributes for normal (not selected) windows */ +#define NORMAL_ATTR (COLOR(DEFAULT) | A_NORMAL) +/* curses attributes for a window with pending urgent flag */ +#define URGENT_ATTR NORMAL_ATTR +/* curses attributes for the status bar */ +#define BAR_ATTR (COLOR(BLUE) | A_NORMAL) +/* status bar (command line option -s) position */ +#define BAR_POS BAR_BOTTOM /* BAR_BOTTOM, BAR_OFF */ +/* whether status bar should be hidden if only one client exists */ +#define BAR_AUTOHIDE false +/* master width factor [0.1 .. 0.9] */ +#define MFACT 0.5 +/* number of clients in master area */ +#define NMASTER 1 +/* scroll back buffer size in lines */ +#define SCROLL_HISTORY 500 +/* printf format string for the tag in the status bar */ +#define TAG_SYMBOL "[%s]" +/* curses attributes for the currently selected tags */ +#define TAG_SEL (COLOR(BLUE) | A_BOLD) +/* curses attributes for not selected tags which contain no windows */ +#define TAG_NORMAL (COLOR(DEFAULT) | A_NORMAL) +/* curses attributes for not selected tags which contain windows */ +#define TAG_OCCUPIED (COLOR(BLUE) | A_NORMAL) +/* curses attributes for not selected tags which with urgent windows */ +#define TAG_URGENT (COLOR(BLUE) | A_NORMAL | A_BLINK) + +const char tags[][8] = { "1", "2", "3", "4", "5" }; + +#include "tile.c" +#include "grid.c" +#include "bstack.c" +#include "fullscreen.c" + +/* by default the first layout entry is used */ +static Layout layouts[] = { + { "[]=", tile }, + { "+++", grid }, + { "TTT", bstack }, + { "[ ]", fullscreen }, +}; + +#define MOD CTRL('g') + +/* you can at most specifiy MAX_ARGS (3) number of arguments */ +static KeyBinding bindings[] = { + { { MOD, 'c', }, { create, { NULL } } }, + { { MOD, 'C', }, { create, { NULL, NULL, "$CWD" } } }, + { { MOD, 'x', }, { killclient, { NULL } } }, + { { MOD, 'j', }, { focusnext, { NULL } } }, + { { MOD, 'J', }, { focusnextnm, { NULL } } }, + { { MOD, 'K', }, { focusprevnm, { NULL } } }, + { { MOD, 'k', }, { focusprev, { NULL } } }, + { { MOD, 'f', }, { setlayout, { "[]=" } } }, + { { MOD, 'g', }, { setlayout, { "+++" } } }, + { { MOD, 'b', }, { setlayout, { "TTT" } } }, + { { MOD, 'm', }, { setlayout, { "[ ]" } } }, + { { MOD, ' ', }, { setlayout, { NULL } } }, + { { MOD, 'i', }, { incnmaster, { "+1" } } }, + { { MOD, 'd', }, { incnmaster, { "-1" } } }, + { { MOD, 'h', }, { setmfact, { "-0.05" } } }, + { { MOD, 'l', }, { setmfact, { "+0.05" } } }, + { { MOD, '.', }, { toggleminimize, { NULL } } }, + { { MOD, 's', }, { togglebar, { NULL } } }, + { { MOD, 'S', }, { togglebarpos, { NULL } } }, + { { MOD, 'M', }, { togglemouse, { NULL } } }, + { { MOD, '\n', }, { zoom , { NULL } } }, + { { MOD, '\r', }, { zoom , { NULL } } }, + { { MOD, '\t', }, { focuslast, { NULL } } }, + { { MOD, 'q', }, { quit, { NULL } } }, + { { MOD, 'a', }, { togglerunall, { NULL } } }, + { { MOD, CTRL('L'), }, { redraw, { NULL } } }, + { { MOD, 'r', }, { redraw, { NULL } } }, + { { MOD, 'e', }, { copymode, { NULL } } }, + { { MOD, '/', }, { copymode, { "/" } } }, + { { MOD, 'p', }, { paste, { NULL } } }, + { { MOD, KEY_PPAGE, }, { scrollback, { "-1" } } }, + { { MOD, KEY_NPAGE, }, { scrollback, { "1" } } }, + { { MOD, '?', }, { create, { "man dvtm", "dvtm help" } } }, + { { MOD, MOD, }, { send, { (const char []){MOD, 0} } } }, + { { KEY_PPAGE, }, { scrollback, { "-1" } } }, + { { KEY_NPAGE, }, { scrollback, { "1" } } }, + { { MOD, '0', }, { view, { NULL } } }, + { { MOD, '1', }, { view, { tags[0] } } }, + { { MOD, '2', }, { view, { tags[1] } } }, + { { MOD, '3', }, { view, { tags[2] } } }, + { { MOD, '4', }, { view, { tags[3] } } }, + { { MOD, '5', }, { view, { tags[4] } } }, + { { MOD, 'v', '0' }, { view, { NULL } } }, + { { MOD, 'v', '1' }, { view, { tags[0] } } }, + { { MOD, 'v', '2' }, { view, { tags[1] } } }, + { { MOD, 'v', '3' }, { view, { tags[2] } } }, + { { MOD, 'v', '4' }, { view, { tags[3] } } }, + { { MOD, 'v', '5' }, { view, { tags[4] } } }, + { { MOD, 'v', '\t', }, { viewprevtag, { NULL } } }, + { { MOD, 't', '0' }, { tag, { NULL } } }, + { { MOD, 't', '1' }, { tag, { tags[0] } } }, + { { MOD, 't', '2' }, { tag, { tags[1] } } }, + { { MOD, 't', '3' }, { tag, { tags[2] } } }, + { { MOD, 't', '4' }, { tag, { tags[3] } } }, + { { MOD, 't', '5' }, { tag, { tags[4] } } }, + { { MOD, 'V', '1' }, { toggleview, { tags[0] } } }, + { { MOD, 'V', '2' }, { toggleview, { tags[1] } } }, + { { MOD, 'V', '3' }, { toggleview, { tags[2] } } }, + { { MOD, 'V', '4' }, { toggleview, { tags[3] } } }, + { { MOD, 'V', '5' }, { toggleview, { tags[4] } } }, + { { MOD, 'T', '1' }, { toggletag, { tags[0] } } }, + { { MOD, 'T', '2' }, { toggletag, { tags[1] } } }, + { { MOD, 'T', '3' }, { toggletag, { tags[2] } } }, + { { MOD, 'T', '4' }, { toggletag, { tags[3] } } }, + { { MOD, 'T', '5' }, { toggletag, { tags[4] } } }, +}; + +static const ColorRule colorrules[] = { + { "", A_NORMAL, &colors[DEFAULT] }, /* default */ +}; + +/* possible values for the mouse buttons are listed below: + * + * BUTTON1_PRESSED mouse button 1 down + * BUTTON1_RELEASED mouse button 1 up + * BUTTON1_CLICKED mouse button 1 clicked + * BUTTON1_DOUBLE_CLICKED mouse button 1 double clicked + * BUTTON1_TRIPLE_CLICKED mouse button 1 triple clicked + * BUTTON2_PRESSED mouse button 2 down + * BUTTON2_RELEASED mouse button 2 up + * BUTTON2_CLICKED mouse button 2 clicked + * BUTTON2_DOUBLE_CLICKED mouse button 2 double clicked + * BUTTON2_TRIPLE_CLICKED mouse button 2 triple clicked + * BUTTON3_PRESSED mouse button 3 down + * BUTTON3_RELEASED mouse button 3 up + * BUTTON3_CLICKED mouse button 3 clicked + * BUTTON3_DOUBLE_CLICKED mouse button 3 double clicked + * BUTTON3_TRIPLE_CLICKED mouse button 3 triple clicked + * BUTTON4_PRESSED mouse button 4 down + * BUTTON4_RELEASED mouse button 4 up + * BUTTON4_CLICKED mouse button 4 clicked + * BUTTON4_DOUBLE_CLICKED mouse button 4 double clicked + * BUTTON4_TRIPLE_CLICKED mouse button 4 triple clicked + * BUTTON_SHIFT shift was down during button state change + * BUTTON_CTRL control was down during button state change + * BUTTON_ALT alt was down during button state change + * ALL_MOUSE_EVENTS report all button state changes + * REPORT_MOUSE_POSITION report mouse movement + */ + +#ifdef NCURSES_MOUSE_VERSION +# define CONFIG_MOUSE /* compile in mouse support if we build against ncurses */ +#endif + +#define ENABLE_MOUSE true /* whether to enable mouse events by default */ + +#ifdef CONFIG_MOUSE +static Button buttons[] = { + { BUTTON1_CLICKED, { mouse_focus, { NULL } } }, + { BUTTON1_DOUBLE_CLICKED, { mouse_fullscreen, { "[ ]" } } }, + { BUTTON2_CLICKED, { mouse_zoom, { NULL } } }, + { BUTTON3_CLICKED, { mouse_minimize, { NULL } } }, +}; +#endif /* CONFIG_MOUSE */ + +static Cmd commands[] = { + { "create", { create, { NULL } } }, +}; + +/* gets executed when dvtm is started */ +static Action actions[] = { + { create, { NULL } }, +}; + +static char const * const keytable[] = { + /* add your custom key escape sequences */ +}; + +/* editor to use for copy mode. If neither of DVTM_EDITOR, EDITOR and PAGER is + * set the first entry is chosen. Otherwise the array is consulted for supported + * options. A %d in argv is replaced by the line number at which the file should + * be opened. If filter is true the editor is expected to work even if stdout is + * redirected (i.e. not a terminal). + */ +static Editor editors[] = { + { .name = "vis", .argv = { "vis", "+%d", "-", NULL }, .filter = true }, + { .name = "sandy", .argv = { "sandy", "-d", "-", NULL }, .filter = true }, + { .name = "dvtm-editor", .argv = { "dvtm-editor", "-", NULL }, .filter = true }, + { .name = "vim", .argv = { "vim", "+%d", "-", NULL }, .filter = false }, + { .name = "less", .argv = { "less", "+%d", NULL }, .filter = false }, + { .name = "more", .argv = { "more", "+%d", NULL }, .filter = false }, +}; diff --git a/sl/dwm.h b/sl/dwm.h @@ -0,0 +1,175 @@ +/* See LICENSE file for copyright and license details. */ + +/* appearance */ +static const char *fonts[] = { + "FantasqueSansMono-Regular:pixelsize=18" +}; +static const char dmenufont[] = "monospace:size=10"; +static const char normbordercolor[] = "#002b36"; +static const char normbgcolor[] = "#073642"; +static const char normfgcolor[] = "#93A1A1"; +static const char selbordercolor[] = "#268bd2"; +static const char selbgcolor[] = "#268bd2"; +static const char selfgcolor[] = "#eee8d5"; +static const char normmarkcolor[] = "#859900"; /*border color for marked client*/ +static const char selmarkcolor[] = "#2aa198"; /*border color for marked client on focus*/ +static const char urgbordercolor[] = "#dc322f"; +static const unsigned int borderpx = 1; /* border pixel of windows */ +static const unsigned int gappx = 6; /* gap pixel between windows */ +static const unsigned int snap = 32; /* snap pixel */ +static const unsigned int systraypinning = 0; /* 0: sloppy systray follows selected monitor, >0: pin systray to monitor X */ +static const unsigned int systrayspacing = 2; /* systray spacing */ +static const int systraypinningfailfirst = 1; /* 1: if pinning fails, display systray on the first monitor, 0: display systray on the last monitor*/ +static const int showsystray = 1; /* 0 means no systray */ +static const int showbar = 1; /* 0 means no bar */ +static const int topbar = 1; /* 0 means bottom bar */ + +/* tagging */ +static const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" }; + +static const Rule rules[] = { + /* class instance title tags mask isfloating monitor */ + { NULL, NULL, "bar", 0, 1, -1 }, +}; + +/* layout(s) */ +static const float mfact = 0.55; /* factor of master area size [0.05..0.95] */ +static const int nmaster = 1; /* number of clients in master area */ +static const int resizehints = 0; /* 1 means respect size hints in tiled resizals */ + +#include "htile.c" +#include "deck.c" +#include "centered.c" +#include "fibonacci.c" +#include "gaplessgrid.c" +#include "horizgrid.c" +#include "tcl.c" +static const Layout layouts[] = { + /* symbol arrange function */ + { "[]=", tile }, + { "><>", NULL }, /* floating */ + { "[+]", htile }, + { "D ", deck }, + { "[o]", centered }, + { "[@]", spiral }, + { "[\\]", dwindle }, + { "###", gaplessgrid }, + { "###", horizgrid }, + { "|||", tcl }, + { "[M]", monocle }, +}; + +/* key definitions */ +#define MODKEY Mod4Mask +#define TAGKEYS(KEY,TAG) \ + { MODKEY, KEY, view, {.ui = 1 << TAG} }, \ + { MODKEY|ControlMask, KEY, toggleview, {.ui = 1 << TAG} }, \ + { MODKEY|ShiftMask, KEY, tag, {.ui = 1 << TAG} }, \ + { MODKEY|ControlMask|ShiftMask, KEY, toggletag, {.ui = 1 << TAG} }, + +/* helper for spawning shell commands in the pre dwm-5.0 fashion */ +#define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } } + +/* commands */ +static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn() */ +static const char *dmenucmd[] = { "menu.sh", NULL }; +static const char *termcmd[] = { "tabbed", "-c", "st", "-w", NULL }; +static const char *calcmd[] = { "gsimplecal", NULL }; + +#include "push.c" +#include "shiftview.c" +#include "switchcol.c" +#include "zoomswap.c" +static Key keys[] = { + /* modifier key function argument */ + { MODKEY, XK_z, spawn, {.v = dmenucmd } }, + { MODKEY, XK_t, spawn, {.v = termcmd } }, + { MODKEY, XK_b, togglebar, {0} }, + + { MODKEY, XK_l, focusstack, {.i = +1 } }, + { MODKEY, XK_h, focusstack, {.i = -1 } }, + { MODKEY|ShiftMask, XK_l, pushdown, {0} }, + { MODKEY|ShiftMask, XK_h, pushup, {0} }, + { MODKEY|Mod1Mask, XK_l, shiftview, {.i = +1 } }, + { MODKEY|Mod1Mask, XK_h, shiftview, {.i = -1 } }, + { MODKEY, XK_i, incnmaster, {.i = +1 } }, + { MODKEY, XK_d, incnmaster, {.i = -1 } }, + { MODKEY, XK_j, setmfact, {.f = -0.05} }, + { MODKEY, XK_k, setmfact, {.f = +0.05} }, + { MODKEY|ShiftMask, XK_j, setcfact, {.f = +0.25} }, + { MODKEY|ShiftMask, XK_k, setcfact, {.f = -0.25} }, + { MODKEY|ShiftMask, XK_o, setcfact, {.f = 0.00} }, + + { MODKEY, XK_Return, switchcol, {0} }, + { MODKEY|ShiftMask, XK_Return, zoomswap, {0} }, + { MODKEY, XK_Tab, view, {0} }, + { MODKEY|ShiftMask, XK_x, killclient, {0} }, + + { MODKEY, XK_semicolon,togglemark, {0} }, + { Mod1Mask, XK_Tab, swapfocus, {0} }, + { Mod1Mask|ShiftMask, XK_Tab, swapclient, {0} }, + + { MODKEY|ControlMask, XK_t, setlayout, {.v = &layouts[0]} }, + { MODKEY|ControlMask, XK_f, setlayout, {.v = &layouts[1]} }, + { MODKEY|ControlMask, XK_h, setlayout, {.v = &layouts[2]} }, + { MODKEY|ControlMask, XK_d, setlayout, {.v = &layouts[3]} }, + { MODKEY|ControlMask, XK_c, setlayout, {.v = &layouts[4]} }, + { MODKEY|ControlMask, XK_s, setlayout, {.v = &layouts[5]} }, + { MODKEY|ControlMask|ShiftMask, XK_s, setlayout, {.v = &layouts[6]} }, + { MODKEY|ControlMask, XK_g, setlayout, {.v = &layouts[7]} }, + { MODKEY|ControlMask|ShiftMask, XK_g, setlayout, {.v = &layouts[8]} }, + { MODKEY|ControlMask, XK_r, setlayout, {.v = &layouts[9]} }, + { MODKEY|ControlMask, XK_m, setlayout, {.v = &layouts[10]} }, + { MODKEY, XK_space, setlayout, {0} }, + + { Mod1Mask, XK_space, togglefloating, {0} }, + { MODKEY, XK_0, view, {.ui = ~0 } }, + { MODKEY|ShiftMask, XK_0, tag, {.ui = ~0 } }, + + { MODKEY, XK_comma, focusmon, {.i = -1 } }, + { MODKEY, XK_period, focusmon, {.i = +1 } }, + { MODKEY|ShiftMask, XK_comma, tagmon, {.i = -1 } }, + { MODKEY|ShiftMask, XK_period, tagmon, {.i = +1 } }, + TAGKEYS( XK_1, 0) + TAGKEYS( XK_2, 1) + TAGKEYS( XK_3, 2) + TAGKEYS( XK_4, 3) + TAGKEYS( XK_5, 4) + TAGKEYS( XK_6, 5) + TAGKEYS( XK_7, 6) + TAGKEYS( XK_8, 7) + TAGKEYS( XK_9, 8) + { MODKEY|ShiftMask, XK_q, quit, {0} }, +}; + +/* button definitions */ +/* click can be ClkLtSymbol, ClkStatusText, ClkWinTitle, ClkClientWin, or ClkRootWin */ +static Button buttons[] = { + /* click event mask button function argument */ + { ClkLtSymbol, 0, Button1, setlayout, {0} }, + { ClkLtSymbol, 0, Button3, setlayout, {.v = &layouts[2]} }, + { ClkWinTitle, 0, Button2, zoom, {0} }, + { ClkStatusText, 0, Button1, spawn, {.v = calcmd } }, + { ClkClientWin, Mod1Mask, Button1, movemouse, {0} }, + { ClkClientWin, MODKEY, Button2, togglefloating, {0} }, + { ClkClientWin, Mod1Mask, Button3, resizemouse, {0} }, + { ClkTagBar, 0, Button1, view, {0} }, + { ClkTagBar, 0, Button3, toggleview, {0} }, + { ClkTagBar, MODKEY, Button1, tag, {0} }, + { ClkTagBar, MODKEY, Button3, toggletag, {0} }, +}; + +#define NUMCOLORS 8 +static const char colors[NUMCOLORS][MAXCOLORS][8] = { + // border fg bg + { "#002b36", "#93A1A1", "#073642" }, // normal + { "#268bd2", "#eee8d5", "#268bd2" }, // selected + { "#002b36", "#b58900", "#073642" }, // yellow + { "#002b36", "#cb4b16", "#073642" }, // orange + { "#002b36", "#dc322f", "#073642" }, // red + { "#002b36", "#d33682", "#073642" }, // pink + { "#002b36", "#6c71c4", "#073642" }, // violet + /* { "#002b36", "#268bd2", "#073642" }, // blue */ + /* { "#002b36", "#2aa198", "#073642" }, // cyan */ + { "#002b36", "#859900", "#073642" } // green +}; diff --git a/sl/slock.h b/sl/slock.h @@ -0,0 +1,12 @@ +/* user and group to drop privileges to */ +static const char *user = "nobody"; +static const char *group = "nogroup"; + +static const char *colorname[NUMCOLS] = { + [INIT] = "#002b36", /* after initialization */ + [INPUT] = "#268bd2", /* during input */ + [FAILED] = "#dc322f", /* wrong password */ +}; + +/* treat a cleared input like a wrong password (color) */ +static const int failonclear = 0; diff --git a/sl/st.h b/sl/st.h @@ -0,0 +1,468 @@ +/* See LICENSE file for copyright and license details. */ + +/* + * appearance + * + * font: see http://freedesktop.org/software/fontconfig/fontconfig-user.html + */ +char font[] = "FantasqueSansMono:pixelsize=18:antialias=false:autohint=false"; +int borderpx = 2; + +/* + * What program is execed by st depends of these precedence rules: + * 1: program passed with -e + * 2: utmp option + * 3: SHELL environment variable + * 4: value of shell in /etc/passwd + * 5: value of shell in config.h + */ +static char shell[] = "/bin/sh"; +static char *utmp = NULL; +static char stty_args[] = "stty raw pass8 nl -echo -iexten -cstopb 38400"; + +/* identification sequence returned in DA and DECID */ +static char vtiden[] = "\033[?6c"; + +/* Kerning / character bounding-box multipliers */ +float cwscale = 1.0; +float chscale = 1.0; + +/* + * word delimiter string + * + * More advanced example: " `'\"()[]{}" + */ +static char worddelimiters[] = " "; + +/* selection timeouts (in milliseconds) */ +unsigned int doubleclicktimeout = 300; +unsigned int tripleclicktimeout = 600; + +/* alt screens */ +int allowaltscreen = 1; + +/* frames per second st should at maximum draw to the screen */ +unsigned int xfps = 120; +unsigned int actionfps = 30; + +/* + * blinking timeout (set to 0 to disable blinking) for the terminal blinking + * attribute. + */ +unsigned int blinktimeout = 800; + +/* + * thickness of underline and bar cursors + */ +unsigned int cursorthickness = 2; + +/* + * bell volume. It must be a value between -100 and 100. Use 0 for disabling + * it + */ +static int bellvolume = 0; + +/* default TERM value */ +char termname[] = "st-256color"; + +/* + * spaces per tab + * + * When you are changing this value, don't forget to adapt the »it« value in + * the st.info and appropriately install the st.info in the environment where + * you use this st version. + * + * it#$tabspaces, + * + * Secondly make sure your kernel is not expanding tabs. When running `stty + * -a` »tab0« should appear. You can tell the terminal to not expand tabs by + * running following command: + * + * stty tabs + */ +static unsigned int tabspaces = 8; + +/* Terminal colors (16 first used in escape sequence) */ +const char *colorname[] = { + /* solarized dark */ + "#073642", /* 0: black */ + "#dc322f", /* 1: red */ + "#859900", /* 2: green */ + "#b58900", /* 3: yellow */ + "#268bd2", /* 4: blue */ + "#d33682", /* 5: magenta */ + "#2aa198", /* 6: cyan */ + "#eee8d5", /* 7: white */ + "#002b36", /* 8: brblack */ + "#cb4b16", /* 9: brred */ + "#586e75", /* 10: brgreen */ + "#657b83", /* 11: bryellow */ + "#839496", /* 12: brblue */ + "#6c71c4", /* 13: brmagenta*/ + "#93a1a1", /* 14: brcyan */ + "#fdf6e3", /* 15: brwhite */ + + [255] = 0, + + /* more colors can be added after 255 to use with DefaultXX */ + "#cccccc", + "#555555", +}; + +/* bg opacity */ +static const int alpha = 0xdd; + +/* + * Default colors (colorname index) + * foreground, background, cursor, reverse cursor + */ +unsigned int defaultfg = 12; +unsigned int defaultbg = 8; +unsigned int defaultcs = 14; +unsigned int defaultrcs = 257; + +/* + * Default shape of cursor + * 2: Block ("█") + * 4: Underline ("_") + * 6: Bar ("|") + * 7: Snowman ("☃") + */ +unsigned int cursorshape = 2; + +/* + * Default columns and rows numbers + */ + +unsigned int cols = 80; +unsigned int rows = 24; + +/* + * Default colour and shape of the mouse cursor + */ +unsigned int mouseshape = XC_xterm; +unsigned int mousefg = 7; +unsigned int mousebg = 0; + +/* + * Color used to display font attributes when fontconfig selected a font which + * doesn't match the ones requested. + */ +unsigned int defaultattr = 11; + +/* + * Internal mouse shortcuts. + * Beware that overloading Button1 will disable the selection. + */ +MouseShortcut mshortcuts[] = { + /* button mask string */ + { Button4, XK_ANY_MOD, "\031" }, + { Button5, XK_ANY_MOD, "\005" }, +}; + +/* Internal keyboard shortcuts. */ +#define MODKEY Mod1Mask +#define TERMMOD (ControlMask|ShiftMask) + +Shortcut shortcuts[] = { + /* mask keysym function argument */ + { XK_ANY_MOD, XK_Break, sendbreak, {.i = 0} }, + { ControlMask, XK_Print, toggleprinter, {.i = 0} }, + { ShiftMask, XK_Print, printscreen, {.i = 0} }, + { XK_ANY_MOD, XK_Print, printsel, {.i = 0} }, + { TERMMOD, XK_Prior, zoom, {.f = +1} }, + { TERMMOD, XK_Next, zoom, {.f = -1} }, + { TERMMOD, XK_Home, zoomreset, {.f = 0} }, + { TERMMOD, XK_C, clipcopy, {.i = 0} }, + { TERMMOD, XK_V, clippaste, {.i = 0} }, + { TERMMOD, XK_Y, selpaste, {.i = 0} }, + { TERMMOD, XK_Num_Lock, numlock, {.i = 0} }, + { TERMMOD, XK_I, iso14755, {.i = 0} }, + { XK_ANY_MOD, XK_Page_Up, kscrollup, {.i = -1} }, + { XK_ANY_MOD, XK_Page_Down, kscrolldown, {.i = -1} }, +}; + +/* + * Special keys (change & recompile st.info accordingly) + * + * Mask value: + * * Use XK_ANY_MOD to match the key no matter modifiers state + * * Use XK_NO_MOD to match the key alone (no modifiers) + * appkey value: + * * 0: no value + * * > 0: keypad application mode enabled + * * = 2: term.numlock = 1 + * * < 0: keypad application mode disabled + * appcursor value: + * * 0: no value + * * > 0: cursor application mode enabled + * * < 0: cursor application mode disabled + * crlf value + * * 0: no value + * * > 0: crlf mode is enabled + * * < 0: crlf mode is disabled + * + * Be careful with the order of the definitions because st searches in + * this table sequentially, so any XK_ANY_MOD must be in the last + * position for a key. + */ + +/* + * If you want keys other than the X11 function keys (0xFD00 - 0xFFFF) + * to be mapped below, add them to this array. + */ +static KeySym mappedkeys[] = { -1 }; + +/* + * State bits to ignore when matching key or button events. By default, + * numlock (Mod2Mask) and keyboard layout (XK_SWITCH_MOD) are ignored. + */ +static uint ignoremod = Mod2Mask|XK_SWITCH_MOD; + +/* + * Override mouse-select while mask is active (when MODE_MOUSE is set). + * Note that if you want to use ShiftMask with selmasks, set this to an other + * modifier, set to 0 to not use it. + */ +uint forceselmod = ShiftMask; + +/* + * This is the huge key array which defines all compatibility to the Linux + * world. Please decide about changes wisely. + */ +static Key key[] = { + /* keysym mask string appkey appcursor crlf */ + { XK_KP_Home, ShiftMask, "\033[2J", 0, -1, 0}, + { XK_KP_Home, ShiftMask, "\033[1;2H", 0, +1, 0}, + { XK_KP_Home, XK_ANY_MOD, "\033[H", 0, -1, 0}, + { XK_KP_Home, XK_ANY_MOD, "\033[1~", 0, +1, 0}, + { XK_KP_Up, XK_ANY_MOD, "\033Ox", +1, 0, 0}, + { XK_KP_Up, XK_ANY_MOD, "\033[A", 0, -1, 0}, + { XK_KP_Up, XK_ANY_MOD, "\033OA", 0, +1, 0}, + { XK_KP_Down, XK_ANY_MOD, "\033Or", +1, 0, 0}, + { XK_KP_Down, XK_ANY_MOD, "\033[B", 0, -1, 0}, + { XK_KP_Down, XK_ANY_MOD, "\033OB", 0, +1, 0}, + { XK_KP_Left, XK_ANY_MOD, "\033Ot", +1, 0, 0}, + { XK_KP_Left, XK_ANY_MOD, "\033[D", 0, -1, 0}, + { XK_KP_Left, XK_ANY_MOD, "\033OD", 0, +1, 0}, + { XK_KP_Right, XK_ANY_MOD, "\033Ov", +1, 0, 0}, + { XK_KP_Right, XK_ANY_MOD, "\033[C", 0, -1, 0}, + { XK_KP_Right, XK_ANY_MOD, "\033OC", 0, +1, 0}, + { XK_KP_Prior, ShiftMask, "\033[5;2~", 0, 0, 0}, + { XK_KP_Prior, XK_ANY_MOD, "\033[5~", 0, 0, 0}, + { XK_KP_Begin, XK_ANY_MOD, "\033[E", 0, 0, 0}, + { XK_KP_End, ControlMask, "\033[J", -1, 0, 0}, + { XK_KP_End, ControlMask, "\033[1;5F", +1, 0, 0}, + { XK_KP_End, ShiftMask, "\033[K", -1, 0, 0}, + { XK_KP_End, ShiftMask, "\033[1;2F", +1, 0, 0}, + { XK_KP_End, XK_ANY_MOD, "\033[4~", 0, 0, 0}, + { XK_KP_Next, ShiftMask, "\033[6;2~", 0, 0, 0}, + { XK_KP_Next, XK_ANY_MOD, "\033[6~", 0, 0, 0}, + { XK_KP_Insert, ShiftMask, "\033[2;2~", +1, 0, 0}, + { XK_KP_Insert, ShiftMask, "\033[4l", -1, 0, 0}, + { XK_KP_Insert, ControlMask, "\033[L", -1, 0, 0}, + { XK_KP_Insert, ControlMask, "\033[2;5~", +1, 0, 0}, + { XK_KP_Insert, XK_ANY_MOD, "\033[4h", -1, 0, 0}, + { XK_KP_Insert, XK_ANY_MOD, "\033[2~", +1, 0, 0}, + { XK_KP_Delete, ControlMask, "\033[M", -1, 0, 0}, + { XK_KP_Delete, ControlMask, "\033[3;5~", +1, 0, 0}, + { XK_KP_Delete, ShiftMask, "\033[2K", -1, 0, 0}, + { XK_KP_Delete, ShiftMask, "\033[3;2~", +1, 0, 0}, + { XK_KP_Delete, XK_ANY_MOD, "\033[P", -1, 0, 0}, + { XK_KP_Delete, XK_ANY_MOD, "\033[3~", +1, 0, 0}, + { XK_KP_Multiply, XK_ANY_MOD, "\033Oj", +2, 0, 0}, + { XK_KP_Add, XK_ANY_MOD, "\033Ok", +2, 0, 0}, + { XK_KP_Enter, XK_ANY_MOD, "\033OM", +2, 0, 0}, + { XK_KP_Enter, XK_ANY_MOD, "\r", -1, 0, -1}, + { XK_KP_Enter, XK_ANY_MOD, "\r\n", -1, 0, +1}, + { XK_KP_Subtract, XK_ANY_MOD, "\033Om", +2, 0, 0}, + { XK_KP_Decimal, XK_ANY_MOD, "\033On", +2, 0, 0}, + { XK_KP_Divide, XK_ANY_MOD, "\033Oo", +2, 0, 0}, + { XK_KP_0, XK_ANY_MOD, "\033Op", +2, 0, 0}, + { XK_KP_1, XK_ANY_MOD, "\033Oq", +2, 0, 0}, + { XK_KP_2, XK_ANY_MOD, "\033Or", +2, 0, 0}, + { XK_KP_3, XK_ANY_MOD, "\033Os", +2, 0, 0}, + { XK_KP_4, XK_ANY_MOD, "\033Ot", +2, 0, 0}, + { XK_KP_5, XK_ANY_MOD, "\033Ou", +2, 0, 0}, + { XK_KP_6, XK_ANY_MOD, "\033Ov", +2, 0, 0}, + { XK_KP_7, XK_ANY_MOD, "\033Ow", +2, 0, 0}, + { XK_KP_8, XK_ANY_MOD, "\033Ox", +2, 0, 0}, + { XK_KP_9, XK_ANY_MOD, "\033Oy", +2, 0, 0}, + { XK_Up, ShiftMask, "\033[1;2A", 0, 0, 0}, + { XK_Up, Mod1Mask, "\033[1;3A", 0, 0, 0}, + { XK_Up, ShiftMask|Mod1Mask,"\033[1;4A", 0, 0, 0}, + { XK_Up, ControlMask, "\033[1;5A", 0, 0, 0}, + { XK_Up, ShiftMask|ControlMask,"\033[1;6A", 0, 0, 0}, + { XK_Up, ControlMask|Mod1Mask,"\033[1;7A", 0, 0, 0}, + { XK_Up,ShiftMask|ControlMask|Mod1Mask,"\033[1;8A", 0, 0, 0}, + { XK_Up, XK_ANY_MOD, "\033[A", 0, -1, 0}, + { XK_Up, XK_ANY_MOD, "\033OA", 0, +1, 0}, + { XK_Down, ShiftMask, "\033[1;2B", 0, 0, 0}, + { XK_Down, Mod1Mask, "\033[1;3B", 0, 0, 0}, + { XK_Down, ShiftMask|Mod1Mask,"\033[1;4B", 0, 0, 0}, + { XK_Down, ControlMask, "\033[1;5B", 0, 0, 0}, + { XK_Down, ShiftMask|ControlMask,"\033[1;6B", 0, 0, 0}, + { XK_Down, ControlMask|Mod1Mask,"\033[1;7B", 0, 0, 0}, + { XK_Down,ShiftMask|ControlMask|Mod1Mask,"\033[1;8B",0, 0, 0}, + { XK_Down, XK_ANY_MOD, "\033[B", 0, -1, 0}, + { XK_Down, XK_ANY_MOD, "\033OB", 0, +1, 0}, + { XK_Left, ShiftMask, "\033[1;2D", 0, 0, 0}, + { XK_Left, Mod1Mask, "\033[1;3D", 0, 0, 0}, + { XK_Left, ShiftMask|Mod1Mask,"\033[1;4D", 0, 0, 0}, + { XK_Left, ControlMask, "\033[1;5D", 0, 0, 0}, + { XK_Left, ShiftMask|ControlMask,"\033[1;6D", 0, 0, 0}, + { XK_Left, ControlMask|Mod1Mask,"\033[1;7D", 0, 0, 0}, + { XK_Left,ShiftMask|ControlMask|Mod1Mask,"\033[1;8D",0, 0, 0}, + { XK_Left, XK_ANY_MOD, "\033[D", 0, -1, 0}, + { XK_Left, XK_ANY_MOD, "\033OD", 0, +1, 0}, + { XK_Right, ShiftMask, "\033[1;2C", 0, 0, 0}, + { XK_Right, Mod1Mask, "\033[1;3C", 0, 0, 0}, + { XK_Right, ShiftMask|Mod1Mask,"\033[1;4C", 0, 0, 0}, + { XK_Right, ControlMask, "\033[1;5C", 0, 0, 0}, + { XK_Right, ShiftMask|ControlMask,"\033[1;6C", 0, 0, 0}, + { XK_Right, ControlMask|Mod1Mask,"\033[1;7C", 0, 0, 0}, + { XK_Right,ShiftMask|ControlMask|Mod1Mask,"\033[1;8C",0, 0, 0}, + { XK_Right, XK_ANY_MOD, "\033[C", 0, -1, 0}, + { XK_Right, XK_ANY_MOD, "\033OC", 0, +1, 0}, + { XK_ISO_Left_Tab, ShiftMask, "\033[Z", 0, 0, 0}, + { XK_Return, Mod1Mask, "\033\r", 0, 0, -1}, + { XK_Return, Mod1Mask, "\033\r\n", 0, 0, +1}, + { XK_Return, XK_ANY_MOD, "\r", 0, 0, -1}, + { XK_Return, XK_ANY_MOD, "\r\n", 0, 0, +1}, + { XK_Insert, ShiftMask, "\033[4l", -1, 0, 0}, + { XK_Insert, ShiftMask, "\033[2;2~", +1, 0, 0}, + { XK_Insert, ControlMask, "\033[L", -1, 0, 0}, + { XK_Insert, ControlMask, "\033[2;5~", +1, 0, 0}, + { XK_Insert, XK_ANY_MOD, "\033[4h", -1, 0, 0}, + { XK_Insert, XK_ANY_MOD, "\033[2~", +1, 0, 0}, + { XK_Delete, ControlMask, "\033[M", -1, 0, 0}, + { XK_Delete, ControlMask, "\033[3;5~", +1, 0, 0}, + { XK_Delete, ShiftMask, "\033[2K", -1, 0, 0}, + { XK_Delete, ShiftMask, "\033[3;2~", +1, 0, 0}, + { XK_Delete, XK_ANY_MOD, "\033[P", -1, 0, 0}, + { XK_Delete, XK_ANY_MOD, "\033[3~", +1, 0, 0}, + { XK_BackSpace, XK_NO_MOD, "\177", 0, 0, 0}, + { XK_BackSpace, Mod1Mask, "\033\177", 0, 0, 0}, + { XK_Home, ShiftMask, "\033[2J", 0, -1, 0}, + { XK_Home, ShiftMask, "\033[1;2H", 0, +1, 0}, + { XK_Home, XK_ANY_MOD, "\033[H", 0, -1, 0}, + { XK_Home, XK_ANY_MOD, "\033[1~", 0, +1, 0}, + { XK_End, ControlMask, "\033[J", -1, 0, 0}, + { XK_End, ControlMask, "\033[1;5F", +1, 0, 0}, + { XK_End, ShiftMask, "\033[K", -1, 0, 0}, + { XK_End, ShiftMask, "\033[1;2F", +1, 0, 0}, + { XK_End, XK_ANY_MOD, "\033[4~", 0, 0, 0}, + { XK_Prior, ControlMask, "\033[5;5~", 0, 0, 0}, + { XK_Prior, ShiftMask, "\033[5;2~", 0, 0, 0}, + { XK_Prior, XK_ANY_MOD, "\033[5~", 0, 0, 0}, + { XK_Next, ControlMask, "\033[6;5~", 0, 0, 0}, + { XK_Next, ShiftMask, "\033[6;2~", 0, 0, 0}, + { XK_Next, XK_ANY_MOD, "\033[6~", 0, 0, 0}, + { XK_F1, XK_NO_MOD, "\033OP" , 0, 0, 0}, + { XK_F1, /* F13 */ ShiftMask, "\033[1;2P", 0, 0, 0}, + { XK_F1, /* F25 */ ControlMask, "\033[1;5P", 0, 0, 0}, + { XK_F1, /* F37 */ Mod4Mask, "\033[1;6P", 0, 0, 0}, + { XK_F1, /* F49 */ Mod1Mask, "\033[1;3P", 0, 0, 0}, + { XK_F1, /* F61 */ Mod3Mask, "\033[1;4P", 0, 0, 0}, + { XK_F2, XK_NO_MOD, "\033OQ" , 0, 0, 0}, + { XK_F2, /* F14 */ ShiftMask, "\033[1;2Q", 0, 0, 0}, + { XK_F2, /* F26 */ ControlMask, "\033[1;5Q", 0, 0, 0}, + { XK_F2, /* F38 */ Mod4Mask, "\033[1;6Q", 0, 0, 0}, + { XK_F2, /* F50 */ Mod1Mask, "\033[1;3Q", 0, 0, 0}, + { XK_F2, /* F62 */ Mod3Mask, "\033[1;4Q", 0, 0, 0}, + { XK_F3, XK_NO_MOD, "\033OR" , 0, 0, 0}, + { XK_F3, /* F15 */ ShiftMask, "\033[1;2R", 0, 0, 0}, + { XK_F3, /* F27 */ ControlMask, "\033[1;5R", 0, 0, 0}, + { XK_F3, /* F39 */ Mod4Mask, "\033[1;6R", 0, 0, 0}, + { XK_F3, /* F51 */ Mod1Mask, "\033[1;3R", 0, 0, 0}, + { XK_F3, /* F63 */ Mod3Mask, "\033[1;4R", 0, 0, 0}, + { XK_F4, XK_NO_MOD, "\033OS" , 0, 0, 0}, + { XK_F4, /* F16 */ ShiftMask, "\033[1;2S", 0, 0, 0}, + { XK_F4, /* F28 */ ControlMask, "\033[1;5S", 0, 0, 0}, + { XK_F4, /* F40 */ Mod4Mask, "\033[1;6S", 0, 0, 0}, + { XK_F4, /* F52 */ Mod1Mask, "\033[1;3S", 0, 0, 0}, + { XK_F5, XK_NO_MOD, "\033[15~", 0, 0, 0}, + { XK_F5, /* F17 */ ShiftMask, "\033[15;2~", 0, 0, 0}, + { XK_F5, /* F29 */ ControlMask, "\033[15;5~", 0, 0, 0}, + { XK_F5, /* F41 */ Mod4Mask, "\033[15;6~", 0, 0, 0}, + { XK_F5, /* F53 */ Mod1Mask, "\033[15;3~", 0, 0, 0}, + { XK_F6, XK_NO_MOD, "\033[17~", 0, 0, 0}, + { XK_F6, /* F18 */ ShiftMask, "\033[17;2~", 0, 0, 0}, + { XK_F6, /* F30 */ ControlMask, "\033[17;5~", 0, 0, 0}, + { XK_F6, /* F42 */ Mod4Mask, "\033[17;6~", 0, 0, 0}, + { XK_F6, /* F54 */ Mod1Mask, "\033[17;3~", 0, 0, 0}, + { XK_F7, XK_NO_MOD, "\033[18~", 0, 0, 0}, + { XK_F7, /* F19 */ ShiftMask, "\033[18;2~", 0, 0, 0}, + { XK_F7, /* F31 */ ControlMask, "\033[18;5~", 0, 0, 0}, + { XK_F7, /* F43 */ Mod4Mask, "\033[18;6~", 0, 0, 0}, + { XK_F7, /* F55 */ Mod1Mask, "\033[18;3~", 0, 0, 0}, + { XK_F8, XK_NO_MOD, "\033[19~", 0, 0, 0}, + { XK_F8, /* F20 */ ShiftMask, "\033[19;2~", 0, 0, 0}, + { XK_F8, /* F32 */ ControlMask, "\033[19;5~", 0, 0, 0}, + { XK_F8, /* F44 */ Mod4Mask, "\033[19;6~", 0, 0, 0}, + { XK_F8, /* F56 */ Mod1Mask, "\033[19;3~", 0, 0, 0}, + { XK_F9, XK_NO_MOD, "\033[20~", 0, 0, 0}, + { XK_F9, /* F21 */ ShiftMask, "\033[20;2~", 0, 0, 0}, + { XK_F9, /* F33 */ ControlMask, "\033[20;5~", 0, 0, 0}, + { XK_F9, /* F45 */ Mod4Mask, "\033[20;6~", 0, 0, 0}, + { XK_F9, /* F57 */ Mod1Mask, "\033[20;3~", 0, 0, 0}, + { XK_F10, XK_NO_MOD, "\033[21~", 0, 0, 0}, + { XK_F10, /* F22 */ ShiftMask, "\033[21;2~", 0, 0, 0}, + { XK_F10, /* F34 */ ControlMask, "\033[21;5~", 0, 0, 0}, + { XK_F10, /* F46 */ Mod4Mask, "\033[21;6~", 0, 0, 0}, + { XK_F10, /* F58 */ Mod1Mask, "\033[21;3~", 0, 0, 0}, + { XK_F11, XK_NO_MOD, "\033[23~", 0, 0, 0}, + { XK_F11, /* F23 */ ShiftMask, "\033[23;2~", 0, 0, 0}, + { XK_F11, /* F35 */ ControlMask, "\033[23;5~", 0, 0, 0}, + { XK_F11, /* F47 */ Mod4Mask, "\033[23;6~", 0, 0, 0}, + { XK_F11, /* F59 */ Mod1Mask, "\033[23;3~", 0, 0, 0}, + { XK_F12, XK_NO_MOD, "\033[24~", 0, 0, 0}, + { XK_F12, /* F24 */ ShiftMask, "\033[24;2~", 0, 0, 0}, + { XK_F12, /* F36 */ ControlMask, "\033[24;5~", 0, 0, 0}, + { XK_F12, /* F48 */ Mod4Mask, "\033[24;6~", 0, 0, 0}, + { XK_F12, /* F60 */ Mod1Mask, "\033[24;3~", 0, 0, 0}, + { XK_F13, XK_NO_MOD, "\033[1;2P", 0, 0, 0}, + { XK_F14, XK_NO_MOD, "\033[1;2Q", 0, 0, 0}, + { XK_F15, XK_NO_MOD, "\033[1;2R", 0, 0, 0}, + { XK_F16, XK_NO_MOD, "\033[1;2S", 0, 0, 0}, + { XK_F17, XK_NO_MOD, "\033[15;2~", 0, 0, 0}, + { XK_F18, XK_NO_MOD, "\033[17;2~", 0, 0, 0}, + { XK_F19, XK_NO_MOD, "\033[18;2~", 0, 0, 0}, + { XK_F20, XK_NO_MOD, "\033[19;2~", 0, 0, 0}, + { XK_F21, XK_NO_MOD, "\033[20;2~", 0, 0, 0}, + { XK_F22, XK_NO_MOD, "\033[21;2~", 0, 0, 0}, + { XK_F23, XK_NO_MOD, "\033[23;2~", 0, 0, 0}, + { XK_F24, XK_NO_MOD, "\033[24;2~", 0, 0, 0}, + { XK_F25, XK_NO_MOD, "\033[1;5P", 0, 0, 0}, + { XK_F26, XK_NO_MOD, "\033[1;5Q", 0, 0, 0}, + { XK_F27, XK_NO_MOD, "\033[1;5R", 0, 0, 0}, + { XK_F28, XK_NO_MOD, "\033[1;5S", 0, 0, 0}, + { XK_F29, XK_NO_MOD, "\033[15;5~", 0, 0, 0}, + { XK_F30, XK_NO_MOD, "\033[17;5~", 0, 0, 0}, + { XK_F31, XK_NO_MOD, "\033[18;5~", 0, 0, 0}, + { XK_F32, XK_NO_MOD, "\033[19;5~", 0, 0, 0}, + { XK_F33, XK_NO_MOD, "\033[20;5~", 0, 0, 0}, + { XK_F34, XK_NO_MOD, "\033[21;5~", 0, 0, 0}, + { XK_F35, XK_NO_MOD, "\033[23;5~", 0, 0, 0}, +}; + +/* + * Selection types' masks. + * Use the same masks as usual. + * Button1Mask is always unset, to make masks match between ButtonPress. + * ButtonRelease and MotionNotify. + * If no match is found, regular selection is used. + */ +uint selmasks[] = { + [SEL_RECTANGULAR] = Mod1Mask, +}; + +/* + * Printable characters in ASCII, used to estimate the advance width + * of single wide characters. + */ +char ascii_printable[] = + " !\"#$%&'()*+,-./0123456789:;<=>?" + "@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_" + "`abcdefghijklmnopqrstuvwxyz{|}~"; + diff --git a/sl/tabbed.h b/sl/tabbed.h @@ -0,0 +1,66 @@ +/* See LICENSE file for copyright and license details. */ + +/* appearance */ +static const char font[] = "FantasqueSansMono:pixelsize=18:antialias=false:autohint=false"; +static const char* normbgcolor = "#073642"; +static const char* normfgcolor = "#657B83"; +static const char* selbgcolor = "#EEE8D5"; +static const char* selfgcolor = "#657B83"; +static const char* urgbgcolor = "#B58900"; +static const char* urgfgcolor = "#657B83"; +static const char before[] = "<"; +static const char after[] = ">"; +static const char titletrim[] = "..."; +static const int tabwidth = 125; +static const Bool foreground = True; +static Bool urgentswitch = False; + +/* + * Where to place a new tab when it is opened. When npisrelative is True, + * then the current position is changed + newposition. If npisrelative + * is False, then newposition is an absolute position. + */ +static int newposition = 1; +static Bool npisrelative = True; + +#define SETPROP(p) { \ + .v = (char *[]){ "/bin/sh", "-c", \ + "prop=\"`xwininfo -children -id $1 | grep '^ 0x' |" \ + "sed -e's@^ *\\(0x[0-9a-f]*\\) \"\\([^\"]*\\)\".*@\\1 \\2@' |" \ + "xargs -0 printf %b | dmenu -i -c -l 10`\" &&" \ + "xprop -id $1 -f $0 8s -set $0 \"$prop\"", \ + p, winid, NULL \ + } \ +} + +#define MODKEY ControlMask +static Key keys[] = { + /* modifier key function argument */ + { MODKEY|ShiftMask, XK_Return, focusonce, { 0 } }, + { MODKEY|ShiftMask, XK_Return, spawn, { 0 } }, + { MODKEY|ShiftMask, XK_t, spawn, SETPROP("_TABBED_SELECT_TAB") }, + + { MODKEY|ShiftMask, XK_l, rotate, { .i = +1 } }, + { MODKEY|ShiftMask, XK_h, rotate, { .i = -1 } }, + { MODKEY|ShiftMask, XK_j, movetab, { .i = -1 } }, + { MODKEY|ShiftMask, XK_k, movetab, { .i = +1 } }, + { MODKEY, XK_Tab, rotate, { .i = 0 } }, + + { MODKEY, XK_1, move, { .i = 0 } }, + { MODKEY, XK_2, move, { .i = 1 } }, + { MODKEY, XK_3, move, { .i = 2 } }, + { MODKEY, XK_4, move, { .i = 3 } }, + { MODKEY, XK_5, move, { .i = 4 } }, + { MODKEY, XK_6, move, { .i = 5 } }, + { MODKEY, XK_7, move, { .i = 6 } }, + { MODKEY, XK_8, move, { .i = 7 } }, + { MODKEY, XK_9, move, { .i = 8 } }, + { MODKEY, XK_0, move, { .i = 9 } }, + + { MODKEY|ShiftMask, XK_q, killclient, { 0 } }, + + { MODKEY|ShiftMask, XK_u, focusurgent, { 0 } }, + { MODKEY|Mod1Mask, XK_u, toggle, { .v = (void*) &urgentswitch } }, + + { 0, XK_F11, fullscreen, { 0 } }, +};