Primary Selection Disabled in SwayWM

Oh, that took me some time to investigate.

There was thig feature (more a bug to me) when I was scrolling through the long email I have written, and I did not notice I paste some shit I constantly select with my mouse. That’s the habit of mine, and it helps me concentrate on the reading. The pasting happens when you press the mouse wheel. I wasn’t actually meaning to press it, rather scrolling. And my mouse is perfectly fine, and in a perfectly healthy condition! If it was broken, the shit would be pasted much more often. I know it by experience, because before this mouse, I had this broken mouse.

‘Don’t use it’ they say.

FUCKING WHAT?! You can select the shit not meaning it, and then you can middle-click not meaning. And not even noticing! That happened to me. Often, when I was editing CSS for my website, and obviously that was broken. But that wasn’t a big issue. I was accidentally pasting shit into the layout partials for my website, and while there was no issue purely because I just noticed that at some point.

But also, I was writing a long email, and I was pasting some irrelevant shit in there, and did not notice it, because the whole block of text looked very similar. A block of text I meant to send, and another block of text I did not mean to send.

That’s a fucking security issue. Here’s the solution for sway, thankfully that was implemented.

# idiotic feature when middle-click (the scroll wheel) mouse button (usually button-2) pastes things

primary_selection disabled

Here’s a thing though, you need to reboot. Or re-enter sway, if you will. Reloading the config won’t help. But that’s a minor annoyance for a desktop. Otherwise, I have no idea how to battle with this shit. Last time I’ve heard, it’s disabled in Wayland-only sessions like Gnome. And I assume that’s treated as an obsolete junk. Really, who ever needs that? What for? There’s cmd+c (if you’re lucky to have Apple keyboard or a keyboard with cmd, and you know how to make X86Copy, ’Paste, and ’Cut work.

set $mod Mod4

bindsym --to-code $mod+z exec wtype -P XF86Undo
bindsym --to-code $mod+Shift+z exec wtype -P XF86Redo
bindsym --to-code $mod+x exec wtype -P XF86Cut
bindsym --to-code $mod+c exec wtype -P XF86Copy
bindsym --to-code $mod+v exec wtype -P XF86Paste

Where Mod4 is the left CMD key.

••• Sway Linux Software

Reply by Email