Skip to content

Instantly share code, notes, and snippets.

@poyotanp
Last active December 3, 2025 20:53
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.

@djgaven588
Copy link

@poyotanp I've been going insane trying to fix this, thank you!

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