Middle button mouse set for paste problem

Does anyone know how to deactivate this function?
I do have deactivated the “middle click paste” option from tweaks, but as you can imagine it is not working.

I have Manjaro GNOME 3.36.5

thanks

1 Like

The tweak tool option only affects gnome apps like gedit. Other programs like Firefox have their own settings. In Firefox, it is set in about:config.

Pasting your primary selection (note: it is note your clipboard, but the text you selected last) is default feature of xorg. It is not easy to disable globally. One option is to disable middle click entirely or assign it to some other function, but you probably don’t want that.

This page has multiple solutions for this issue and this is my favorite:

Here’s the simplest solution I’ve found to keep middle click functional without it pasting things.

First install sxhkd and xsel.

Then configure ./.config/.sxhkd/sxhkdrc like so

~button2
echo -n | xsel -n -i
~control + c
echo -n | xsel -n -i
~control + x
echo -n | xsel -n -i
And that’s basically it.

Now start sxhkd (or configure it to launch on startup). Now, middle mouse will no longer paste anything but will otherwise function like normal. (As long as you use only ctrl+c and ctrl+x to copy things that is, if you copy things with the mouse it can paste once before it returns to normal.)

So you empty your primary selection (not your clipboard) whenever you click with the middle mouse button, and then you pass the middle click to whatever program is running. This should result in mostly your expected behavior.

You may wish to autostart sxhkd with a systemd service like this:

That might already be provided by the sxhkd package, so you can just run systemctl enable sxhkd --now. If it is not, you can first create that file in /etc/systemd/system/sxhkd.service.

5 Likes

I’ve marked the below answer as the solution to your question as it is by far the best answer you’ll get.

However, if you disagree with my choice, please feel free to take any other answer as the solution to your question or even remove the solution altogether: You are in control! (I just want to avoid even more subjective opinions being posted and confusing you even more)

:innocent:
P.S. In the future, please mark a solution like this:
Solution
so that the next person that has the exact same problem you just had will benefit from your post as well as your question will now be in the “solved” status.

2 Likes

Thanks for the help!

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.