Skip to content

Instantly share code, notes, and snippets.

@Archenoth
Created March 3, 2020 17:41
Show Gist options
  • Save Archenoth/1cea9f69a61d318de9ee7e4dc7b1f67d to your computer and use it in GitHub Desktop.
Save Archenoth/1cea9f69a61d318de9ee7e4dc7b1f67d to your computer and use it in GitHub Desktop.
A Termux keymap switcher
#!/bin/sh
KEYMAP=$1
if [ -z "$KEYMAP" ]; then
KEYMAP=default
fi
if [ -f "$HOME/.termux/keymaps/$KEYMAP.properties" ]; then
echo "Setting keymap: $KEYMAP"
rm "$HOME/.termux/termux.properties"
ln -s "$HOME/.termux/keymaps/$KEYMAP.properties" "$HOME/.termux/termux.properties"
termux-reload-settings
exit $?
else
echo "Invalid keymap $KEYMAP, valid keymaps include:"
ls "$HOME/.termux/keymaps/"
exit 1
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment