Calling setxkbmap when starting X

George Allan d1945 at sbcglobal.net
Sat Sep 16 16:17:37 PDT 2006


On Sun, Sep 17, 2006 at 12:30:37AM +0300, Ivan Rambius Ivanov wrote:
> I am from Bulgaria and I use Bulgarian language on my FreeBSD machine.
> I use the following command
> 
> $ setxkbmap -model pc105 -layout "us,bg" -variant ",phonetic" -option
> "grp:alt_shift_toggle"
> 
> to enable both Bulgarian and English. However, I call this command
> every time I log in KDE. Is it possible to invoke it automatically
> when X is started?

I think what you're looking for is xinit(1).  My own:

$ cat ~/.xinitrc
#!/bin/sh
xmodmap .xmodmaprc
xsetroot -solid dimgray
xgamma -gamma 0.8
exec /usr/X11R6/bin/gnome-session

Note also you can also define keyboard settings in rc.conf:

$ grep keymap /etc/rc.conf
keymap="us.iso.kbd.custom"

My own custom keymap is a quick hack to swap the Caps_Lock key with 
Escape for non-X uses (something that only vi users would appreciate).

Alternatively, KDE, like Gnome, etc. most likely offers a mechanism to 
execute scripts at startup, but I'd advise against that approach.

Hope that helped.


More information about the freebsd-questions mailing list