~geb/numen

9 2

Help with dotool

Details
Message ID
<CANvcPHv65F44HANT53C15QCBk0pYap-TO=C4WiPZ8dMc+Y-73w@mail.gmail.com>
Sender timestamp
1674471678
DKIM signature
missing
Download raw message
Hi

I'm trying to use dotool in X (pop-os) with a French keyboard layout.
Even with the extra udev rule, however, I get the US characters typed.

For example, I'm testing with the command:

echo 'type Sup, Lads!' | dotoolc

which echoes back:

Sup; Lqds1

Any suggestions?

Martin Bartlett
Details
Message ID
<CPZJRF5S1X84.2YA99YZGHYA7T@d>
In-Reply-To
<CANvcPHv65F44HANT53C15QCBk0pYap-TO=C4WiPZ8dMc+Y-73w@mail.gmail.com> (view parent)
Sender timestamp
1674474755
DKIM signature
missing
Download raw message
Hello,

That's annoying.
Does this command will help:

	setxkbmap -device "$(xinput -list --id-only 'dotool keyboard')" us

I'm not sure what the issue is. On mine if I run:

	setxkbmap gb
	echo 'key shift+x:grave' | dotool

It stills types ~ not ¬. Is that the same for you?

Does running: echo "$WAYLAND_DISPLAY"
output anything? If so you're in Wayland not X11.

John
Details
Message ID
<CANvcPHtXKWRztpzLPQLvebtm+8_guPq4CatajVyRnY0zVc-6Ew@mail.gmail.com>
In-Reply-To
<CPZJRF5S1X84.2YA99YZGHYA7T@d> (view parent)
Sender timestamp
1674482171
DKIM signature
missing
Download raw message
Hey thanks for the quick response - no output for the WAYLAND env var
(as expected) so I am in X.

The setxkbmap command runs successfully, then the echo key... does
produce ~ (but it did before the setxkbmap too - but, then again, I
still have udev rule in place...) but the type command still produces
the wrong text.

Martin

On Mon, Jan 23, 2023 at 12:52 PM John Gebbie <me@johngebbie.com> wrote:
>
> Hello,
>
> That's annoying.
> Does this command will help:
>
>         setxkbmap -device "$(xinput -list --id-only 'dotool keyboard')" us
>
> I'm not sure what the issue is. On mine if I run:
>
>         setxkbmap gb
>         echo 'key shift+x:grave' | dotool
>
> It stills types ~ not ¬. Is that the same for you?
>
> Does running: echo "$WAYLAND_DISPLAY"
> output anything? If so you're in Wayland not X11.
>
> John
Details
Message ID
<CPZQD9MCPJNE.2XPKIT1SM2UNF@d>
In-Reply-To
<CANvcPHtXKWRztpzLPQLvebtm+8_guPq4CatajVyRnY0zVc-6Ew@mail.gmail.com> (view parent)
Sender timestamp
1674493394
DKIM signature
missing
Download raw message
Someone on the chat described maybe the same issue.
Still trying to figure it out but made some progress.

Don't feel you need to join, I'll report back anything, but here:
https://matrix.to/#/#numen:matrix.org
Details
Message ID
<CPZRR1AW0773.2ZHEAH0DJQD3O@d>
In-Reply-To
<CANvcPHtXKWRztpzLPQLvebtm+8_guPq4CatajVyRnY0zVc-6Ew@mail.gmail.com> (view parent)
Sender timestamp
1674497294
DKIM signature
missing
Download raw message
(Copy pasted for the mailing list)
> No, it wasn't the dotool KB that wasn't available, the US keyboard
> layout wasn't "available" - I only had two French ones defined. I'm no
> expert at X, but, in pop-os (gnome) settings I added the US keyboard
> layout and that was when it started to work.

Oh right, thank you, that really is good to know, I didn't even know that
was a thing.

All the best,
John
Details
Message ID
<CANvcPHuWEM7k+_9w1zL8Y4BNFwGm_wOWGBzosSxsoG9d80PyJA@mail.gmail.com>
In-Reply-To
<CPZRR1AW0773.2ZHEAH0DJQD3O@d> (view parent)
Sender timestamp
1674561555
DKIM signature
missing
Download raw message
Not sure you want TOO many "and this happens too"  reports, so ignore
this if this isn't relevant; I've wrapped the daemon in a script that
launches it in the background and then sets its kb layout as US. But I
find I have to set the layout again after a certain amount of time
(not yet figured out exactly what that "timeout" is).

On Mon, Jan 23, 2023 at 7:08 PM John Gebbie <me@johngebbie.com> wrote:
>
> (Copy pasted for the mailing list)
> > No, it wasn't the dotool KB that wasn't available, the US keyboard
> > layout wasn't "available" - I only had two French ones defined. I'm no
> > expert at X, but, in pop-os (gnome) settings I added the US keyboard
> > layout and that was when it started to work.
>
> Oh right, thank you, that really is good to know, I didn't even know that
> was a thing.
>
> All the best,
> John
Details
Message ID
<CQ1609HE5REP.3TZXOCPYN1BNM@d>
In-Reply-To
<CANvcPHuWEM7k+_9w1zL8Y4BNFwGm_wOWGBzosSxsoG9d80PyJA@mail.gmail.com> (view parent)
Sender timestamp
1674639072
DKIM signature
missing
Download raw message
Nah that is weird and worth knowning.
I'm probably going to wait a bit before looking into these oddities directly,
and hope I find a different solution that covers X, Wayland and virtual
consoles in the meantime, but I appreciate any reports.
Details
Message ID
<CQ502S1XFE2U.UQC34ZFPB1PN@d>
In-Reply-To
<CANvcPHuWEM7k+_9w1zL8Y4BNFwGm_wOWGBzosSxsoG9d80PyJA@mail.gmail.com> (view parent)
Sender timestamp
1675028583
DKIM signature
missing
Download raw message
X config files take precedence over udev vars, so I think it might be being
overridden there.  I've updated the repo to install a X config file of our
own, maybe see if it works.  (I also tweaked the udev rule from "add" to
"add|change" but meh.)
Details
Message ID
<CANvcPHvGxogFkP2B1wCQErBzCAwgNyEt9hKZAr2Z_YCDQFY3qw@mail.gmail.com>
In-Reply-To
<CQ502S1XFE2U.UQC34ZFPB1PN@d> (view parent)
Sender timestamp
1675074976
DKIM signature
missing
Download raw message
OK, I'll take a look.

Thx

On Sun, Jan 29, 2023 at 10:42 PM John Gebbie <me@johngebbie.com> wrote:
>
> X config files take precedence over udev vars, so I think it might be being
> overridden there.  I've updated the repo to install a X config file of our
> own, maybe see if it works.  (I also tweaked the udev rule from "add" to
> "add|change" but meh.)
Details
Message ID
<CS0S5M9XZHSD.18VNFPSXNMZG2@d>
In-Reply-To
<CPZJRF5S1X84.2YA99YZGHYA7T@d> (view parent)
Sender timestamp
1681915913
DKIM signature
missing
Download raw message
It turned out even some X desktop environments like GNOME (Xorg version),
MATE and Cinnamon, do their own thing and override the keyboard layouts.

I decided fighting every environment to keep the layout us was doomed, and
I've overhauled dotool in a new branch to use xkbcommon so you can have it
simulate keycodes to match whatever layout it is assigned by your environment.
This should also let you simulate any characters possible by your layout.

The branch is called xkb if you are up for trying it. Remember to disable
your workaround, as we want to let it be assigned your layout now.

It's like:

    DOTOOL_XKB_LAYOUT=fr dotool
Reply to thread Export thread (mbox)