3

I wish to be able to use the AutoType feature of KeePasssXC on my Ubuntu 21.04 system which I believe uses Wayland.

The KeePassXC User Guide states:

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.

Issuing the command:

/usr/bin/keepassxc -platform xcb

in the terminal gives the following message:

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

How, exactly, does one use the QT_QPA_PLATFORM=wayland?

BeastOfCaerbannog
  • 12,964
  • 10
  • 49
  • 77
Eric
  • 111
  • 7
  • Please see my answer. If it's helpful, please remember to accept it by clicking on the checkmark icon that appears just to the left of my answer. Thanks! – heynnema May 27 '21 at 17:50
  • To use QT_QPA_PLATFORM=wayland, if required, edit your ~/.bash_aliases file and enter a line like `export QT_QPA_PLATFORM=wayland`. Then logout/in. – heynnema May 29 '21 at 14:40
  • I also failed to get auto-type, got following: $ keepassxc -platform xcb YubiKey: Failed to establish PCSC context. YubiKey: PCSC interface is disabled or not initialized. Active window changed, interrupting auto-type. Active window changed, interrupting auto-type. – washiur17 Mar 30 '22 at 09:26

2 Answers2

2

KeePassXC 2.6.4 can auto-type (with some minor bugs) in 20.10 with Wayland... so I assume that it should still work in 21.04.

However, KeePassXC is only at version 2.6.2 in the Ubuntu repos, so you have to add the KeePassXC PPA to get version 2.6.4.

Source: https://launchpad.net/~phoerious/+archive/ubuntu/keepassxc

sudo add-apt-repository ppa:phoerious/keepassxc
sudo apt-get update

Then....

sudo apt-get install keepassxc

Update #1:

To use QT_QPA_PLATFORM=wayland, if required, edit your ~/.bash_aliases file and enter a line like export QT_QPA_PLATFORM=wayland. Log out/in.

heynnema
  • 68,647
  • 15
  • 124
  • 180
  • 1
    Sorry, I failed to say that I've already installed the PPA and my version of KeePassXC is at version 2.6.4 and, I repeat, it doesn't Auto-Type. – Eric May 27 '21 at 18:46
  • What key did you configure in the auto-type settings panel? What keys are you using? There are two different auto-type keys... global and site specific. Did you click in the username field and then do auto-type? Did you enter the web page in the individual settings for that web site? – heynnema May 27 '21 at 18:56
  • Since writing the original query and my response saying that I had installed the PPA and the latest note I have been investigating and I'm seeing some weird things. I will uninstall KeePassXC and the PPA and start over. I'll report back when I've done that. Please bear with me. – Eric May 27 '21 at 19:34
  • I have removed KeePassXC (using the "Mark for Completely Remove" in Synaptic), removed the "phoerious PPA" that was shown in Software and Updates. Then added the PPA and KeePassXC using the apt-get commands shown. (Checking on the Auto-Type tab in Tools - Settings I found there was no default for Auto-Type so I added Ctrl=Shaift+V.) The behaviour is exactly the same as in my original question. – Eric May 27 '21 at 20:56
  • Continuation: On the sample log-in page that I have been using I have not set a specific sequence for the web page (yes, I did place the cursor in the Username field); using the icons in the top bar I can insert the user name and password into the log-in page but the command Ctrl+C - which the docs say puts the password onto the clipboard - does not work. Further, if I attempt to add a window association the drop down box does not show the window title, however there is what appears to be a blank entry with a tick mark. – Eric May 27 '21 at 21:11
  • In Tools/Settings/Browser Integration/General, have you installed KeePassXC-Browser add-on, and checkmarked the appropriate web apps? – heynnema May 27 '21 at 21:38
  • To copy passwords, you highlight the appropriate web site entry and hit control-c. That password only lasts in the clipboard for a user-defined amount of time, so you have to paste it into a password field quickly, or it'll be gone. – heynnema May 27 '21 at 21:41
  • I have NOT activated Browser integration - I want to get the basics working properly first. – Eric May 27 '21 at 21:42
  • Is that timeout the so-called "Favicon download timeout"? Which is currently set to 10 secs - I go from the Ctrl+C to Ctrl+V in a lot less than 10 secs. Given that I have two screens - total width of over a metre - the amount of mouse twiddling makes it all very clunky. – Eric May 27 '21 at 21:47
  • auto-type does work. I have browser integration installed, and I don't know if it's required for auto-type to work. Unfortunately auto-type defaults to username-tab-password-enter, and many web sites use something like username-enter-password-enter... but it's possible to change that in KeePassXC. Somehow I think you just need to spend more time figuring out how to set it up, and then you can use it. – heynnema May 27 '21 at 21:47
  • No, favicon download is downloading of the web site's icon, so that instead of seeing a generic key icon, you'll see the actual icon used by the web site. The timeout settings are elsewhere in the prefs. – heynnema May 27 '21 at 21:49
  • Let us [continue this discussion in chat](https://chat.stackexchange.com/rooms/124774/discussion-between-heynnema-and-eric). – heynnema May 27 '21 at 21:50
  • I think I've read that integration is an extra, auto-type works on its own; basically (I think) if everything is set up correctly which to use is optional. I've been using KeePassXC and its predecessors for several years, and I thought I knew how it works. Thanks for your patience – Eric May 27 '21 at 21:51
0

It's not exactly an answer to my question but a sort of work round: It is possible to choose to run Ubuntu 21.04 on Xorg at boot time (click on the gear wheel). Doing that makes KeePassXC work as expected. If Ubuntu discontinues the Xorg option, obviously, this work round won't work. So the original question "How, exactly, does one use the QT_QPA_PLATFORM=wayland?" to get KeePassXC working on Wayland still stands. (Until an hour ago I've been automatically logging in to Ubuntu, the Xorg option is only visible from the password requesting page.)

Eric
  • 111
  • 7
  • KeePassXC on Wayland auto-type works, without any "QT_QPA_PLATFORM=wayland" parameters. You just have to spend the time to learn how it works. I think that you're probably making some assumptions about how YOU think it should work, and being blinded to how it REALLY works. No dis-respect intended. (install browser integration). – heynnema May 28 '21 at 23:27
  • Thank you for your patience. I have re-read the user guide and I cannot get Auto-Type (on Ubuntu 21.04 on Wayland) to work. (Note: The user guide states, under Auto-Type, that Auto-Type is independent of browser integration.) I have installed browser integration and got it to work on SOME log-in pages but on those that do work the final {ENTER} is ignored. For other log-in pages (the majority) I need to find out about allocating custom fields to certain elements but the guide doesn't seem to say anything about them. More reading! – Eric May 29 '21 at 18:30
  • I just found a major bug with KPXC... in auto-type sequences, it types the password twice. To fix it, either edit the root group or sub-group, or the individual web entry, and change the auto-type sequence from {USERNAME}{TAB}{PASSWORD}{ENTER} to {USERNAME}{TAB}{ENTER} – heynnema May 29 '21 at 18:39
  • Did you see my update to my answer (and also in the comments)? – heynnema May 29 '21 at 18:41
  • Scratch my prior comment about editing the default auto-type sequence. That bug only seems to appear on some web sites... so a web entry-specific auto-type sequence may be required. – heynnema May 29 '21 at 18:50
  • If the update you refer to is the need to edit ~.bash_aliases - I did see it. I had to create the file but including QT_QPA_PLATFORM=wayland had no effect. Neither did QT_QPA_PLATFORM=xrg As well as with KeePassXC, 21.04 under Wayland has other problems so I'm intending to use Ubuntu on Xorg as my normal working. But I will continue, on an ad hoc basis, to try to use 21.04 on Wayland. Just means more reading, more frustration and, I hope, in the fullness of time, more success. – Eric May 29 '21 at 21:55
  • Does auto-type work for you under Xorg? – heynnema May 29 '21 at 23:18
  • Yes.Or, at least, on all the log-in pages I've tried! In many cases I have to use entry-specific auto-type because of the extra information requested (surname, date of birth etc) – Eric May 30 '21 at 07:48
  • Check https://github.com/keepassxreboot/keepassxc/issues and change the search string from "is:issue is:open" to "wayland", and we can see that "they" confirm that auto-type doesn't work on Wayland... although it's working for me using 2.6.4 on 20.10... with some bugs. – heynnema May 30 '21 at 16:12
  • 1
    OK, it's official - it don't work! Let's consider this question closed and keep an eye on github. Been pleasant working with you. Take care. – Eric May 30 '21 at 20:24
  • Let us [continue this discussion in chat](https://chat.stackexchange.com/rooms/124881/discussion-between-eric-and-heynnema). – Eric May 30 '21 at 20:25