CopyQ icon indicating copy to clipboard operation
CopyQ copied to clipboard

CopyQ on Pop!_OS 2024 - Wayland

Open robertstrom opened this issue 1 year ago • 3 comments

Describe the bug CopyQ not capturing text in the Pop!_OS 2024 release (Pop!_OS is based on Ubuntu. This release is using the Pop!_OS Cosmic DE). This release is running Wayland. I have tried using both of the documented workarounds in the issues page shown below

https://copyq.readthedocs.io/en/latest/known-issues.html

env QT_QPA_PLATFORM=xcb copyq

and configuring the Exec= line in the ~/.config/autostart/copyq.desktop file

Exec=env QT_QPA_PLATFORM=xcb copyq

CopyQ is set to auto-start and that is not working and copying is not working

To Reproduce

Since CopyQ is not auto-starting I ran the command copyq at the command line and saw the message

ERROR: [default] QtCritical: Failed to activate Wayland clipboard

Expected behavior CopyQ should auto-start

CopyQ should work in Wayland

Screenshots

Version, OS and Environment

  • Application Version (for example 7.1.0)

CopyQ Clipboard Manager 9.0.0 Qt: 5.15.8 KNotifications: 5.103.0 Compiler: GCC Arch: x86_64-little_endian-lp64 OS: Pop!_OS 24.04 LTS

FYI - CopyQ is currently installed via the deb package downloaded from the CopyQ GitHub. I originally installed it from the Pop!_OS Cosmic App Store which installed the Flatpak version. Once I found that the Wayland potential fix needed the ~/.config/autostart/copyq.desktop file edited and I saw that the file did not exist I bailed on the Flatpak version. I am NOT a fan of Flatpak or Snap because of this type of an issue. Making configuration changes to apps installed via either of those two methods is a royal PITA (at least based on what I am remembering from a few years ago).

Also FYI - while trying to copy and paste from the terminal in the latest Pop!_OS I tried to use some xsel commands that I have used before to copy from the terminal. I know the command below works, but it does not work in Wayland.

xsel --input --clipboard

I found this terminal copy and paste solution that does copy from the terminal in Wayland

https://github.com/bugaevc/wl-clipboard

  • OS -
NAME="Pop!_OS"
VERSION="24.04 LTS"
ID=pop
ID_LIKE="ubuntu debian"
PRETTY_NAME="Pop!_OS 24.04 LTS"
VERSION_ID="24.04"
HOME_URL="https://pop.system76.com"
SUPPORT_URL="https://support.system76.com"
BUG_REPORT_URL="https://github.com/pop-os/pop/issues"
PRIVACY_POLICY_URL="https://system76.com/privacy"
VERSION_CODENAME=noble
UBUNTU_CODENAME=noble
LOGO=distributor-logo-pop-os
  • Desktop environment, window manager (if applicable)
SHELL=/bin/bash
WINDOWID=0
COLORTERM=truecolor
GTK_IM_MODULE=ibus
COSMIC_PANEL_BACKGROUND=ThemeDefault
DRI_PRIME=pci-0000_00_02_0
XMODIFIERS=@im=ibus
XDG_SEAT=seat0
PWD=/home/rstrom/Documents
XDG_SESSION_DESKTOP=COSMIC
LOGNAME=rstrom
XDG_SESSION_TYPE=wayland
IM_CONFIG_CHECK_ENV=1
X_MINIMIZE_APPLET=false
HOME=/home/rstrom
IM_CONFIG_PHASE=1
LANG=en_US.UTF-8
LS_COLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=00:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.zst=01;31:*.tzst=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.wim=01;31:*.swm=01;31:*.dwm=01;31:*.esd=01;31:*.avif=01;35:*.jpg=01;35:*.jpeg=01;35:*.mjpg=01;35:*.mjpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.webp=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.oga=00;36:*.opus=00;36:*.spx=00;36:*.xspf=00;36:*~=00;90:*#=00;90:*.bak=00;90:*.crdownload=00;90:*.dpkg-dist=00;90:*.dpkg-new=00;90:*.dpkg-old=00;90:*.dpkg-tmp=00;90:*.old=00;90:*.orig=00;90:*.part=00;90:*.rej=00;90:*.rpmnew=00;90:*.rpmorig=00;90:*.rpmsave=00;90:*.swp=00;90:*.tmp=00;90:*.ucf-dist=00;90:*.ucf-new=00;90:*.ucf-old=00;90:
_JAVA_AWT_WM_NONREPARENTING=1
XDG_CURRENT_DESKTOP=COSMIC
WAYLAND_DISPLAY=wayland-1
CLUTTER_IM_MODULE=ibus
QT_QPA_PLATFORM=wayland;xcb
LESSCLOSE=/usr/bin/lesspipe %s %s
COSMIC_PANEL_SIZE=S
TERM=xterm-256color
COSMIC_PANEL_NAME=Dock
LESSOPEN=| /usr/bin/lesspipe %s
USER=rstrom
DISPLAY=:1
SHLVL=1
MOZ_ENABLE_WAYLAND=1
QT_IM_MODULE=ibus
XDG_VTNR=1
XDG_SESSION_ID=4
COSMIC_PANEL_OUTPUT=eDP-1
PANEL_NOTIFICATIONS_FD=20
XDG_RUNTIME_DIR=/run/user/1000
COSMIC_PANEL_ANCHOR=Bottom
XCURSOR_THEME=Cosmic
XDG_DATA_DIRS=/home/rstrom/.local/share/flatpak/exports/share:/var/lib/flatpak/exports/share:/usr/local/share:/usr/share
GDK_BACKEND=wayland,x11
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus
RUST_BACKTRACE=1
MAIL=/var/mail/rstrom
ALACRITTY_WINDOW_ID=0
X_PRIVILEGED_WAYLAND_SOCKET=120
OLDPWD=/home/rstrom
_=/usr/bin/env

Additional context

robertstrom avatar Aug 11 '24 21:08 robertstrom

UPDATE: I have finally got CopyQ partially working on Pop!_OS 24.04 LTS

I ended up in a conversation with a Pop!_OS support person about another issue and I mentioned Wayland and the fact that a number of things have issues working in a Wayland environment. He said that he also used CopyQ and that he had it working on the new Pop!_OS 24.04 using the Cosmic DE.

He said that I should add this to the /etc/environment file

COSMIC_DATA_CONTROL_ENABLED=1

I added that and it still did not work (I had the .deb installation of CopyQ). I uninstalled the .deb version and installed the Flatpak version from the Cosmic store (it's version 9) and now CopyQ is partially working.

The copying and pasting is now working but I have run into the following issues:

  • The auto start checkbox does not appear in the GUI
  • I ran this command to check the auto start configuration flatpak run com.github.hluk.copyq config | grep -i auto. Auto start was not enabled
  • I ran this command to try to enable the application to start automatically flatpak run com.github.hluk.copyq config autostart true
  • Then I ran this command to confirm the configuration flatpak run com.github.hluk.copyq config | grep -i auto. I could see that the auto start configuration was now enabled
  • CopyQ is still not auto starting
  • I pasted in the Backup on Exit script and the backups are not working on exit (I have tried numerous times). The backup script was not changed at all. 100% stock default settings. Backing up to Documents/copyq-backups. The Documents directory exists, but there is no copyq-backups directory
  • I tried creating a copyq-backups directory and then exited the program to see if it would create a backup. It did not.
  • CopyQ does not maintain it's position or size when either closing the window or when exiting and reopening the application (behavior I see in other installations on Linux, etc.)

Love, love, love the application. Would sure love to see it working on a Wayland desktop. I also briefly tried using it on a 64 bit Raspbian desktop and it would not copy and paste there either. I did not keep that install functioning for long enough to get much more data.

This has been opened and marked as a bug for quite some time now but I am not sure if anyone has looked at this. Could someone please acknowledge that this has been seen and let me know if this is being looked into or not?

Thanks!

robertstrom avatar Sep 20 '24 01:09 robertstrom

@hluk and other developers. If you are looking at these Wayland issues also look at my comments in this issue - New install of CopyQ not importing of clipboard content: not linking with Wayland clipboard? #2847

robertstrom avatar Sep 22 '24 20:09 robertstrom

Thanks for the detailed description! Is there any new update?

AFAIK, clipboard monitoring does not work on Ubuntu in native Wayland mode because Ubuntu does not support the data control protocol. But it sounds like setting COSMIC_DATA_CONTROL_ENABLED=1 and restarting the system (or maybe just log-out and log-in) would help.

You could test if the data protocol is supported with the wl-paste command (from terminal), which would print the current clipboard content if the protocol is supported and an error if it is not.

I think if you start the app with env QT_QPA_PLATFORM=xcb copyq, it runs in XWayland compatibility mode, and it may work well with other XWayland apps, but there could still be issues when e.g. a Wayland native app has focus.

hluk avatar Feb 16 '25 08:02 hluk