Here is my homemade keyboard layout changer for i3blocks1.
Recipe
Add this to i3 blocks configuration which is in the ~/.config/i3blocks/config
1 2 3 |
[keyboard] full_text=us command=./i3_scripts/layout-switch.sh |
Main script
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
#!/bin/bash CURRENTLAYOUT=$(setxkbmap -print | awk -F"+" '/xkb_symbols/ {print $2}') # echo $CURRENTLAYOUT if [[ "$CURRENTLAYOUT" == "us" ]]; then setxkbmap -layout tr; setxkbmap -option "ctrl:nocaps" echo tr exit 0 fi if [[ "$CURRENTLAYOUT" == "tr" ]]; then setxkbmap -layout us; setxkbmap -option "ctrl:nocaps" echo us exit 0 fi |