#!/bin/bash current_layout=$(setxkbmap -query | awk '/variant/{print $2}') if [[ "$current_layout" == "dvorak" ]]; then setxkbmap -layout us -option caps:swapescape notify-send "Keyboard Layout" "Switched to QWERTY" else setxkbmap -layout us -variant dvorak -option caps:swapescape notify-send "Keyboard Layout" "Switched to Dvorak" fi