[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

Next revision
Previous revision
talk:howtos:window_managers:keyboard_layout_in_i3 [2012/09/25 04:27 (UTC)] – moved from the general howtos namespace mfillpottalk:howtos:window_managers:keyboard_layout_in_i3 [2014/04/26 12:07 (UTC)] (current) sycamorex
Line 3: Line 3:
 Removed from the TOC. It's part of the generic keyboard layout article --- //[[wiki:user:sycamorex|sycamorex]] 2012/08/26 15:49// Removed from the TOC. It's part of the generic keyboard layout article --- //[[wiki:user:sycamorex|sycamorex]] 2012/08/26 15:49//
 ------ ------
 +
 +setxkbmap already has many ways for changing layouts (man
 +xkeyboard-config and look at the change layout section)
 +
 +    setxkbmap -layout de,gb
 +    setxkbmap -option 'grp:ctrl_alt_toggle'
 +
 +is particularly useful when you only have two layouts you want to toggle with ctrl-alt
 +
 +However with this setup setxkbmap will not give the "current" layout.
 +The only way I could find to do that was to use xkblayout-state
 +
 +The new i3script.sh is: (for i3bar output)
 +
 +    #!/bin/bash
 +    i3status --config ~/.i3status.conf | while :
 +    do
 +            read line
 +            LG=$(xkblayout-state print %s)
 +            dat=" [{\"name\":\"layout\",\"full_text\":\"$LG\"}"
 +            echo "${line/[{/$dat,{}" || exit 1
 +    done
 +
 +NOTE: the original script that uses #!/bin/sh fails on some systems
 +where the default shell is not bash
 +
 +Thank you for your comments/updates - I will update the article next week - I like the method you shown above.  --- //[[wiki:user:sycamorex|Marcin Herda]] 2014/04/20 15:52//
 +
 +I had thought xkblayout-state was part of of stock Slackware. I'd rather keep everything with stock Slackware packages or packages avaiable through SB.org. I've just made a small change to shorten setxkbmap command as well as additional ways of changing layouts. --- //[[wiki:user:sycamorex|Marcin Herda]] 2014/04/26 04:41// 
 talk:howtos:window_managers:keyboard_layout_in_i3 ()