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 · 81 comments
Open

AutoType not available when using Wayland #2281

ganomi46 opened this issue Sep 11, 2018 · 81 comments

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.

@droidmonkey
Copy link
Member

Registering a global shortcut, but that might be covered by existing Wayland api. Most likely not, which would make it desktop env specific. /dev/uinput is not an option, requires root.

@rusty-snake
Copy link

Registering a global shortcut, but that might be covered by existing Wayland api. Most likely not, which would make it desktop env specific.

FWIW flatpak/xdg-desktop-portal#624

@ibahnasy
Copy link

This is also affected in Gnome (Ubuntu 22.10).

@cskr
Copy link

cskr commented Mar 22, 2022

Auto-type from context menu used to work fine when running Firefox under xwayland, but even this has stopped working since 2.7.0.

@dasistwas
Copy link

Ubuntu 22.04 Beta, Keepassxc 2.7.0:

  • Auto-Type window selection working for: Signal, Chromium,
  • Not working for: Firefox, Terminal, Thunderbird

@tmccombs
Copy link

tmccombs commented Apr 4, 2022

@dasistwas that is likely because Signal and Chromium are using XWayland, but Firefox, Terminal, and Thunderbird are using native wayland.

@dasistwas
Copy link

Update from Ubuntu 22.04 Beta: Suddenly auto-type started to work. But version of keepassxc did not change. It is still 2.7.1

@ourichermath
Copy link

I'd like to request the documentation at:

https://keepassxc.org/docs/KeePassXC_UserGuide.html#_auto_type

be added to. I'm on Fedora (Wayland) and it was really difficult to figure out where and how to change either the command line (-platform xcb) for my KeepassXC that was set to Autorun or the environment variable (QT_QPA_PLATFORM=xcb). Some mention of where and how would be nice.

Also, the documentation isn't clear in what KPXC is looking for with AutoType to work with applications. For instance, when I try to set it up to work with the password entry in the Virtual Machine Manager or for Grsync, the window names don't show up in KPXC's Advanced > Windows dropdown. And, no matter what I manually type in for a Window name, it doesn't work.

@foobar13372
Copy link

Ubuntu 22.04 + snap version of Firefox (Ubuntu 22.04 upgrademigrates FF to the snap version automatically): autotype works again. Did not test other programs since I only need keepass for Firefox.

@ibahnasy
Copy link

ibahnasy commented Apr 22, 2022 via email

@dasistwas
Copy link

Wayland is disabled by default in 22.04 because of a bug, may be that's why autotype is working?

no, I am on Wayland. But just realized seems only Firefox and xwayland programs do work with autotype. Terminal does not for example.

@tmccombs
Copy link

only Firefox and xwayland programs
is firefox using xwayland?

@dinotheextinct
Copy link

Is there any news to this? I am on sway and would like to know how I can get autotype working for firefox. Setting the xcb plattform, enables autotype, but hitting the configured shortcut from keepassxc for autotype doesnt open anything.

@Zocker1999NET
Copy link
Contributor

but hitting the configured shortcut from keepassxc for autotype doesnt open anything.

As I know it, Sway does not allow other applications to apply global shortcuts themselves and also I do not know of any Wayland protocol which would implement this. It might be required to configure the shortcut on Sway manually and trigger AutoType on KeePassXC using a command / D-Bus (which is not possible yet?)

@siccovansas
Copy link

I recently installed Ubuntu 22.04 and ran into this issue.

Firefox and Chromium apparently use XWayland, so KeePasXC's Global Auto-Type works there.

My main other use of Auto-Type is in the terminal for which I use the Terminator terminal. I use the following (hopefully temporary) workarounds to run Terminator using XWayland when using the Ctrl + Alt + T shortcut and when starting Terminator via its icon in the launcher:

  • In Ubuntu's Settings > Keyboard > Keyboard Shortcuts add this Custom Shortcut:
    • Name: Terminator with XWayland (to support KeePassXC)
    • Command: sh -c 'WAYLAND_DISPLAY=no /usr/bin/terminator'
    • Shortcut: Ctrl + Alt + T
  • Create the file ~/bin/terminator with this code
    • #!/bin/sh
      
      # Catches calls to run 'terminator' (as this executable is in ~/bin and thus
      # listed earlier in PATH) and run it with XWayland which makes KeePassXC work
      # (via https://askubuntu.com/a/923393/54352)
      export WAYLAND_DISPLAY=no
      exec /usr/bin/terminator "$@"
      
    • Make it executable: chmod +x ~/bin/terminator

@dinotheextinct
Copy link

Not sure if this is some Gnome garbo, but under KDE Wayland, KeepassXC doesnt even offer the Autotype option??

@rusty-snake
Copy link

WARNING: Auto-Type will be disabled when run with a Wayland compositor on Linux. To use Auto-Type in this environment, you must set `QT_QPA_PLATFORM=xcb` or start KeePassXC with the `-platform xcb` command-line flag.

@dinotheextinct
Copy link

So I got the autotype option back, but when hitting the shortcut, there is no popup on wayland, when using it for firefox...

@ibahnasy
Copy link

I can confirm that auto typing is currently working in Wayland normally after the past system updates released in the past few weeks.

@dasistwas
Copy link

I can confirm that auto typing is currently working in Wayland normally after the past system updates released in the past few weeks.

Did you test autotype with the terminal as well? Only xwayland programs seem to work. All wayland windows do not trigger the autotype dialogue when using the global autotype shortcut.

@ibahnasy
Copy link

I can confirm that auto typing is currently working in Wayland normally after the past system updates released in the past few weeks.

Did you test autotype with the terminal as well? Only xwayland programs seem to work. All wayland windows do not trigger the autotype dialogue when using the global autotype shortcut.

It doesn't work with the terminal.
Triggering the autotype from the KPXC window or using the keyboard key combination, it works fine with some GUI apps like Google Chrome, but apps like FIrefox or Nautilus doesn't work.

@pio2398
Copy link

pio2398 commented Jun 26, 2022

I can confirm that auto typing is currently working in Wayland normally after the past system updates released in the past few weeks.

Did you test autotype with the terminal as well? Only xwayland programs seem to work. All wayland windows do not trigger the autotype dialogue when using the global autotype shortcut.

It doesn't work with the terminal. Triggering the autotype from the KPXC window or using the keyboard key combination, it works fine with some GUI apps like Google Chrome, but apps like FIrefox or Nautilus doesn't work.

It's just can't work with wayland app. Could you read at least few comment back before posting? #2281 (comment)

@bigdiff
Copy link

bigdiff commented Jul 13, 2022

Would it be possible to implement a workaround for now till xdg-desktop-portals implements a global shortcut portal.

I was thinking about making keepassxc launch with a --auto-type flag. Adding that to the list of custom shortcuts in gnome-control-panel would resolve the issue for now.

name: KeePassXC Auto-Type
command: keepassxc --auto-type

gnome control center > add custom shortcuts

@vimpostor
Copy link
Contributor

vimpostor commented Jul 13, 2022

Would it be possible to implement a workaround for now till xdg-desktop-portals implements a global shortcut portal.

Can you guys at least read through the thread before pushing this again. Even if you fix the shortcut registering, you still can't find out the title of the window.

And again, the easiest way to move this issue forward is to move the already existing upstream proposals forward:

Why are people pushing this issue every week but not the real underlying issue in the upstream protocols? This is all so backwards.
Quite frankly, this issue should be closed as "Won't fix" or locked until this mess is fixed in Wayland.
Originally back in 2013 Wayland was meant to cut out the "useless" middleman, ironically now we end up with even more useless middlemen just to deal with basic stuff like negotiating shortcut registering or server side decorations.

@keepassxreboot keepassxreboot locked and limited conversation to collaborators Jul 13, 2022
@droidmonkey
Copy link
Member

This information was provided by @GalaxySnail

Currently, we have the global keyboard shortcut portal and libei, which should be good enough for auto-type.

For enumerating windows, there is a foreign toplevel list protocol.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests