Skip to content

Instantly share code, notes, and snippets.

@MurzNN
Created February 21, 2021 16:26
Show Gist options
  • Save MurzNN/b3b62d3fdd51bb65226f60e51cf09984 to your computer and use it in GitHub Desktop.
Save MurzNN/b3b62d3fdd51bb65226f60e51cf09984 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