2014-03-12

La gestion des dispositions clavier

Étant un inconditionnel de Awesome comme gestionnaire de fenêtre, je n'ai pas les jolis outils gnome ou kde pour gérer le basculement entre dispositions clavier.
Pour palier ce manque j'utilise une combinaison de xxkb et setxkbmap.

Pour avoir une liste de dispositions disponibles j'ai ajouté ça dans mon .xsession :
setxkbmap -option "" -option "grp:rctrl_toggle,grp_led:scroll" -layout "ca,fr(bepo),fr"
(Au passage, cette commande permet d'alterner entre les deux dispositions les plus récentes avec la touche Ctrl de droite)

Pour démarrer xxkb, j'ajoute ça dans mon fichier de configuration de Awesome (rc.lua) :
awful.util.spawn_with_shell("sleep 3 && killall xxkb ; xxkb &")

ma config pour xxkb (~/.xxkbrc) :
XXkb.mainwindow.enable: yes
XXkb.mainwindow.appicon: no
XXkb.mainwindow.type: tray
XXkb.mainwindow.in_tray: yes
XXkb.mainwindow.geometry: 16x16+0+0
XXkb.mainwindow.label.enable: yes
XXkb.mainwindow.label.text.1: Qc
XXkb.mainwindow.label.text.2: Fr
XXkb.mainwindow.label.text.3: Be
XXkb.mainwindow.label.background: black
XXkb.mainwindow.label.foreground: #569892
XXkb.mainwindow.label.font: -misc-*-r-*-15-*
XXkb.button.enable: no
XXkb.controls.add_when_start: no
XXkb.controls.add_when_create: no
XXkb.controls.add_when_change: no

Et voilou.
Il faut bien faire correspondre l'ordre des layouts déclarés dans la commande setxkbmap et dans le fichier de config de xxkb, après c'est tout bon. Juste à cliquer sur l'icone de xxkb dans le système tray et hop la disposition change.