Fixing Line Editing on Android 8.0+

Recently I’ve been working on a toy that launches an REPL in adb shell, which would be more comfortable to use if it has the line editing functionality similar to bash. After some research, I found that actually there are a number of line editing libraries available, so it should be a nice and easy addition. However, after some integration work, I was surprised to find that all these libraries (e.g. jline3, linenoise (which was also once imported into AOSP)) only worked on older versions of Android, that is, until Android 8.0.

继续阅读


Remapping ThinkPad Keys with udev hwdb

ThinkPad T series (also X1 Carbon) laptops have a great keyboard that I’ve been using delightfully for years. However, there’s a minor issue with its keyboard layout: they replaced the Menu key with a PrtSc. In my day to day work, I almost always accidentally hit that key while using my lovely Ctrl and Alt keys, upon which my laptop happily plays a shatter sound, flashes my screen white for a split second and spawns a screenshot file under my Pictures/ (thank you, GNOME). Whereas when I wanted to use my Menu key, it’s nowhere to be found.

However, there’s still an Insert key lying quietly in the top-right corner, which I never used (except for checking if some app even supports it). So why not make my old Insert PrtSc and my old PrtSc the new Menu?

Moreover, there are also 4 special keys (Fn + F9F12) that could have been my media keys, but are by default strange things like Settings and Search. Why not map them to media keys as well?

继续阅读




Arch Linux Notes

This is my notebook for some small tips and tricks when using Arch Linux.

Why Arch Linux?

  • It is fresh and simple in package dependency.

  • It has a powerful Arch User Repository and makes it easy for you to make/modify your package.

  • It has a detailed Arch Wiki comprising useful experiences and recommendations.

  • It gets you to learn the basic knowledge required to be a Linux user/administrator/programmer.

继续阅读