Xdotool and keyboard layout

Problem

I am trying to do:

xdotool type 'date;' 

but instead of the expected

 date; 

I get:

 dateq 

I have a Greek keyboard, but when I issue a command, the language is set to US. Note: when Greek is used, the q key of the keyboard is used for the semicolon ";" (this is the default behavior / mapping )

Question

What can I do to get a semicolon of type xdotool?

Some information

I'm on Xfce 4.8 on XUbuntu

 $ xfce4-terminal -V xfce4-terminal 0.4.8 (Xfce 4.8) $ setxkbmap -print -verbose 10 Setting verbose level to 10 locale is C Applied rules from evdev: rules: evdev model: pc105 layout: us,gr variant: , options: grp:caps_toggle Trying to build keymap using the following components: keycodes: evdev+aliases(qwerty) types: complete compat: complete symbols: pc+us+gr:2+inet(evdev)+capslock(grouplock) geometry: pc(pc105) xkb_keymap { xkb_keycodes { include "evdev+aliases(qwerty)" }; xkb_types { include "complete" }; xkb_compat { include "complete" }; xkb_symbols { include "pc+us+gr:2+inet(evdev)+capslock(grouplock)" }; xkb_geometry { include "pc(pc105)" }; }; $ sudo lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 12.04.2 LTS Release: 12.04 Codename: precise 
+7
bash xfce xdotool
source share
4 answers

This is a known bug. One thing you can try is updating to the latest version of xdotool. If this does not work, check this page, especially answer # 29:

http://code.google.com/p/semicomplete/issues/detail?id=13

The problem was resolved with this pull request in 2014-04-07 (which is over 3 years ago). If anyone else has this question today, I think it is best to update xdotool.

+2
source share

try

 setxkbmap <yourlocale> 

before calling xdotool

+6
source share

These works for me:

 echo "date;" | xvkbd -xsendevent -file - xvkbd -xsendevent -text 'date;' 

(remove the -xsendevent option and you will get the same problem as with xdotool)

0
source share

continuing the response phase:

I seem to have the latest version of xdotool. But the error is still there:

 $ xdotool --version xdotool version 2.20110530.1 $ xdotool type ';' $ 

"$" is typed instead of ";".

 $ xdotool type ':' ^ 

"^" is typed instead of ":"

FIX (example for us and ru locales, alt + shift to switch layouts): set the locale for us, enable layout switching with alt + shift:

 $ setxkbmap us && xdotool type ':' && setxkbmap -option grp:alt_shift_toggle us,ru : 
0
source share

All Articles