xdotool and keyboard layout
Asked Answered
F

4

6

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 the command the language is set to US. A note: when greek language is used, the key 'q' of the keyboard is used for the semicolon ';' (this is the default behavior/mapping)

Question

What can I do to get a semicolon with xdotool's type?

Some info

I am 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
Friedman answered 25/7, 2013 at 8:51 Comment(1)
Here is Jordan Sissel's (xdotool creator) statement to this persisting bug: github.com/jordansissel/xdotool/issues/…Deeprooted
K
1

This is a known bug. One thing you can try is upgrading to the newest version of xdotool. If that doesn't work, then check out this page, especially answer #29:

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

The issue was resolved by this pull request on 2014-04-07 (which is more than 3 years ago now). If anybody is still having this issue today, I think your best bet is upgrading xdotool.

Kickshaw answered 20/8, 2013 at 9:16 Comment(3)
Do have the upstream bug report URL please ?Macrospore
@StardustOne the link is right there. However, it seems like this problem is now solved in this pull request: github.com/jordansissel/xdotool/pull/39Kickshaw
@Blauhirn this is not about source code. The problem should be resolved upstream. In fact, this problem was resolved three years ago, which is why having a link is important. You should try updating xdotool.Kickshaw
E
8

try

setxkbmap <yourlocale>

before calling xdotool

Eisk answered 7/4, 2016 at 15:27 Comment(2)
This helped me to finally get a Z instead of a YAlgernon
For debian and ubuntu, locales can be found under /usr/share/X11/xkb/symbols/Trace
K
1

This is a known bug. One thing you can try is upgrading to the newest version of xdotool. If that doesn't work, then check out this page, especially answer #29:

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

The issue was resolved by this pull request on 2014-04-07 (which is more than 3 years ago now). If anybody is still having this issue today, I think your best bet is upgrading xdotool.

Kickshaw answered 20/8, 2013 at 9:16 Comment(3)
Do have the upstream bug report URL please ?Macrospore
@StardustOne the link is right there. However, it seems like this problem is now solved in this pull request: github.com/jordansissel/xdotool/pull/39Kickshaw
@Blauhirn this is not about source code. The problem should be resolved upstream. In fact, this problem was resolved three years ago, which is why having a link is important. You should try updating xdotool.Kickshaw
T
0

These work for me:

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

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

Text answered 6/7, 2015 at 23:35 Comment(0)
M
0

extending fazae's answer:

I have the latest version of xdotool, it seems. But the bug 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 the us and ru locales, alt+shift for toggling layouts): set locale to us, enable layout toggling with alt+shift:

$ setxkbmap us && xdotool type ':' && setxkbmap -option grp:alt_shift_toggle us,ru
:
Matrilateral answered 11/6, 2019 at 10:39 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.