diff -rupN st-0.8.1.original/config.def.h st-0.8.1/config.def.h --- st-0.8.1.original/config.def.h 2018-03-20 22:29:59.000000000 +0200 +++ st-0.8.1/config.def.h 2018-04-24 01:23:49.669365424 +0300 @@ -118,7 +118,11 @@ static const char *colorname[] = { */ unsigned int defaultfg = 7; unsigned int defaultbg = 0; -static unsigned int defaultcs = 256; + +//static unsigned int defaultcs = 256; +static unsigned int defaultcs1 = 10; // green cursor +static unsigned int defaultcs2 = 9; // red cursor + static unsigned int defaultrcs = 257; /* diff -rupN st-0.8.1.original/x.c st-0.8.1/x.c --- st-0.8.1.original/x.c 2018-03-20 22:29:59.000000000 +0200 +++ st-0.8.1/x.c 2018-04-24 01:24:08.017487621 +0300 @@ -20,6 +20,15 @@ static char *argv0; #include "st.h" #include "win.h" +int get_scroll_lock() +{ + Display *dpy = XOpenDisplay(":0"); + XKeyboardState x; + XGetKeyboardControl(dpy, &x); + XCloseDisplay(dpy); + return !!(x.led_mask&4); +} + /* types used in config.h */ typedef struct { uint mod; @@ -1400,6 +1409,13 @@ xdrawglyph(Glyph g, int x, int y) void xdrawcursor(int cx, int cy, Glyph g, int ox, int oy, Glyph og) { + unsigned int defaultcs; + + if (get_scroll_lock()) + defaultcs=defaultcs2; + else + defaultcs=defaultcs1; + Color drawcol; /* remove the old cursor */