Created
March 9, 2021 20:23
-
-
Save JTRNS/094cf95ee7179a4117c726734cb81537 to your computer and use it in GitHub Desktop.
write first, edit later
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# write first, edit later | |
# toggles the function of the backspace key between | |
# its normal function and that of the delete key | |
# Keycode might be different for other keyboards! | |
# to find the right keycode on your hardware use: | |
# xev -event keyboard | |
keyValue=$(xmodmap -pke | grep "keycode 22") | |
if [[ "$keyValue" =~ "BackSpace" ]]; then | |
echo "Typewriter mode activated" | |
xmodmap -e "keycode 22 = Delete" | |
else | |
echo "Typewriter mode disabled" | |
xmodmap -e "keycode 22 = BackSpace" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment