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

Fix xdotool typing issue #65

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

TanguyHerbron
Copy link

Problem encountered

A user with multiple keyboard layouts may encounter an error when auto typing its password depending on the layouts.

On my machine, I have two layouts set at the same time, and I switch between them using the Caps lock key.

$ setxkbmap -query
rules:      evdev
model:      pc105
layout:     us,fr
options:    grp:caps_toggle

It seems like xdotool has an issue when picking its typing layout, it takes the last layout instead of the currently active one (problem with xdotool and Xorg as I read on other forums).

An easy way to fix it would be to reverse the layout order as follows :

$ setxkbmap -query
rules:      evdev
model:      pc105
layout:     fr,us
options:    grp:caps_toggle

It would fix the problem for me but I guess it might not be the case for everyone.

Solution

The fix I currently suggest is as follows :

  • saving the current layout configuration
  • setting the keyboard layout to us
  • executing xdotool type
  • setting the keyboard layout back to its initial configuration

On the second step, the layout can be anything as long as it is a single layout. Xdotool 'misstypes' the string only when two conflicting layouts are set at the same time.

@Mange
Copy link
Contributor

Mange commented May 26, 2021

This would reset any customization made using xmodmap, among others, as the keyboard would be reset back to an initial layout.


NOTE: I'm not the maintainer, just a contributor. This is just my own personal opinion and does not necessarily reflect the maintainer's wishes.

I would consider this to be part of your particular setup and is probably something you should wrap this script in before you call it, rather than adding it upstream. I think more users will have their setups broken by this than fixed by this.

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

Successfully merging this pull request may close these issues.

None yet

2 participants