On 12/20/2012 02:33 AM, Juan Francisco Cantero Hurtado wrote:
On Wed, Dec 19, 2012 at 02:49:12PM -0800, Raymond Lillard wrote:
Hello Misc,
I am running -current (amd64) on a Lenovo w500.
I start Xfce4 from the command line with startx. I have
added:
exec /usr/local/bin/startxfce4
to ~/.xinitrc.
Everything comes up nicely, but I cannot swap the Control_L
and CAPS_LOCK automatically at startup.
I can swap them from an xterm command line using
setxkbmap -option ctrl:swapcaps
and
xmodmap ~/.Xmodmap
Both of these methods do work, but I want it to happen
automatically when I launch X.
Add the setxkbmap command to .xinitrc above startxfce4.
Also, remove the settings related to the layout of your keyboard in the
settings of xfce4.
I have gone to the "Session and Startup" dialog and
created an entry for the setxkbmap command method.
The command executes and returns 0.
I have added:
XKBOPTIONS="ctrl:swapcaps"
to /etc/default/keyboard. This doesn't work either.
I have instrumented /etc/xdg/xfce4/xinitrc to verify that
# load local modmap
test -r $HOME/.Xmodmap && xmodmap $HOME/.Xmodmap
in that file is executed and returns 0
Googling finds the solutions described above. These aren't
working for me. At this point I am out of ideas. I am
resisting writing an "xorg.conf" file. Am I down to that?
Clue sticks gladly accepted.
Juan,
Thank you for taking the time to reply. I tried your advice
but it had no effect.
I have spent more time digging into this and found that
any X options set prior to launching xfce4-session will be
reset to whatever value xfce4-session wants and it clearly
wants ctrl:swapcaps unset.
I added the following line
(sleep 10; setxkbmap -option ctrl:swapcaps) &
to /etc/xdg/xfce4/xinit just prior to the launch of
xfce4-session. The 10 second sleep holds off my option
change until xfce4-session (or a child process) has wrecked
its havoc. This seems to be the only way I can get the
final word on the matter.
This also suggests that adding setxkbmap to the
"Session and Startup" -> "Application Autostart"
is the right approach, but there seems to be no
way (short of a sleep) to force an ordering of
started apps.
So my final workaround is to restore /etc/xdg/xfce4/xinit
to its original content and create the following shell
script in my ~/bin directory. This method will survive
a package update of Xfce4.
cat bin/swap_caps.sh
#!/bin/sh
(sleep 10; /usr/X11R6/bin/setxkbmap -option 'ctrl:swapcaps') &
I have added a launcher for this script to the
"Session and Startup" -> "Application Autostart"
dialog.
Since this doesn't seem to be an OpenBSD issue. I guess
I need to take it upstream. For the time being, I will use
this rather ugly work-around.
Thanks
Ray