Skip to content

Instantly share code, notes, and snippets.

@poyotanp
Last active July 18, 2026 20:52
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.

@whi-tw

whi-tw commented Jun 25, 2026

Copy link
Copy Markdown

there's a systemctl user script automatically installed to /usr/lib/systemd/user/xmousepasteblock.service (at least there was on cachyos).

You can just run systemctl --user enable --now xmousepasteblock to enable it: no need to create anything. Plus, it'll be updated automatically if the package changes.

Content at time of writing:

[Unit]
Description=XmousePasteBlock - Userspace tool to disable middle mouse button paste in Xorg
After=graphical-session.target

[Service]
Type=simple
ExecStart=/usr/bin/xmousepasteblock
Restart=on-failure
RestartSec=5s

[Install]
WantedBy=graphical-session.target

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