2023 06 01


Tags: x11 xorg linux
Reading time: less than 1 minute

Xorg un-capslock

I have CapsLock mapped to Control, but sometimes CapsLock turns on anyway. But with CapsLock mapped to Control, I can’t turn it off.

How can I turn CapsLock off from a script or from the command line?

It turns out this is not super straightforward. I was hoping for a single command, but it ended up being a little more involved. Here’s a short Python script that turns off CapsLock when executed. I have it saved as uncapslock.py, very creative.

#!/usr/bin/env python

from ctypes import *

class Display(Structure):
    """ opaque struct """

X11 = cdll.LoadLibrary("libX11.so.6")
X11.XOpenDisplay.restype = POINTER(Display)

display = X11.XOpenDisplay(c_int(0))
X11.XkbLockModifiers(display, c_uint(0x0100), c_uint(2), c_uint(0))
X11.XCloseDisplay(display)

LeoSearch

Started working on “LeoSearch”. It’s a tiny search engine I made for searching my bookmarks.

I inserted everything into a ClickHouse table, and implemented an inverted index and Okapi BM25 ranking. It’s pretty fast, and I’m happy with the results.

Citation

If you find this work useful, please cite it as:
@article{yaltirakli,
  title   = "2023 06 01",
  author  = "Yaltirakli, Gokberk",
  journal = "gkbrk.com",
  year    = "2024",
  url     = "https://www.gkbrk.com/journal/2023-06-01"
}
Not using BibTeX? Click here for more citation styles.
IEEE Citation
Gokberk Yaltirakli, "2023 06 01", October, 2024. [Online]. Available: https://www.gkbrk.com/journal/2023-06-01. [Accessed Oct. 19, 2024].
APA Style
Yaltirakli, G. (2024, October 19). 2023 06 01. https://www.gkbrk.com/journal/2023-06-01
Bluebook Style
Gokberk Yaltirakli, 2023 06 01, GKBRK.COM (Oct. 19, 2024), https://www.gkbrk.com/journal/2023-06-01

Comments

© 2024 Gokberk Yaltirakli