[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.

Welcome to the Slackware Documentation Project

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
howtos:window_managers:keyboard_layout_in_i3 [2014/04/26 12:07 (UTC)] – [Displaying the Active Layout in the Panel] sycamorexhowtos: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:window_managers:i3wm|i3wm]] does not come with stock Slackware. If you want to install this extremely configurable tiling window manager, please visit [[http://slackbuilds.org/repository/13.37/desktop/i3/|SlackBuilds]]. Make sure you also install [[http://slackbuilds.org/repository/13.37/desktop/i3status/|i3status]], which will let you display all sorts of useful information in a panel.+[[howtos:window_managers:i3wm|i3wm]] does not come with stock Slackware. If you want to install this extremely configurable tiling window manager, please visit [[http://slackbuilds.org/repository/14.2/desktop/i3/|SlackBuilds]]. Make sure you also install [[http://slackbuilds.org/repository/14.2/desktop/i3status/|i3status]], which will let you display all sorts of useful information in a panel.
  
 ====Setting the Keyboard Layout==== ====Setting the Keyboard Layout====
Line 38: Line 38:
  
 Now <key>MS+d</key> and <key>MS+g</key> let me switch between the UK and German keyboard layouts. Now <key>MS+d</key> and <key>MS+g</key> let me switch between the UK and German keyboard layouts.
 +
 +<note>If you usually switch between two keyboard layouts and you don't need to display the current layout in the status bar, you might also place the following code in your ''~/.i3/config'' file:
 +  setxkbmap -layout de,gb
 +  setxkbmap -option 'grp:ctrl_alt_toggle'
 +This will let you toggle between the two layouts using <key>Ctrl</key>+<key>Alt</key>.
 +</note>
  
 ====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
  
-<code>#!/bin/sh+<code>#!/bin/bash
  
 # shell scipt to prepend i3status with more stuff # shell scipt to prepend i3status with more stuff
Line 79: Line 85:
 And replace your ''i3script.sh'' for the code below. It displays your default language in green (in the example, ''br'') and any other language in red. And replace your ''i3script.sh'' for the code below. It displays your default language in green (in the example, ''br'') and any other language in red.
  
-<code>#!/bin/sh+<code>#!/bin/bash
  
 i3status --config ~/.i3status.conf | while : i3status --config ~/.i3status.conf | while :
 do do
     read line     read line
-    LG=$(setxkbmap -print | grep xkb_symbols | awk -F"+" '{print $2}')+    LG=$(setxkbmap -query | awk '/layout/{print $2}')
     if [ $LG == "br" ]     if [ $LG == "br" ]
     then     then
Line 97: Line 103:
 ===== Sources ===== ===== Sources =====
   * Originally written by [[wiki:user:sycamorex]]   * Originally written by [[wiki:user:sycamorex]]
 +  * 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 -->
 howtos:window_managers:keyboard_layout_in_i3 ()