diff options
Diffstat (limited to 'config.h')
-rw-r--r-- | config.h | 60 |
1 files changed, 36 insertions, 24 deletions
@@ -31,9 +31,9 @@ static float chscale = 1.0; /* * word delimiter string * - * More advanced example: " `'\"()[]{}" + * More advanced example: L" `'\"()[]{}" */ -char *worddelimiters = " "; +wchar_t *worddelimiters = L" "; /* selection timeouts (in milliseconds) */ static unsigned int doubleclicktimeout = 300; @@ -84,8 +84,9 @@ char *termname = "st-256color"; unsigned int tabspaces = 8; /* bg opacity */ -unsigned int alpha = 0xed; +float alpha = 0.92; +/* Terminal colors (16 first used in escape sequence) */ static const char *colorname[] = { "#282828", /* hard contrast: #1d2021 / soft contrast: #32302f */ "#cc241d", @@ -171,6 +172,7 @@ ResourcePref resources[] = { { "color15", STRING, &colorname[15] }, { "background", STRING, &colorname[256] }, { "foreground", STRING, &colorname[257] }, + { "cursorColor", STRING, &colorname[258] }, { "termname", STRING, &termname }, { "shell", STRING, &shell }, { "xfps", INTEGER, &xfps }, @@ -178,9 +180,10 @@ ResourcePref resources[] = { { "blinktimeout", INTEGER, &blinktimeout }, { "bellvolume", INTEGER, &bellvolume }, { "tabspaces", INTEGER, &tabspaces }, + { "borderpx", INTEGER, &borderpx }, { "cwscale", FLOAT, &cwscale }, { "chscale", FLOAT, &chscale }, - { "alpha", INTEGER, &alpha }, + { "alpha", FLOAT, &alpha }, }; /* @@ -195,6 +198,7 @@ static MouseShortcut mshortcuts[] = { /* Internal keyboard shortcuts. */ #define MODKEY Mod1Mask +#define TERMMOD (Mod1Mask|ShiftMask) MouseKey mkeys[] = { /* button mask function argument */ @@ -202,46 +206,54 @@ MouseKey mkeys[] = { { Button5, ShiftMask, kscrolldown, {.i = 1} }, { Button4, MODKEY, kscrollup, {.i = 1} }, { Button5, MODKEY, kscrolldown, {.i = 1} }, - { Button4, MODKEY|ShiftMask, zoom, {.f = +1} }, - { Button5, MODKEY|ShiftMask, zoom, {.f = -1} }, + { Button4, TERMMOD, zoom, {.f = +1} }, + { Button5, TERMMOD, zoom, {.f = -1} }, }; static char *openurlcmd[] = { "/bin/sh", "-c", - "grep -aEo '(http|https)://[a-zA-Z0-9./?=_-]*' | uniq | dmenu -l 10 | xargs -r xdg-open", + "sed 's/.*│//g' | tr -d '\n' | grep -aEo '((http|https)://|www\\.)[a-zA-Z0-9./&?=_-]*' | uniq | sed 's/^www./http:\\/\\/www\\./g' | dmenu -p 'Follow which url?' -l 10 | xargs -r xdg-open", "externalpipe", NULL }; +static char *copyurlcmd[] = { "/bin/sh", "-c", + "sed 's/.*│//g' | tr -d '\n' | grep -aEo '((http|https)://|www\\.)[a-zA-Z0-9./&?=_-]*' | uniq | sed 's/^www./http:\\/\\/www\\./g' | dmenu -p 'Copy which url?' -l 10 | tr -d '\n' | xclip -selection clipboard", + "externalpipe", NULL }; + +static char *copyoutput[] = { "/bin/sh", "-c", "st-copyout", "externalpipe", NULL }; + 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, zoom, {.f = +1} }, - { MODKEY|ShiftMask, XK_Next, zoom, {.f = -1} }, - { MODKEY, XK_Home, zoomreset, {.f = 0} }, + { TERMMOD, XK_Prior, zoom, {.f = +1} }, + { TERMMOD, XK_Next, zoom, {.f = -1} }, + { MODKEY, XK_Home, zoomreset, {.f = 0} }, { ShiftMask, XK_Insert, clippaste, {.i = 0} }, { MODKEY, XK_c, clipcopy, {.i = 0} }, { MODKEY, XK_v, clippaste, {.i = 0} }, { MODKEY, XK_p, selpaste, {.i = 0} }, - { MODKEY, XK_Num_Lock, numlock, {.i = 0} }, + { MODKEY, XK_Num_Lock, numlock, {.i = 0} }, { MODKEY, XK_Control_L, iso14755, {.i = 0} }, { ShiftMask, XK_Page_Up, kscrollup, {.i = -1} }, { ShiftMask, XK_Page_Down, kscrolldown, {.i = -1} }, { MODKEY, XK_Page_Up, kscrollup, {.i = -1} }, { MODKEY, XK_Page_Down, kscrolldown, {.i = -1} }, - { MODKEY, XK_k, kscrollup, {.i = 1} }, - { MODKEY, XK_j, kscrolldown, {.i = 1} }, - { MODKEY, XK_Up, kscrollup, {.i = 1} }, - { MODKEY, XK_Down, kscrolldown, {.i = 1} }, - { MODKEY, XK_u, kscrollup, {.i = -1} }, - { MODKEY, XK_d, kscrolldown, {.i = -1} }, - { MODKEY|ShiftMask, XK_Up, zoom, {.f = +1} }, - { MODKEY|ShiftMask, XK_Down, zoom, {.f = -1} }, - { MODKEY|ShiftMask, XK_K, zoom, {.f = +1} }, - { MODKEY|ShiftMask, XK_J, zoom, {.f = -1} }, - { MODKEY|ShiftMask, XK_U, zoom, {.f = +2} }, - { MODKEY|ShiftMask, XK_D, zoom, {.f = -2} }, - { MODKEY, XK_l, externalpipe, { .v = openurlcmd } }, + { MODKEY, XK_k, kscrollup, {.i = 1} }, + { MODKEY, XK_j, kscrolldown, {.i = 1} }, + { MODKEY, XK_Up, kscrollup, {.i = 1} }, + { MODKEY, XK_Down, kscrolldown, {.i = 1} }, + { MODKEY, XK_u, kscrollup, {.i = -1} }, + { MODKEY, XK_d, kscrolldown, {.i = -1} }, + { TERMMOD, XK_Up, zoom, {.f = +1} }, + { TERMMOD, XK_Down, zoom, {.f = -1} }, + { TERMMOD, XK_K, zoom, {.f = +1} }, + { TERMMOD, XK_J, zoom, {.f = -1} }, + { TERMMOD, XK_U, zoom, {.f = +2} }, + { TERMMOD, XK_D, zoom, {.f = -2} }, + { MODKEY, XK_l, externalpipe, {.v = openurlcmd } }, + { MODKEY, XK_y, externalpipe, {.v = copyurlcmd } }, + { MODKEY, XK_o, externalpipe, {.v = copyoutput } }, }; /* |