[2024-feb-29] Sad news: Eric Layton aka Nocturnal Slacker aka vtel57 passed away on Feb 26th, shortly after hospitalization. He was one of our Wiki's most prominent admins. He will be missed.
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revisionNext revisionBoth sides next revision | ||
howtos:window_managers:keyboard_layout_in_i3 [2012/09/25 04:28 (UTC)] – moved from the general howtos namespace mfillpot | howtos:window_managers:keyboard_layout_in_i3 [2014/04/26 12:07 (UTC)] – [Displaying the Active Layout in the Panel] sycamorex | ||
---|---|---|---|
Line 5: | Line 5: | ||
====i3 Window Manager==== | ====i3 Window Manager==== | ||
- | [[howtos: | + | [[howtos: |
====Setting the Keyboard Layout==== | ====Setting the Keyboard Layout==== | ||
Line 62: | Line 62: | ||
do | do | ||
read line | read line | ||
- | LG=$(setxkbmap -print | grep xkb_symbols | + | LG=$(setxkbmap -query | awk '/layout/{print $2}' |
echo "LG: $LG | $line" || exit 1 | echo "LG: $LG | $line" || exit 1 | ||
done</ | done</ | ||
- | The above will display the current keyboard layout before the standard i3status functions. Obviously you can add much more to [[howtos: | + | The above will display the current keyboard layout before the standard i3status functions. Obviously you can add much more to [[howtos: |
+ | |||
+ | === Using JSON output format (colors) === | ||
+ | The method above uses the simplest output mode (text only). Although easier to use, it lacks color support. For that, you'll need JSON. | ||
+ | |||
+ | Add the following property in your '' | ||
+ | |||
+ | < | ||
+ | output_format = i3bar | ||
+ | }</ | ||
+ | |||
+ | And replace your '' | ||
+ | |||
+ | < | ||
+ | |||
+ | i3status --config ~/ | ||
+ | do | ||
+ | read line | ||
+ | LG=$(setxkbmap -print | grep xkb_symbols | awk -F" | ||
+ | if [ $LG == " | ||
+ | then | ||
+ | dat=" | ||
+ | else | ||
+ | dat=" | ||
+ | fi | ||
+ | echo " | ||
+ | done</ | ||
===== Sources ===== | ===== Sources ===== |