this post was submitted on 08 Oct 2023
198 points (96.3% liked)

Linux

48352 readers
1922 users here now

From Wikipedia, the free encyclopedia

Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).

Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.

Rules

Related Communities

Community icon by Alpár-Etele Méder, licensed under CC BY 3.0

founded 5 years ago
MODERATORS
 

Pretty sure most of you already know this but for those who don't: you have two clipboards in Linux. One is the traditional clipboard where you copy with control c and paste with control v. The other one is when you highlight text and use the mouse middle click to paste text.

More details here.

top 50 comments
sorted by: hot top controversial new old
[–] [email protected] 69 points 1 year ago (1 children)
[–] [email protected] 16 points 1 year ago* (last edited 1 year ago) (1 children)

Is this applicable for Wayland as well? That link makes several references to X and its ecosystem of tools.

[–] [email protected] 14 points 1 year ago

If I understand it correctly, Wayland only specifies a single clipboard but no primary. But most (all?) wayland compositors implement an additional protocol that's also supported by the toolkits (gtk, qt, ...) and programs like wl-clipboard.

So yes, wayland also has clipboard + primary. But no secondary, as far as I found. Though I never used secondary on X anyway.

[–] [email protected] 50 points 1 year ago (1 children)

Ironically neither GNU nor Linux has a clipboard (well GNU Emacs probably has like 37 of them for some reason). "Primary selection" (the other clipboard that people don't tell you about) started off on X11, which of course had to implement by XFree86, which became Xorg, and then it copied (ha ha) by other non-X-related software like gpm and toolkits like GTK when using Wayland.

[–] [email protected] 5 points 1 year ago

Emacs's regular clipboard is the "kill ring" which also allows you to retrieve any previously cut/copied text. It also has "registers" where you can store and retrieve snippets of text, which can be considered clipboards when used for this purpose. Registers can be referenced by any character you can type on your keyboard, including control characters like ^D.

This totals... a lot of clipboards.

[–] [email protected] 42 points 1 year ago

Btw it makes using other OSs painful when you are used to it...

[–] [email protected] 28 points 1 year ago (2 children)

I use auto scroll a lot, middle click paste is generally an immediate no for me.

[–] [email protected] 10 points 1 year ago (1 children)

How do middle-click-to-paste and middle-click-to-scroll conflict? In Firefox I can click-to-paste if the cursor is over an input field and click-to-scroll anywhere else. Never had any problem with this behavior.

[–] [email protected] 7 points 1 year ago (1 children)

How do middle-click-to-paste and middle-click-to-scroll conflict?

Some of us are clumsy.

load more comments (1 replies)
[–] [email protected] 4 points 1 year ago

How did you setup auto scroll? It doesn't work for me.

[–] [email protected] 27 points 1 year ago (3 children)

Not going to lie, I hate the middle click clipboard and disable it ASAP. I really dislike the idea that it copies things without my explicit permission.

[–] [email protected] 47 points 1 year ago (1 children)

I don't believe anything is actually copied until you request it to be pasted. The clipboards in Linux mark where the data is, and don't actually initiate a copy until there's a destination.

https://wiki.archlinux.org/title/clipboard

[–] [email protected] 10 points 1 year ago

Yes. You can test this by selecting something, closing that window and attempting to paste. It won't work. Closing the window removes the information about what was highlighted, so there is nothing to paste. If it were to copy upon selection you'd still be able to paste.

[–] mvirts 10 points 1 year ago

Lol I have gotten so used to it that I can barely use web terminals that don't support it

[–] [email protected] 4 points 1 year ago (2 children)

I actually like the feature but could you explain how you disabled it? I've tried to merge all three clipboards into one a few years ago and couldn't make it work

[–] [email protected] 3 points 1 year ago

KDE has the option to disable middle click paste, so I do that. Out of sight, out of mind

load more comments (1 replies)
[–] Quazatron 17 points 1 year ago (1 children)

Neat, he?

It's a pain when you switch between Windows and Linux all the time and you can't do the middle click in Windows.

[–] [email protected] 16 points 1 year ago (3 children)

Tbf, lots of things in Windows are a pain when you're used to Linux.

Correction: Lots more things are a pain...

[–] [email protected] 12 points 1 year ago

But on the other hand, many things that you take for granted on Windows are a pain on Linux. For example, if you want to see advertisements, you can't just open the Start menu.

[–] [email protected] 4 points 1 year ago (2 children)

Just simply...At least in Cinnamon, I can mouse over the audio icon on the panel and roll the scroll wheel to change the volume. Last time I tried it on Windows, you had to click the icon first. While that alone doesn't sound like much, the whole OS is like that, needing extra little interactions for basically everything. Now that I'm used to using Cinnamon, using Windows feels like walking in beach sand.

load more comments (2 replies)
load more comments (1 replies)
[–] [email protected] 12 points 1 year ago (4 children)

Is it possible to have have a Windows 10-like clipboard in Mint? Where you can copy multiple stuff with ctrl+c and then press super+v to have a dropdown of things that you copied with a possiblity to pin some of them?

[–] [email protected] 19 points 1 year ago
[–] [email protected] 14 points 1 year ago* (last edited 1 year ago)

Klipper on KDE offers a clipboard history. Don't know about other DEs.

[–] 6xpipe_ 13 points 1 year ago

What your talking about is called a clipboard manager, and there are tons of them out there. All with varying features.

[–] demonsword 3 points 1 year ago

qlipper is the one I use the most

[–] merthyr1831 11 points 1 year ago

Oh, that explains why my steamdeck layout randomly pastes text when I'm trying to use a mmb shortcut on my dang browser

[–] [email protected] 10 points 1 year ago (1 children)

And then there is the "clipboard" (copy paste function) in the nano text editor being a third

[–] [email protected] 18 points 1 year ago (5 children)

Vim also has it's own clipboard

[–] [email protected] 10 points 1 year ago (1 children)

You can also configure vim to use the first clipboard (works with nvim but never tested on vim).

[–] [email protected] 8 points 1 year ago (1 children)

works with vim but never tested on vi

[–] [email protected] 7 points 1 year ago

It does not work in vi. The + and * register were a vim invention (tested in vim compatibility mode and busybox vi)

[–] [email protected] 4 points 1 year ago

Vim has a ton of clipboards and I still couldn't figure them out.

load more comments (3 replies)
[–] [email protected] 9 points 1 year ago

I knew and use this, but I never thought to call it two clipboards :)

Plus I'd never heard of shift-ins, I just used ctrl-shift-c/v in graphic terminals :P

[–] [email protected] 7 points 1 year ago

Ohhhhh!!!! IT WORKS!

This will be so usefull in the future.

[–] [email protected] 7 points 1 year ago

Wow! TIL too, thanks!

[–] JubilantJaguar 6 points 1 year ago (1 children)

This user, at least, has not touched a mouse in a decade. Young people do not even know what a mouse is.

[–] pirat 3 points 1 year ago* (last edited 1 year ago)

It's like a rat but cute, right??

btw do you know how to press Ctrl on my keyboard? I have already found the key of C, they're all white and sound good, kind of like an organ, but I can't see any Ctrl key. Also, do I need to press the entire key of C at once to copy? It's gonna sound intense! But I haven't learned using all 10 fingers yet for the keyboard. I only use two, so it will be hard to press them all at once while also pressing Ctrl once I find it! Is it one of those black keys? Actually I haven't even heard about the key of V yet... So I can't paste before I've learned a lot more! I've only learned A to D by now. And btw how do I compile in C#? Is keyboard really supposed to be so hard to use???

[–] [email protected] 6 points 1 year ago (1 children)

Yes and I hate it. Wish I could just turn off such nonsense.

[–] [email protected] 8 points 1 year ago

You don't have to use it....

[–] donio 5 points 1 year ago

Clipboard managers often have an option to synchronize them. There are standalone tools as well, autocutsel for example.

[–] [email protected] 5 points 1 year ago* (last edited 1 year ago) (1 children)

On my arch install with hyperland, clip boards have been by far the hardest thing to setup. I finally got a basic clipboard manger working using clipman and wofi. But tbh I don't really understand how that's working.

My main issues though have been trying to copy from one with vim open to other terminal with vim. Copying from vim elsewhere using y(yank) works fine. Copying elsewhere into vim works great. But vim to vim will not work for me.

Also trying to find a way to make copying text out of a terminal running tmux not so overly complex and tedious.

[–] [email protected] 3 points 1 year ago (1 children)

For copying from Tmux, I recommend tmux-yank. There are also multiple plugins allowing you to copy predefined set of text types (IP adresses, URLs, etc...). I'm currently using tmux-thumbs. Note that you have to set custom command in tmux-thums to actually copy the text to xclip or whatever you are using. example in my dotfiles

load more comments (1 replies)
[–] [email protected] 4 points 1 year ago

This has been a thing for like ever. Throws me off a lot in Windows when I just want a temporary clipboard to search something and nothing comes up.

I think PowerShell abides by it, but that's it.

[–] [email protected] 3 points 1 year ago

I didn't realize they were different. I always thought my copy failed and tried to use one copy with the other paste.

load more comments
view more: next ›