From Krayon, 6 Years ago, written in Bash.
This paste is a reply to from - view diff
Embed
  1. #!/bin/bash
  2.  
  3. [ "${1}" == "-u" ] && setxkbmap us && exit 0
  4. [ "${1}" == "-r" ] && setxkbmap ru && exit 0
  5.  
  6. # Assume toggle
  7.  
  8. cur="$(setxkbmap -query|grep layout:|awk '{print $2}')"
  9.  
  10. [ "${cur}" == "ru" ] && setxkbmap us && exit 0
  11. [ "${cur}" == "us" ] && setxkbmap ru && exit 0
  12.  
  13. # vim:ts=4:tw=80:sw=4:et:ai:si