Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

What is the proper place for setxkbmap command in Xfce? What is the proper place for it in general - other DEs and bare WMs? I have the following command:

setxkbmap -layout "us(colemak), ru(typewriter)" -option "grp:menu_toggle"

Putting it in .xsession didn't work. I want to make this command run, to make it work globally in GUI.

Edit (18.09.12): I went xfce4-settings-manager -> Session and Startup -> Application Autostart, then clicked "Add". There i tried to put two commands to make it work.

  1. The full setxkbmap command that i gave above verbatim under "Command".

  2. Created an executable file with the command in my PATH, put the file name under "Command".

Both variants didn't work. However the full path to the executable file with the command under "Command" text field worked.

share|improve this question
up vote 2 down vote accepted

You can do this:

cp /etc/xdg/xfce4/xinitrc ~/.config/xfce4/xinitrc

Then edit that file you just copied to and add anything you want. Your script will take precedence over the system one.

Take heed of the comments, however, since session manager will take over and any part of the script that comes after it won't be executed. Put your line somewhere before that.

However, if might also work to open the settings manager and select Keyboard, and Layout tab. Try making changes there. But I'm not sure you can do there what you need.

share|improve this answer


You can put that as an autostart command, in xfce4-settings-manager -> Startup, and add a command (If you launch X with startx command, just put that line in ~/.xinitrc)

Or put the corresponding xkbconfig in Xorg.conf, e.g /etc/X11/xorg.conf.d/XX.conf, with the following

Section "InputClass"
    Identifier "Keyboard Options by default"
    MatchIsKeyboard "on"

    Option "XkbLayout" "us , ru"
    Option "XkbOptions" "grp:menu_toggle"
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.