2

I've recently installed i3 on my Ubuntu Gnome (15.04) computer (using these instructions). i3 is working fine and I can select it in GDM when i log in. But the problem is that when I log into i3 my keyboard layout change to the US layout, which I don't use (not even on my gnome settings). I've tried adding the following to my .config/i3/config file:

# Set keyboard layout
#exec --no-startup-id "setxkbmap se dvorak" 
#exec --no-startup-id ~/.script/keyboard.sh
#exec --no-startup-id "setxkbmap -layout se -variant dvorak"
exec_always --no-startup-id "/usr/bin/setxkbmap se dvorak"

All these with comments (#) have I tried but to no success.

And I've also tried adding a script to gnome-session-properties but that didn't work either. The script is below:

#!/bin/bash
setxkbmap se dvorak 

The script have the following ls output:

 -rwxrwxr-x 1 username username 34 dec  9 19:32 .scripts/keyboard.sh

The layout I want to be set when I log in is the swedish version of dvorak, svorak.

When I log into i3 i can type the line below into a terminal and everything works fine until i logout/reboot, but it's bothering me that I can't set this permanently.

setxkbmap se dvorak 

Edit (some additional information):

If I execute setxkbmap -query and setxkbmap -print after I've logged into i3 the following is shown:

rules:      evdev
model:      tm2030USB-102
layout:     us
options:    grp_led:scroll

and

xkb_keymap {
    xkb_keycodes  { include "evdev+aliases(qwerty)" };
    xkb_types     { include "complete"  };
    xkb_compat    { include "complete+ledscroll(group_lock)"    };
    xkb_symbols   { include "pc+us+inet(evdev)" };
    xkb_geometry  { include "typematrix(tm2030USB-102)" };
};
7
  • Is it possible that the keyboard is modified by another automatically started command, for example gnome-settings-daemon?
    – Adaephon
    Dec 10, 2015 at 6:51
  • @Adaephon I think it might have something to do with the gnome (or gdm) defaults. But I can't figure out how to disable or change what layout is set as default. I've disabled org.gnome.settings-daemon.plugins.keyboard , but that made no difference.
    – phiip
    Dec 10, 2015 at 10:36
  • 1
    It has to be something that is run at the time i3 starts up because you can set the layout with setxkbmap later on without it being reverted. The i3 configuration (with all alternatives) looks fine, so in all likelihood the settings are made but are then overwritten just a moment later by something else. This should exclude GDM as cause. Are you starting anything else in your i3-config or perhaps from ~/.xprofile or ~/.xsession (also ~/.Xsession) that may have anything to do with that? What processes are running immediately after login (output of ps -aux)?
    – Adaephon
    Dec 15, 2015 at 12:55
  • @Adaephon you led me in the right direction. I had nothing in my .x - files except in .xprofile (where i had setxkbmap se dvorak ). But, when i ran ps -aux I noticed that ibus (among other processes) ran, which (after some googling) I understood that this might have something to do with my strange keyboard behavior. So after I ran the command ibus-setup I could change my keyboard to Svorak, and now everything works exactly as I want. Much much thanks to you @Adaephon!
    – phiip
    Dec 16, 2015 at 21:12
  • @Adaephon can I mark your tip as a solution or do I (or you) answers my question so that I can mark this as solved? Thanks again!
    – phiip
    Dec 16, 2015 at 21:17

1 Answer 1

7

I ran the command ps -aux after I logged in to see all the processes that ran after I logged in. By checking the output of ps -aux I saw that ibus ran after I logged in.

Apparently, GNOME installs ibus by default (source), and ibus was to blame for changing my keyboard layout.

To change the input layout for ibus, I ran the command ibus-setup and went to tab "Input Method" and added "Swedish - Swedish (Dvorak)" as my only input method. After logging out and in again I now use Svorak directly when I log in.

2
  • I have the same problem. But ibus is always overwriting my changes. I hope i can find the cause for that stupid behaviour. Otherwise after every login i have to change the keyboard layout and restart ibus.
    – Strubbl
    Feb 11, 2016 at 9:13
  • I disabled the option by disabling "Use system keyboard layout" option in Preference -> Advanced. Now ibus is in control and sets the correct layout.
    – Strubbl
    Feb 11, 2016 at 9:33

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .