Solved Keymap changed on resume

Crivens

Moderator
Staff member
Moderator

Reaction score: 1,648
Messages: 2,514

Hi all.
Since my machine now S3-s fine, I got aware of the keymap being qwerty on resume. Am I the only one? And - how to fix it? The keymap is set in /etc/rc.conf as by installer.
 
OP
Crivens

Crivens

Moderator
Staff member
Moderator

Reaction score: 1,648
Messages: 2,514

Important point: this happens when there is a USB keyboard when resuming.
 

jbodenmann

Well-Known Member

Reaction score: 142
Messages: 306

I might be of very little help here as I only recently starting using FreeBSD in a desktop environment but might still be worth a shot: I have this in my ~/.xinitrc:
Code:
setxkbmap us intl
(Adapt to the keymap of your choosing)

Resuming from S3 works fine and they keymap remains the same.
 

Menelkir

Well-Known Member

Reaction score: 330
Messages: 268

Maybe forcing a keyboard configuration with something like that in /usr/local/etc/X11/xorg.conf.d:

Code:
Section "InputClass"       
    Identifier "system-keyboard"       
    MatchIsKeyboard "on"       
    Option "XkbLayout" "us"       
    Option "XkbModel" "logitech_g15"       
    Option "XkbVariant" "intl"
EndSection
 
OP
Crivens

Crivens

Moderator
Staff member
Moderator

Reaction score: 1,648
Messages: 2,514

Ah, it is not resume messing up. It is the attaching of a keyboard that does it.
Press key: Z
Attach keyboard
Same key: Y
 
Last edited:

jbodenmann

Well-Known Member

Reaction score: 142
Messages: 306

I have no idea how to handle this correctly but one thing that comes to mind is writing a devd rule which will invoke setxkbmap upon receiving the corresponding notification.
 
OP
Crivens

Crivens

Moderator
Staff member
Moderator

Reaction score: 1,648
Messages: 2,514

I tried that with the resume script. The problem is that you can't control the X server from there.
Cannot open display "default display"
 
OP
Crivens

Crivens

Moderator
Staff member
Moderator

Reaction score: 1,648
Messages: 2,514

Maybe forcing a keyboard configuration with something like that in /usr/local/etc/X11/xorg.conf.d:

Code:
Section "InputClass"      
    Identifier "system-keyboard"      
    MatchIsKeyboard "on"      
    Option "XkbLayout" "us"      
    Option "XkbModel" "logitech_g15"      
    Option "XkbVariant" "intl"
EndSection
That did it. I didn't even need to change the model :)
 
Top