Created
November 30, 2024 23:06
-
-
Save gmdias727/8b217dcb30d023291674bb08dbb937f4 to your computer and use it in GitHub Desktop.
Add this to your .bashrc if you want a toggle function to switch between US and ABNT-2 keyboard layouts on linux.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function toggle_layout { | |
currentLayout=$(setxkbmap -query | grep layout | awk '{print $2}') | |
if [ "$currentLayout" == "br" ]; then | |
setxkbmap us && notify-send -t 1000 "Switched to US Layout" | |
else | |
setxkbmap br && notify-send -t 1000 "Switched to ABNT-2 Layout" | |
fi | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment