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

AutoType not available when using Wayland #2281

Open
ganomi46 opened this issue Sep 11, 2018 · 125 comments · May be fixed by #10905
Open

AutoType not available when using Wayland #2281

ganomi46 opened this issue Sep 11, 2018 · 125 comments · May be fixed by #10905

Comments

@ganomi46
Copy link

ganomi46 commented Sep 11, 2018

Expected Behavior

AutoType should be available as under X.

Current Behavior

AutoType not available in Wayland

Steps to Reproduce (for bugs)

Login to Plasma Wayland
Open KeePassXC
You will there are no auto login options

Operating system: OS
Debian SID amd64

@droidmonkey
Copy link
Member

Are you referring to AutoType??

@ganomi46
Copy link
Author

ganomi46 commented Sep 11, 2018 via email

@droidmonkey droidmonkey changed the title Autologin option not available in KDE Wayland AutoType not available when using Wayland Sep 12, 2018
@Whompithian
Copy link

I can confirm lack of Auto-Type options using Plasma Wayland.

OS: 4.14.65-gentoo x86_64
plasma-5.46.0
wayland-1.15.0

@phoerious
Copy link
Member

Auto-Type cannot work on Wayland due to security restrictions for which we haven't found a solution yet.

@rockihack
Copy link
Contributor

I implemented autotype for wayland, still needs some work though.

https://github.com/rockihack/keepassx/blob/wayland-autotype/wayland.txt
https://github.com/rockihack/keepassx/tree/wayland-autotype/src/autotype/wayland

@apollo13
Copy link

apollo13 commented May 1, 2020

It might be worth to look what https://gitlab.gnome.org/ofourdan/gnome-ponytail-daemon does. I seems to allow writing arbritrary key sequences to windows.

@tmccombs
Copy link

tmccombs commented Jul 12, 2020

fwiw, there is a keepass plugin that supports this (https://keepass.info/help/kb/autotype_wayland.html), it does require access to /dev/uinput though.

For wlroots based compositors (such as sway) the input-method protocol (https://github.com/swaywm/wlroots/blob/master/protocol/input-method-unstable-v2.xml) or possibly the virtual-keyboard protocol (https://github.com/swaywm/wlroots/blob/master/protocol/virtual-keyboard-unstable-v1.xml) may allow implementing AutoType

@curiosityseeker
Copy link

I'm using KeePassXC on Arch Linux with Wayland (on KDE) in combination with ydotool, specifically ydotool-git in the AUR. And voilà - Autotype works flawlessly!

So perhaps it's possible to integrate ydotool's approach in KeePassXC directly?

@droidmonkey
Copy link
Member

Oh nice!!

@apollo13
Copy link

Mhm, seems like it has a client/server structure because it uses /dev/uinput which requires (usually) root permission. Still better than no autotype I guess :D

@curiosityseeker
Copy link

curiosityseeker commented Oct 23, 2020

Yes, it seems to be similar to how KeePass does it with KPUInput.

@apollo13
Copy link

https://gitlab.com/dogtail/dogtail/ seems to use the accessibility features in gnome and kde to send text to applications without the need of uinput and as such without any extra daemon.

@apollo13
Copy link

Ok, dogtail uses ponytail on wayland which I linked above already. Seems to be a rather heavy solution :/

@droidmonkey droidmonkey added this to the v2.7.0 milestone Oct 24, 2020
@droidmonkey
Copy link
Member

I think I'll opt for #2281 (comment) solution

@phoerious
Copy link
Member

phoerious commented Oct 26, 2020

Using the DE's accessibility features is the only correct way to implement it. I only wish there were some kind of standard interface and not several largely incompatible ones, like there always is on Linux.

@MAFLO321
Copy link

I'm not very familiar with Wayland in deep, but can text-input-v3 protocol be used to solve the virtual-input problem?
KDE Plasma's and Gnome's Compositors both support it.

already mentioned by #2281 (comment)

@phoerious
Copy link
Member

Perhaps, need to check. Thanks for the pointer.

@ztNFny
Copy link

ztNFny commented Apr 28, 2021

I'm using KeePassXC on Arch Linux with Wayland (on KDE) in combination with ydotool, specifically ydotool-git in the AUR. And voilà - Autotype works flawlessly!

So perhaps it's possible to integrate ydotool's approach in KeePassXC directly?

Could you elaborate on that? How can KeePassXC be configured to use ydotool? I thought to just use it with cmd://, but then the input just goes .. no idea where.

@sam9032
Copy link

sam9032 commented May 2, 2021

I don't have KDE Plasma to test right now, but under Gnome 40 with wayland it works ootb. Is this issue still present in plasma?

@vimpostor
Copy link
Contributor

I don't have KDE Plasma to test right now, but under Gnome 40 with wayland it works ootb. Is this issue still present in plasma?

I just tested in Plasma and it doesn't work there. Neither global autotype nor manually choosing autotype from Keepass itself are working.
I am curious, does anyone know how this is working in Gnome? As far as I can see in the codebase, there is no implementation merged for Wayland yet, so I don't get why this is working in Gnome ootb for you.

Tested on Plasma 5.21.4 on Arch btw.

@arigit
Copy link

arigit commented Sep 2, 2024

When I run KeePassXC from the terminal using the command keepassxc -platform xcb I have get the auto type options enabled again (I know this is supposed to work). I am on KDE Plasma 6 running Wayland and am able to use the autotype function when in this mode to type into even what should be Wayland windows (Konsole, Kate, Kwrite, Firefox) after accepting a dialogue box which asks me to accept a remote control request. Screenshot_20240722_120525 The dialogue box only shows up once per Plasma session (which I think is fine).
This dialogue box is relatively new (maybe a month or so) auto-type would only work with X11 apps running in XWayland (I used to auto-type into Chromium) before I noticed this dialogue box. Hope this workaround helps anyone while the PR to get this properly implemented.

How exactly do you get this dialogue box to pop up? I have been trying to get autotype for wayland on plasma6 working for over a month.

If I start keepass with the -platform xcb argument as per the documentation then yes I can get the auto type tab however no apps, Wayland xwayland or otherwise actually work.

I never get any window asking for permission, When I press the global autotype shortcut in any window aside frim keepass itself, I don't see any errors it just does not work. If I try the Entry-Level Auto-Type, same result, I select the entry, keepassxc window minimizes then nothing previous window appears however it does not get any password.

I am currently on KDE Plasma 6.1.3. I would love to get this working it is perpahs the last major app that does not work with this environment.

Same experience on Ubuntu 24.04.1, both firefox and keepassxc (2.7.9) installed as flatpaks. I added "QT_QPA_PLATFORM=xcb" to keepassxc enviroment via flatseal. The Autotype tab shows, but autotype is not working at all, from either global key or triggered from the menu context when right-clicking a DB entry

@ag-gaphp
Copy link

ag-gaphp commented Sep 4, 2024

I'm on Arch, using KDE/Plasma

When installed via Discover/Flatpak, I can't get the auto-type tab to appear under any circumstance. Have tried setting the env var and adding the command flag to no avail.

When installed via pacman (kxc v2.7.9), the auto-type tab is already there by default, and when the database is locked it picks up the global hotkey I have set, asking to unlock the database. However, once unlocked, auto-type does nothing. I still tried adding -platform xcd to the command arguments, and setting QT_QPA_PLATFORM=xcb, but neither changes the behavior.

I get this log output when I start keepassxc (installed via pacman) without any arguments:

qt.qpa.plugin: Could not find the Qt platform plugin "wayland" in ""

@q-wertz
Copy link

q-wertz commented Sep 5, 2024

I'm on Arch, using KDE/Plasma

On my Manjaro/Gnome installation via yay AutoType is working and I get

Warning: Ignoring XDG_SESSION_TYPE=wayland on Gnome. Use QT_QPA_PLATFORM=wayland to run on Wayland anyway.

when starting keepassxc

It seems to run in Xwayland mode and the error (that also @dasistwas has) seems to be unrelated.

EDIT:
BTW: When I use keepassxc -platform xcb AutoType works directly without the OS asking beforehand for permission.

@agowa
Copy link

agowa commented Sep 5, 2024

BTW: When I use keepassxc -platform xcb AutoType works directly without the OS asking beforehand for permission

I had to grant permission. That's probably because you already granted it...

@q-wertz
Copy link

q-wertz commented Sep 6, 2024

I had to grant permission. That's probably because you already granted it...

No... After closing the permission is lost and I have to regrant it when using it without -xbc.
Also there is a "sharing" indication icon when the permission is granted (like with microphone and camera)

@arigit
Copy link

arigit commented Sep 6, 2024

When I run KeePassXC from the terminal using the command keepassxc -platform xcb I have get the auto type options enabled again (I know this is supposed to work). I am on KDE Plasma 6 running Wayland and am able to use the autotype function when in this mode to type into even what should be Wayland windows (Konsole, Kate, Kwrite, Firefox) after accepting a dialogue box which asks me to accept a remote control request. Screenshot_20240722_120525 The dialogue box only shows up once per Plasma session (which I think is fine).
This dialogue box is relatively new (maybe a month or so) auto-type would only work with X11 apps running in XWayland (I used to auto-type into Chromium) before I noticed this dialogue box. Hope this workaround helps anyone while the PR to get this properly implemented.

How exactly do you get this dialogue box to pop up? I have been trying to get autotype for wayland on plasma6 working for over a month.
If I start keepass with the -platform xcb argument as per the documentation then yes I can get the auto type tab however no apps, Wayland xwayland or otherwise actually work.
I never get any window asking for permission, When I press the global autotype shortcut in any window aside frim keepass itself, I don't see any errors it just does not work. If I try the Entry-Level Auto-Type, same result, I select the entry, keepassxc window minimizes then nothing previous window appears however it does not get any password.
I am currently on KDE Plasma 6.1.3. I would love to get this working it is perpahs the last major app that does not work with this environment.

Same experience on Ubuntu 24.04.1, both firefox and keepassxc (2.7.9) installed as flatpaks. I added "QT_QPA_PLATFORM=xcb" to keepassxc enviroment via flatseal. The Autotype tab shows, but autotype is not working at all, from either global key or triggered from the menu context when right-clicking a DB entry

An update on this: there is an ugly workaround that can be used in wayland for keepassxc (flatpak) and firefox (flatpak) autotype to work: running both on xwayland, this is easy to achieve using Flatseal and removing the "Wayland Socket" permission from both Firefox and KeepassXC. Global autotype works well, as expected. Ubuntu 22.04 / nvidia 555

Of course, doing that is bad specially for firefox, it's back to the past (not as smooth (noticeably) browsing pages, security implications etc). So truly hopeful we will get native wayland autotype via a portal working sometime soon. In my environment could not manage yet to get the "prompt" that some folks report above.

@e-pirate
Copy link

Recently Gentoo marked Plasma 6 as Stable and masked KDE/Plasma 5 forcing users to update. I faced numerous problems with Wayland even it is Plasma version 6.1. Some were solved, some can be with a little bit of effort, some can be ignored or accepted. But non working AutoType function of KeepAssXC is an absolute blocker for me. Been a duty system administrator on I huge production, I'm forced to use AutoType in various combination primly for login into Windows machines via xfreerdp (we all hate this), typing in root passwords in IPMI sessions for rescuing stack servers and dozens of other scenarios when browser is no use and only AutoType is a solution. Having non-working AutoType simply making impossible to use Wayland.
So we have:

  • wayland-1.23.0-r1
  • keepassxc-2.7.9
  • qtbase-6.7.2
  • xcb-util-keysyms-0.4.1
  • plasma-workspace-6.1.4-r1
    If I start keepassxc -platform xcb I can now see the AutoType menu, but as many others when I select something there or just hit Ctrl-Shift-V, keepassxc window get minimized, but nothing typed into previous window and no 'Remote control request' window appear.
    Any ideas what is wrong?

@tukanos
Copy link

tukanos commented Sep 20, 2024

Recently Gentoo marked Plasma 6 as Stable and masked KDE/Plasma 5 forcing users to update. I faced numerous problems with Wayland even it is Plasma version 6.1. Some were solved, some can be with a little bit of effort, some can be ignored or accepted. But non working AutoType function of KeepAssXC is an absolute blocker for me. Been a duty system administrator on I huge production, I'm forced to use AutoType in various combination primly for login into Windows machines via xfreerdp (we all hate this), typing in root passwords in IPMI sessions for rescuing stack servers and dozens of other scenarios when browser is no use and only AutoType is a solution. Having non-working AutoType simply making impossible to use Wayland. So we have:

* wayland-1.23.0-r1

* keepassxc-2.7.9

* qtbase-6.7.2

* xcb-util-keysyms-0.4.1

* plasma-workspace-6.1.4-r1
  If I start `keepassxc -platform xcb` I can now see the AutoType menu, but as many others when I select something there or just hit Ctrl-Shift-V, keepassxc window get minimized, but nothing typed into previous window and no 'Remote control request' window appear.
  Any ideas what is wrong?

I see the issue somewhere between the Wayland/X compatibility layer.

@kde-baskets-user
Copy link

kde-baskets-user commented Sep 22, 2024

May I kindly ask someone to summarize in precise, technical terms the current status of the Auto-type feature on Wayland?

  • Does Auto-type support pure Wayland mode? Does it support both Plasma 6 and Gnome? If so, how was it implemented?
  • Does the PR linked somewhere above address this issue and what's its fate?
  • If it's not supported, please provide command line options to enable the Xwayland workaround for both Gnome and KDE Plasma 6.
  • Do native, flatpack or snap installations make any difference in this regard?

You'd help enormously many users by clarifying things.

@mareksamec
Copy link

mareksamec commented Sep 25, 2024

May I kindly ask someone to summarize in precise, technical terms the current status of the Auto-type feature on Wayland?

  • Does Auto-type support pure Wayland mode? Does it support both Plasma 6 and Gnome? If so, how was it implemented?
  • Does the PR linked somewhere above address this issue and what's its fate?
  • If it's not supported, please provide command line options to enable the Xwayland workaround for both Gnome and KDE Plasma 6.
  • Do native, flatpack or snap installations make any difference in this regard?

You'd help enormously many users by clarifying things.

I just tried KeePassXC 2.7.9 running on the Plasma 6 and Arch linux versions bellow and it works out of the box. What I needed to do is autostart my keepassxc with this argument keepassxc -platform xcb or start it with env variable like this QT_QPA_PLATFORM=xcb keepassxc. If your distro has recent enough version, it should work. Regarding flatpak or snaps. I'm not using those, but this comment above seems to explain how to make it work on flatpak.

Operating System: Arch Linux 
KDE Plasma Version: 6.1.5
KDE Frameworks Version: 6.6.0
Qt Version: 6.7.2
Kernel Version: 6.10.10-arch1-1 (64-bit)

@e-pirate
Copy link

@mareksamec no, it does not work that way. I have all Plasma components equal or grater then 6.1.5, qtbase-6.7.2-r4, kde-frameworks 6.5.0 and running keepasxc with `-platform xcb' does not make autotype work, just enables the menu option back. Maybe frameworks are older then needed...

@tmccombs
Copy link

I think with the xcb platform it will work for other applications using Xwayland, but not native wayland applications.

@ag-gaphp
Copy link

May I kindly ask someone to summarize in precise, technical terms the current status of the Auto-type feature on Wayland?

  • Does Auto-type support pure Wayland mode? Does it support both Plasma 6 and Gnome? If so, how was it implemented? A: It does not

  • Does the PR linked somewhere above address this issue and what's its fate? A: You can always get the latest info from the PR itself. TL;DR: it's not ready yet, as it is still in open status.

  • If it's not supported, please provide command line options to enable the Xwayland workaround for both Gnome and KDE Plasma 6. A: There are none

  • Do native, flatpack or snap installations make any difference in this regard? A: Makes no difference

You'd help enormously many users by clarifying things.

I get it's a long thread, but these are all pretty well clarified in the latest comments already. I went ahead and answered inline though.

If you need auto-type over anything else, use pure X11 instead of any wayland.

@odomingao
Copy link

Hi, anyone got it to work with hyprland?

@phoerious phoerious removed the pr: refactoring Pull request that refactors code label Nov 22, 2024
@jakob1379
Copy link

jakob1379 commented Dec 10, 2024

Remember that enabling auto typing has security implications, not just on Wayland, but also under X11. Now that that has been said, I have found the simplest solution to be to update the "share/applications/org.keepassxc.KeePassXC.desktop" with

Exec=env QT_QPA_PLATFORM=xcb keepassxc %f

This ensures if the application is started correctly.

The issue by setting the QT_QPA_PLATFORM=xcb in you global env is that it will make all apps want to start up in something else that Wayland, which is not what you want.

@rusty-snake
Copy link

FWIW: Exec=keepassxc -platform xcb should do the same.

@droidmonkey
Copy link
Member

droidmonkey commented Dec 10, 2024

Thank you for all the comments, we have a working solution to this in development. Please only comment if you have information that can support improving the working solution.

@DomingoMontoya
Copy link

I have an issue using it with wayland where it doesn't seem to be hitting the shift key? Any time there's a shift character, it types w/o it.

What I expect it to type 1!2@3#4$5%6^7&8*9(0)-_ vs what it actually types 11223344556677889(0)--.

@lennybacon
Copy link

Remember that enabling auto typing has security implications, not just on Wayland, but also under X11. Now that that has been said, I have found the simplest solution to be to update the "share/application/org.keepassxc.KeePassXC.desktop" with

Exec=env QT_QPA_PLATFORM=xcb keepassxc %f

This ensures if the application is started correctly.

The issue by setting the QT_QPA_PLATFORM=xcb in you global env is that it will make all apps want to start up in something else that Wayland, which is not what you want.

The path is missing a s - it is applications not application. The full path is: ~/.local/share/applications/org.keepassxc.KeePassXC.desktop or /usr/share/applications/org.keepassxc.KeePassXC.desktop

BacLuc added a commit to BacLuc/provision-machines that referenced this issue Dec 22, 2024
There was no snap, and like this it's a little containerized.
--platform xcb switches to an x11 environment because there
auto type works.

See keepassxreboot/keepassxc#2281
BacLuc added a commit to BacLuc/provision-machines that referenced this issue Dec 22, 2024
There was no snap, and like this it's a little containerized.
--platform xcb switches to an x11 environment because there
auto type works.

See keepassxreboot/keepassxc#2281
BacLuc added a commit to BacLuc/provision-machines that referenced this issue Dec 22, 2024
There was no snap, and like this it's a little containerized.
--platform xcb switches to an x11 environment because there
auto type works.

See keepassxreboot/keepassxc#2281
BacLuc added a commit to BacLuc/provision-machines that referenced this issue Dec 23, 2024
There was no snap, and like this it's a little containerized.
--platform xcb switches to an x11 environment because there
auto type works.

See keepassxreboot/keepassxc#2281
BacLuc added a commit to BacLuc/provision-machines that referenced this issue Dec 23, 2024
There was no snap, and like this it's a little containerized.
--platform xcb switches to an x11 environment because there
auto type works.

See keepassxreboot/keepassxc#2281
BacLuc added a commit to BacLuc/provision-machines that referenced this issue Dec 23, 2024
There was no snap, and like this it's a little containerized.
--platform xcb switches to an x11 environment because there
auto type works.

See keepassxreboot/keepassxc#2281
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.