WPS Office uses XWayland for operation, which causes issues with copying text from applications running via Wayland (such as Chromium, Firefox, and others).
This happens due to the incompatibility of the clipboard between Wayland and XWayland.
As a result, the WPS Office application cannot access the clipboard content, leading to errors when attempting to paste text.
- Install dependencies:
- Arch Linux: sudo pacman -S xclip wl-clipboard
- Ubuntu/Debian: sudo apt-get install xclip wl-clipboard
- Create a Bash script (e.g., clipboard.sh):
#!/bin/bash
while true; do
wl-paste | xclip -selection clipboard
xclip -selection clipboard -o | wl-copy
sleep 0.5
done
- Make the Bash script executable:
chmod +x clipboard.sh
-
Configure the Bash script to run at system startup using any convenient method:
- For hyprland:
Edit the file hyprland.conf:
# fix buffer copy&paste between wayland and xwayland exec-once = sleep 2 && $HOME/.config/hypr/clipboard.sh # Enter your path to the script
- For i3wm:
Edit the file config:
# fix buffer copy&paste between Wayland and XWayland exec --no-startup-id $HOME/.config/i3/clipboard.sh & # Enter your path to the script
- For bspwm:
Edit the file ~/.config/bspwm/bspwmrc:
nohup $HOME/.config/bspwm/clipboard.sh & # Enter your path to the script
- For KDE:
Create file ~/.config/autostart/clipboard.desktop
[Desktop Entry] Type=Application Name=my-script GenericName=my-script Comment=My Script Exec='absolute_path_to_your_script' Terminal=false
- For Gnome:
Create file ~/.config/autostart/clipboard.desktop
[Desktop Entry] Name=my-script GenericName=my-script Comment=My Script Exec='absolute_path_to_your_script' Terminal=false Type=Application X-GNOME-Autostart-enabled=true
Also fixes VirtualBox Shared Clipboard on Wayland because it is supposed to work with the X11 clipboard only.