Skip to content

Instantly share code, notes, and snippets.

View johanwiden's full-sized avatar

Johan Widén johanwiden

  • Sollentuna, Sweden
View GitHub Profile
@johanwiden
johanwiden / gist:6fce3cb78e42405ad0b1b659bfcff53c
Last active October 15, 2025 09:47
kanata configuration for sticky modifier keys
One can use https://github.com/jtroo/kanata to remap or modify keyboard keys.
What follows is a configuration to make the modifier keys sticky.
The modifier keys are: Control keys, Shift keys, Alt keys, WinKey/Super/Meta key, Caps Lock.
They now work in two ways:
- As before one can hold down modifier keys, and tap other keys, to get e.g. Ctrl-a
- One can now also just tap modifier keys, followed by tapping an ordinary key.
- There is a timeout for how long the tap of a modifier key is valid, here configured to two seconds.
- Tapping the WinKey/Super/Meta key is usually handled specially in e.g. Ubuntu. This functionality is not lost, but is
delayed until the timeout.

Notes on my evaluation of SilverDict https://github.com/Crissium/SilverDict I hope to be able to use SilverDict instead of GoldenDict in android Termux (emacs paw).

Plan

  • Evaluate server, client and access via curl, on Linux desktop.
  • With server on Linux, evaluate access via curl from Android Termux.
  • With server on Linux, evaluate access from emacs paw on Linux.
  • With server on Linux, evaluate access from emacs paw on Android.
  • With server on Android, evaluate access from emacs paw on Android.
  • With server on Windows, evaluate access from emacs paw on Android.
@johanwiden
johanwiden / how-to-configure-syncthing-for-android.md
Last active November 9, 2025 20:55
How to configure Syncthing for Android

Syncthing is a tool for synchronising folders between computers, and also Android devices. This gist is about how to install and configure Syncthing on an Android device, so that it works as expected. For instructions about how to install and configure Syncthing on computers, you will have to look elsewhere. Also for how to configure folder synchronisation. Below I describe necessary configuration on Android, that I could not easily find by googling:

  • I have only tested the following on a OnePlus running OxygenOS 14.0, and on a Samsung Galaxy Tab S8 running Android 14.
  • I have only succeeded in synchronizing folders in the internal storage, under /storage/emulated/0, for example /storage/emulated/0/Documents/notes.
  • I have not been able to get Syncthing to recognize a folder on an sdcard, the folders there are owned by root, which might be a hindrance. I believe the base problem is that sdcards have a DOS file system, not a modern file system. Note that I am using the Android Synct
@johanwiden
johanwiden / sway_screenlock_warning.org
Last active December 20, 2023 16:51
How to be warned before Sway locks the screen

Sway Screenlock Warning

When using the Sway window manager: How to be warned before inactivity timeout locks the screen.

I first describe a setup that works with the official swaylock. This displays a notification for some seconds before the screen is locked.

I then describe a setup that requires installation of a fork of swaylock. This warns by gradually dimming the screen before it is locked. This can of course be combined with the warning notification.

Warn by showing a notification

In the sway config file, enable locking of screen on inactivity timeout:

@johanwiden
johanwiden / debug_android_emacs_with_lldb.org
Last active August 28, 2023 15:26
How to debug Android emacs using lldb

I describe:

  • How to build Android emacs with debug symbols.
  • How to install it on the Android device.
  • How to start lldb-server on the Android device, how to configure lldb, and connect it to lldb-server.
  • Some simple lldb commands, to get you up to speed.
  • A potential pitfall, when looking at global variables in emacs.
  • Some things I have not needed to enable in lldb.

Some useful references for lldb are listed.