Closed Spindelhalla closed 7 years ago
spectrwm maps keys based on the keyboard layout when it starts. Make sure the dvorak layout is active before spectrwm starts.
I thought that might have been the reason and I added
setxkbmap -layout us -variant dvorak
at the beginning of my .xinitrc (I use the startx method) but it didn't help. Should I add a few seconds of delay to the execution of spectrwm instead?
A simple "sleep 5" in my .xinitrc right before spectrwm "solved" the problem for me. Probably not the best solution but good enough for me.
Thanks for your work and the help.
that's awful... why does the key layout not complete before spectrwm?
why would
mykeyboardcommand && specrtwm
not solve the problem?
that's what I said. What is happening in that script?
I have no idea to be honest. My .xinitrc looks like this (I'm on a different machine at the moment but it's simple enough I can remember it). At first it was looking like this:
feh --bg-center path_to_wallpaper
exec spectrwm
Notice that I didn't have to specify the dvorak layout, OpenBSD took care of the X configurations during installation. Then I tried to specify the layout anyway, but it didn't work. It looked like this:
feh --bg-center path_to_wallpaper
setxkbmap -layout us -variant dvorak
exec spectrwm
This is by the way the same .xinitrc I was using with Arch Linux and had no problems there.
Finally I removed setxkbmap -layout us -variant dvorak
and added sleep 5
and now it works:
feh --bg-center path_to_wallpaper
sleep 5
exec spectrwm
Five seconds is probably too much, it's just for testing. I can probably reduce it.
Is there anything wrong in my .xinitrc?
are you using startx or xdm?
if you are using xdm then link your .xinitrc to .xsession
I use startx
that looks correct. I need to use sleep for certain things, such as transset-df on new xterms. I think that is a normal thing with X.
I had to reboot my system a few times yesterday and noticed that even with sleep 5
most of the time I still have to restart spectrwm for it to use the Dvorak layout.
Is there a way to make spectrwm restart itself when it starts? It's the only other "solution" that comes to mind for my problem. Otherwise I'll just keep it like this.
Is system-wide an option? Add this to your xorg.conf?
Section "InputClass"
Identifier "system-keyboard"
Option "XkbLayout" "us"
Option "XkbVariant" ",dvorak"
EndSection
Thank you for your patience, I really appreciate it. I found something that works, I restarted X many times to be sure it works 100% of the time and here it is, basically the same as before but
with setxkbmap -layout us -variant dvorak
, even though it feels redundant to me since Xorg is already configured to use Dvorak.
feh --bg-center path_to_wallpaper
setxkbmap -layout us -variant dvorak
sleep 2
exec spectrwm
Openbsd 5.9 -stable, Spectrwm 2.7.2
When Spectrwm starts up the first time it doesn't recognize that I'm using the Dvorak layout. A restart is required for it to function properly.