[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.
Both sides previous revisionPrevious revisionNext revision | Previous revisionLast revisionBoth sides next revision | ||
howtos:window_managers:keyboard_layout_in_i3 [2012/09/25 04:29 (UTC)] – updated internal links mfillpot | howtos:window_managers:keyboard_layout_in_i3 [2014/04/26 12:17 (UTC)] – [Sources] sycamorex | ||
---|---|---|---|
Line 38: | Line 38: | ||
Now < | Now < | ||
+ | |||
+ | < | ||
+ | setxkbmap -layout de,gb | ||
+ | setxkbmap -option ' | ||
+ | This will let you toggle between the two layouts using < | ||
+ | </ | ||
====Displaying the Active Layout in the Panel==== | ====Displaying the Active Layout in the Panel==== | ||
Line 55: | Line 61: | ||
The contents of i3script.sh | The contents of i3script.sh | ||
- | < | + | < |
# shell scipt to prepend i3status with more stuff | # shell scipt to prepend i3status with more stuff | ||
Line 62: | Line 68: | ||
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 -query | awk '/ | ||
+ | if [ $LG == " | ||
+ | then | ||
+ | dat=" | ||
+ | else | ||
+ | dat=" | ||
+ | fi | ||
+ | echo " | ||
+ | done</ | ||
+ | |||
===== Sources ===== | ===== Sources ===== | ||
* Originally written by [[wiki: | * Originally written by [[wiki: | ||
+ | * Contributions by Anonymous | ||
<!-- If you are copying information from another source, then specify that source --> | <!-- If you are copying information from another source, then specify that source --> |