old-dotfiles/bin/switchkblayout

15 lines
286 B
Bash
Executable File

#!/usr/bin/env bash
key=`setxkbmap -query | grep layout | awk '{print $2}'`
if [[ $key == "fr" ]]; then
setxkbmap us
elif [[ $key == "us" ]]; then
setxkbmap dvorak
else
setxkbmap fr
fi
key=`setxkbmap -query | grep layout | awk '{print $2}'`
notify-send "Keyboard Layout: $key"