Skip to content

Instantly share code, notes, and snippets.

@fomigo
Forked from MurzNN/.xbindkeysrc
Created August 12, 2021 05:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fomigo/e87062e02432ceed76b395f66dc70aba to your computer and use it in GitHub Desktop.
Save fomigo/e87062e02432ceed76b395f66dc70aba to your computer and use it in GitHub Desktop.
Changing keyboard layout in Linux KDE + Electron apps via Alt+Shift workaround
# Add this to file in home folder
"~/bin/layout-switch.sh"
Alt + Shift_L
#!/bin/bash
# Place this file to ~/bin/layout-switch.sh
LAYOUT_CURRENT=$(setxkbmap -print | awk -F + '/xkb_symbols/ {print $2}')
if [ "$LAYOUT_CURRENT" == "ru" ]; then
/usr/bin/setxkbmap us,ru
else
/usr/bin/setxkbmap ru,us
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment