Skip to content

Instantly share code, notes, and snippets.

@poyotanp
Last active February 11, 2026 13:44
Show Gist options
  • Select an option

  • Save poyotanp/d3aff65df96d0cf93c78a3e52fedd6fa to your computer and use it in GitHub Desktop.

Select an option

Save poyotanp/d3aff65df96d0cf93c78a3e52fedd6fa to your computer and use it in GitHub Desktop.
How to disable middle-click paste in KDE Plasma (Wayland)

Environment

  • Arch Linux
  • KDE Plasma 6.1.5 (Wayland)

Solution

For native Wayland applications

  1. open the KDE system settings
  2. select "Workspace" -> "General Behavior"
  3. uncheck "Middle Click: Paste selected text"
  4. Restart the system

For Xwayland applications

(e.g. Discord, etc.)

1. Install XMousePasteBlock

$ yay -S XMousePasteBlock

Perhaps you should choose xmousepasteblock-git. (I failed to build with the xmousepasteblock one)

2. Registering a service in systemd

Create mousepasteblock.service in /etc/systemd/system.

[Unit]
Description=Userspace tool to disable middle mouse button paste in Xorg.

[Service]
ExecStart=/usr/bin/xmousepasteblock

[Install]
WantedBy=multi-user.target

3. Reboot the system

For Firefox

Set middlemouse.paste to false in about:config.

Extra

How to enable middle-click scrolling.

For Firefox

Open Firefox Settings and search for "Scroll", Enable "Use autoscrolling".

For Electron software

Add --enable-blink-features=MiddleClickAutoscroll to the startup argument.

Some sentences may be incorrect because they were translated from Japanese using deepl translation.

@Tenrys
Copy link
Copy Markdown

Tenrys commented Dec 8, 2025

On my end, installing xmousepasteblock worked fine on CachyOS using paru.

However, the provided service didn't really work for me. Instead I installed the one provided by program developer, as a user service:

nano ~/.config/systemd/user/xmousepasteblock.service
systemctl --user enable xmousepasteblock.service
systemctl --user start xmousepasteblock.service

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment