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
?
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
Then....
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.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.)