Enjoy Slackware 15.0!
Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
howtos:window_managers:keyboard_layout_in_i3 [2012/09/25 04:29 (UTC)] mfillpot updated internal links |
howtos:window_managers:keyboard_layout_in_i3 [2021/08/08 22:23 (UTC)] (current) carriunix |
||
---|---|---|---|
Line 5: | Line 5: | ||
====i3 Window Manager==== | ====i3 Window Manager==== | ||
- | [[howtos: | + | [[howtos: |
====Setting the Keyboard Layout==== | ====Setting the Keyboard Layout==== | ||
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 --> |