Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dvorak layout not recognized at startup #128

Closed
Spindelhalla opened this issue May 6, 2016 · 13 comments
Closed

Dvorak layout not recognized at startup #128

Spindelhalla opened this issue May 6, 2016 · 13 comments

Comments

@Spindelhalla
Copy link

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.

@LordReg
Copy link
Contributor

LordReg commented May 7, 2016

spectrwm maps keys based on the keyboard layout when it starts. Make sure the dvorak layout is active before spectrwm starts.

@Spindelhalla
Copy link
Author

Spindelhalla commented May 7, 2016

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?

@Spindelhalla
Copy link
Author

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.

@marcopeereboom
Copy link
Contributor

that's awful... why does the key layout not complete before spectrwm?

@ghost
Copy link

ghost commented May 10, 2016

why would

mykeyboardcommand && specrtwm

not solve the problem?

@marcopeereboom
Copy link
Contributor

that's what I said. What is happening in that script?

@Spindelhalla
Copy link
Author

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?

@marcopeereboom
Copy link
Contributor

are you using startx or xdm?

if you are using xdm then link your .xinitrc to .xsession

@Spindelhalla
Copy link
Author

I use startx

@dajohi
Copy link
Contributor

dajohi commented May 11, 2016

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.

@Spindelhalla
Copy link
Author

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.

@dajohi
Copy link
Contributor

dajohi commented May 16, 2016

Is system-wide an option? Add this to your xorg.conf?

Section "InputClass"
     Identifier "system-keyboard"
     Option "XkbLayout" "us"
     Option "XkbVariant" ",dvorak"
EndSection

@Spindelhalla
Copy link
Author

Spindelhalla commented May 17, 2016

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

@LordReg LordReg closed this as completed Apr 3, 2017
LordReg added a commit that referenced this issue Apr 21, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants