You are not logged in.

#1 2013-04-12 08:02:47

Zack7777
Member
From: Germany
Registered: 2012-04-06
Posts: 25

[SOLVED]Automatically execute setxkbmap at GDM startup.

Hi all.


I am having a trouble with setting appropriate keyboard layout and switching. I am really tired of broken gnome 3 layout functionality and it seems that developers just don't care about usability anymore. So I decided to switch to kbdd+setxkbmap. I've managed to get kbdd running at startup with .xprofile but setting " setxkbmap -layout "us,ru(winkeys)" -model pc105 -option grp:alt_shift_toggle,compose:menu " won't work, no matter where I place it.

I've tried these files:
1 - ~/.xinitrc
2 - ~/.xprofile
3 - /etc/gdm/Init/Default (at the end of file before exit)


After reboot and login I cannot change layout until I explicitly input setxkbmap to the terminal. KBDD starts just fine from .xprofile under my user.

What am I doing wrong here?

Thanks.

Last edited by Zack7777 (2013-04-18 08:07:33)

Offline

#2 2013-04-12 11:36:11

koshak
Member
Registered: 2013-03-13
Posts: 35

Re: [SOLVED]Automatically execute setxkbmap at GDM startup.

have you tried pushing these settings to /etc/X11/xorg.conf.d/10-evdev.conf
https://wiki.archlinux.org/index.php/Gd … S-keyboard

or create /etc/X11/xorg.conf.d/01-keyboard-layout.conf
https://wiki.archlinux.org/index.php/Xo … rd_layouts

Offline

#3 2013-04-12 13:00:46

Zack7777
Member
From: Germany
Registered: 2012-04-06
Posts: 25

Re: [SOLVED]Automatically execute setxkbmap at GDM startup.

Didn't work for me.
For the first link I've found comments that this solution only works for 2.x.

For the second - my conf:
Section "InputClass"
         Identifier             "keyboard-layout"
         MatchIsKeyboard        "on"
         Option "XkbLayout"     "us, ru(winkeys)"
         Option "XkbOptions"    "grp:alt_shift_toggle,compose:menu"
EndSection

Last edited by Zack7777 (2013-04-12 13:17:52)

Offline

#4 2013-04-12 14:18:21

Inxsible
Forum Fellow
From: Chicago
Registered: 2008-06-09
Posts: 9,183

Re: [SOLVED]Automatically execute setxkbmap at GDM startup.

Zack7777 wrote:

I've tried these files:
1 - ~/.xinitrc
2 - ~/.xprofile
3 - /etc/gdm/Init/Default (at the end of file before exit)

Gnome doesn't source .xinitrc file. That's why it doesn't work. No idea about xprofile and the Default file --- haven't used any DE in the last 7 years


I set my dvorak layout in the 10-evdev.conf file using

Option XkbVariant dvorak

You could try something on similar lines like

Option "XkbLayout" "us, ru"
Option "XkbVariant" ", winkeys"

Forum Rules

There's no such thing as a stupid question, but there sure are a lot of inquisitive idiots !

Offline

#5 2013-04-12 15:01:18

Zack7777
Member
From: Germany
Registered: 2012-04-06
Posts: 25

Re: [SOLVED]Automatically execute setxkbmap at GDM startup.

Hey, Inxsible.

Thanks for reply. I'll be able to test it on monday. Will provide feedback.

Offline

#6 2013-04-12 18:42:58

10PinkPanther
Member
From: Croatia
Registered: 2012-11-10
Posts: 374

Re: [SOLVED]Automatically execute setxkbmap at GDM startup.

I use i3 and herbstluftwm and for croatian layout I put "setxkbmap hr" in my .bashrc and it works fine.

Offline

#7 2013-04-15 06:48:08

Zack7777
Member
From: Germany
Registered: 2012-04-06
Posts: 25

Re: [SOLVED]Automatically execute setxkbmap at GDM startup.

Inxsible, I tried to use 10-evdev.conf, here is what I have there for keyboard:

Section "InputClass"
        Identifier "evdev keyboard catchall"
        MatchIsKeyboard "on"
        MatchDevicePath "/dev/input/event*"
        Driver "evdev"
    Option "XkbLayout" "us, ru"
    Option "XkbVariant" ", winkeys"
    Option "XkbOptions" "grp:alt_shift_toggle,compose:menu"
EndSection

After reboot alt+shift just don't do anything. Any ideas?

10PinkPanther, your way is workaround, actually, I am sure it will work,  but best choice is to make it right.

Offline

#8 2013-04-15 12:28:24

don_crissti
Member
Registered: 2009-03-17
Posts: 35

Re: [SOLVED]Automatically execute setxkbmap at GDM startup.

gnome-settings-daemon overrides your xkb settings. Do it via gnome tools, i.e. gsettings or dconf-editor:

Last edited by don_crissti (2013-04-15 14:11:09)

Offline

#9 2013-04-15 12:48:17

Zack7777
Member
From: Germany
Registered: 2012-04-06
Posts: 25

Re: [SOLVED]Automatically execute setxkbmap at GDM startup.

I've already tried to place options there. No effect.

Last edited by Zack7777 (2013-04-16 06:59:26)

Offline

#10 2013-04-15 13:53:43

Inxsible
Forum Fellow
From: Chicago
Registered: 2008-06-09
Posts: 9,183

Re: [SOLVED]Automatically execute setxkbmap at GDM startup.

please make sure you follow the image posting guidelines as listed in our forum etiquette.


Forum Rules

There's no such thing as a stupid question, but there sure are a lot of inquisitive idiots !

Offline

#11 2013-04-15 14:14:05

don_crissti
Member
Registered: 2009-03-17
Posts: 35

Re: [SOLVED]Automatically execute setxkbmap at GDM startup.

@Zack: I forgot that grp...toggle in dconf xkb-options no longer works in recent gnome versions. Set it through gnome-tweak-tool > Typing > Modifiers-only input sources switcher-shortcut.

Offline

#12 2013-04-15 17:12:01

anonymous_user
Member
Registered: 2009-08-28
Posts: 3,059

Re: [SOLVED]Automatically execute setxkbmap at GDM startup.

Instead of ~/.xinitrc, try using ~/.xsession instead and tell GDM to load your xsession.

Offline

#13 2013-04-16 06:59:11

Zack7777
Member
From: Germany
Registered: 2012-04-06
Posts: 25

Re: [SOLVED]Automatically execute setxkbmap at GDM startup.

Inxsible, sorry if I broke some rules.

anonymous_user, tried that. Didn't work for me.

don_crissti, no, this is the very reason I am doing all this crap - I don't want to use this "feature" of tweak tool. It breaks basic functionality, e.g. when I'm in LibreOffice and switched to "ru" layout, I can't even use ctrl+c/ctrl+v.

Offline

#14 2013-04-18 08:07:08

Zack7777
Member
From: Germany
Registered: 2012-04-06
Posts: 25

Re: [SOLVED]Automatically execute setxkbmap at GDM startup.

Ok, problem solved.
You can laugh, but I switched to KDE.
After 5 years I finally did it.

Offline

#15 2013-04-18 11:27:53

10PinkPanther
Member
From: Croatia
Registered: 2012-11-10
Posts: 374

Re: [SOLVED]Automatically execute setxkbmap at GDM startup.

I thought you said you want to make it right and not use workarounds?

Offline

#16 2013-04-18 12:04:51

Zack7777
Member
From: Germany
Registered: 2012-04-06
Posts: 25

Re: [SOLVED]Automatically execute setxkbmap at GDM startup.

Oh, and I did. smile

Offline

#17 2013-09-23 17:35:55

OzQu
Member
Registered: 2013-09-23
Posts: 1

Re: [SOLVED]Automatically execute setxkbmap at GDM startup.

A bit old topic but I solved same problem by using

localectl set-x11-keymap fi

I found this from https://wiki.archlinux.org/index.php/Ke … _localectl

Offline

#18 2017-09-27 14:47:41

arti74
Member
From: Poland
Registered: 2009-10-21
Posts: 27

Re: [SOLVED]Automatically execute setxkbmap at GDM startup.

@ OzQu
Works for me too - nice find, thanks.

Offline

#19 2017-09-27 15:02:29

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 23,240

Re: [SOLVED]Automatically execute setxkbmap at GDM startup.

This isn't really that special and mentioned on most current guides. This thread is however 4 years old, please don't necrobump.

Closing.

Offline

Board footer

Powered by FluxBB