Solved Setxkbmap .xinitrc

I need some little help. How to syntax setxkbmap on .xinitrc to have us and gr layouts and change them with alt+shift on a window manager?
I tried that:
Code:
setxkbmap -layout "us,gr"  -option "grp:alt_shift_toggle"
but didn't work
 
Re: Setxkbmap .xinitrc

You could have a number of problems. If the command runs from a terminal it would suggest that the syntax of your ~/.xinitrc is incorrect. The Arch Linux wiki indicates that some desktop's will override the settings.

I would start by running the command in a terminal to verify that the code functions. If it does review your ~/.xinitrc and post it here. The Arch wiki also gives an alternative with /etc/X11/xorg.conf.d/10-keyboard.conf but setxkbmap seems to be the most straight forward if you are running a simple window manager.
 
Re: Setxkbmap .xinitrc

I found it! I created a folder named xorg.conf.d into /etc/X11. Then I created a file named 10-keyborad.conf and add this line:

Code:
Section "InputClass"
        Identifier "system-keyboard"
        MatchIsKeyboard "on"
        Option "XkbLayout" "us,gr"
        Option "XkbModel" "pc105"
        Option "XkbOptions" "grp:ctrl_alt_toggle"
EndSection

Now using control+alt I can switch to Greek on dwm window manager :beergrin
 
Top