  } Arg;
  
  void die(const char *, ...);
-+void redrawcursor(void);
++void redrawcursor(int);
  void redraw(void);
  void draw(void);
  

index cee7c50..8df71f8 100644
--- i/x.c
+++ w/x.c
@@ -2061,6 +2061,14 @@ focus(XEvent *ev)
 		xseturgency(0);
 		if (IS_SET(MODE_FOCUS))
 			ttywrite("\033[I", 3, 0);
+		XkbStateRec xkbstate;
+		if (XkbGetState(xw.dpy, XkbUseCoreKbd, &xkbstate) == Success) {
+			int grp = xkbstate.group;
+			if (grp < 0 || grp > 3)
+				die("Xkb unlikely invalid lang group: %d\n", grp);
+			defaultcs = xkbbasecolor + grp;
+			redrawcursor();
+		}
 	} else {
 		if (xw.ime.xic)
 			XUnsetICFocus(xw.ime.xic);
@@ -2248,6 +2248,20 @@ run(void)
 	FcPatternGetDouble(dc.font.match->pattern, FC_SIZE, 0, &defaultrelfontsize);
 	refreshxrandr(0);
 

index a1e7d23..27a1a57 100644
--- i/st.c
+++ w/st.c
@@ -2755,6 +2755,24 @@ draw(void)
 		xximspot(term.ocx, term.ocy);
 }
 
+void
+redrawcursor(int grp)
+{
+	// DEBUG: fprintf(stderr, "Xkb lang group[0-3]: %d\n", grp);
+	if (grp < 0 || grp > 3)
+		die("Xkb unlikely invalid lang group: %d\n", grp);
+	if (defaultcs == xkbbasecolor + grp)
+		return;  // NOTE: prevent unnecessary redraw
+	// MAYBE:ENH: map color to lang code "en" instead of index
+	//   SEE: libkbdd.c:569: _kbdd_group_names_initialize
+	defaultcs = xkbbasecolor + grp;
+	if (!xstartdraw())
+		return;
+	xdrawcursor(term.c.x, term.c.y, term.line[term.c.y][term.c.x],
