diff options
| author | joe <rbo@gmx.us> | 2025-09-27 18:02:33 +0200 |
|---|---|---|
| committer | joe <rbo@gmx.us> | 2025-09-27 18:02:33 +0200 |
| commit | 512d13d85de55f4a7d5bf3ab87c440b5eb8b8aba (patch) | |
| tree | 6dd9489526a238f21775cb7d2521928ac09db21e | |
| parent | up (diff) | |
| download | st-512d13d85de55f4a7d5bf3ab87c440b5eb8b8aba.tar.gz st-512d13d85de55f4a7d5bf3ab87c440b5eb8b8aba.tar.bz2 st-512d13d85de55f4a7d5bf3ab87c440b5eb8b8aba.tar.xz st-512d13d85de55f4a7d5bf3ab87c440b5eb8b8aba.tar.zst st-512d13d85de55f4a7d5bf3ab87c440b5eb8b8aba.zip | |
patches
Diffstat (limited to '')
| -rw-r--r-- | config.def.h | 50 | ||||
| -rw-r--r-- | config.mk | 1 | ||||
| -rw-r--r-- | x.c | 33 |
3 files changed, 51 insertions, 33 deletions
diff --git a/config.def.h b/config.def.h index 2cd740a..3b1ce95 100644 --- a/config.def.h +++ b/config.def.h @@ -5,8 +5,8 @@ * * font: see http://freedesktop.org/software/fontconfig/fontconfig-user.html */ -static char *font = "Liberation Mono:pixelsize=12:antialias=true:autohint=true"; -static int borderpx = 2; +static char *font = "BlexMono Nerd Font:size=13"; +static int borderpx = 0; /* * What program is execed by st depends of these precedence rules: @@ -96,32 +96,32 @@ unsigned int tabspaces = 8; /* Terminal colors (16 first used in escape sequence) */ static const char *colorname[] = { /* 8 normal colors */ - "black", - "red3", - "green3", - "yellow3", - "blue2", - "magenta3", - "cyan3", - "gray90", + "#32302f", + "#cc241d", + "#98971a", + "#d79921", + "#458588", + "#b16286", + "#689d6a", + "#a89984", /* 8 bright colors */ - "gray50", - "red", - "green", - "yellow", - "#5c5cff", - "magenta", - "cyan", - "white", + "#928374", + "#fb4934", + "#b8bb26", + "#fabd2f", + "#83a598", + "#d3869b", + "#8ec07c", + "#ebdbb2", [255] = 0, /* more colors can be added after 255 to use with DefaultXX */ - "#cccccc", - "#555555", - "gray90", /* default foreground colour */ - "black", /* default background colour */ + "#d79921", /* 256: cursor */ + "#1d2021", /* 257: rcs */ + "#ebdbb2", /* 258: fg */ + "#1d2021", /* 259: bg */ }; @@ -193,9 +193,9 @@ static Shortcut shortcuts[] = { { 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_plus, zoom, {.f = +1} }, + { TERMMOD, XK_underscore, zoom, {.f = -1} }, + { TERMMOD, XK_parenright, zoomreset, {.f = 0} }, { TERMMOD, XK_C, clipcopy, {.i = 0} }, { TERMMOD, XK_V, clippaste, {.i = 0} }, { TERMMOD, XK_Y, selpaste, {.i = 0} }, @@ -21,6 +21,7 @@ LIBS = -L$(X11LIB) -lm -lrt -lX11 -lutil -lXft \ `$(PKG_CONFIG) --libs freetype2` # flags +CFLAGS = -march=haswell -Os -pipe STCPPFLAGS = -DVERSION=\"$(VERSION)\" -D_XOPEN_SOURCE=600 STCFLAGS = $(INCS) $(STCPPFLAGS) $(CPPFLAGS) $(CFLAGS) STLDFLAGS = $(LIBS) $(LDFLAGS) @@ -103,6 +103,8 @@ typedef struct { Draw draw; Visual *vis; XSetWindowAttributes attrs; + Cursor vpointer, bpointer; /* visible and hidden pointers */ + int pointerisvisible; int scr; int isfixed; /* is fixed geometry? */ int l, t; /* left and top offset */ @@ -716,6 +718,13 @@ brelease(XEvent *e) void bmotion(XEvent *e) { + if (!xw.pointerisvisible) { + XDefineCursor(xw.dpy, xw.win, xw.vpointer); + xw.pointerisvisible = 1; + if (!IS_SET(MODE_MOUSEMANY)) + xsetpointermotion(0); + } + if (IS_SET(MODE_MOUSE) && !(e->xbutton.state & forcemousemod)) { mousereport(e); return; @@ -1130,10 +1139,10 @@ void xinit(int cols, int rows) { XGCValues gcvalues; - Cursor cursor; Window parent, root; pid_t thispid = getpid(); XColor xmousefg, xmousebg; + Pixmap blankpm; if (!(xw.dpy = XOpenDisplay(NULL))) die("can't open display\n"); @@ -1200,8 +1209,9 @@ xinit(int cols, int rows) } /* white cursor, black outline */ - cursor = XCreateFontCursor(xw.dpy, mouseshape); - XDefineCursor(xw.dpy, xw.win, cursor); + xw.pointerisvisible = 1; + xw.vpointer = XCreateFontCursor(xw.dpy, mouseshape); + XDefineCursor(xw.dpy, xw.win, xw.vpointer); if (XParseColor(xw.dpy, xw.cmap, colorname[mousefg], &xmousefg) == 0) { xmousefg.red = 0xffff; @@ -1215,7 +1225,10 @@ xinit(int cols, int rows) xmousebg.blue = 0x0000; } - XRecolorCursor(xw.dpy, cursor, &xmousefg, &xmousebg); + XRecolorCursor(xw.dpy, xw.vpointer, &xmousefg, &xmousebg); + blankpm = XCreateBitmapFromData(xw.dpy, xw.win, &(char){0}, 1, 1); + xw.bpointer = XCreatePixmapCursor(xw.dpy, blankpm, blankpm, + &xmousefg, &xmousebg, 0, 0); xw.xembed = XInternAtom(xw.dpy, "_XEMBED", False); xw.wmdeletewin = XInternAtom(xw.dpy, "WM_DELETE_WINDOW", False); @@ -1415,10 +1428,6 @@ xdrawglyphfontspecs(const XftGlyphFontSpec *specs, Glyph base, int len, int x, i bg = &dc.col[base.bg]; } - /* Change basic system colors [0-7] to bright system colors [8-15] */ - if ((base.mode & ATTR_BOLD_FAINT) == ATTR_BOLD && BETWEEN(base.fg, 0, 7)) - fg = &dc.col[base.fg + 8]; - if (IS_SET(MODE_REVERSE)) { if (fg == &dc.col[defaultfg]) { fg = &dc.col[defaultbg]; @@ -1730,6 +1739,8 @@ unmap(XEvent *ev) void xsetpointermotion(int set) { + if (!set && !xw.pointerisvisible) + return; MODBIT(xw.attrs.event_mask, set, PointerMotionMask); XChangeWindowAttributes(xw.dpy, xw.win, CWEventMask, &xw.attrs); } @@ -1849,6 +1860,12 @@ kpress(XEvent *ev) Status status; Shortcut *bp; + if (xw.pointerisvisible) { + XDefineCursor(xw.dpy, xw.win, xw.bpointer); + xsetpointermotion(1); + xw.pointerisvisible = 0; + } + if (IS_SET(MODE_KBDLOCK)) return; |
