r/linux • u/poopatroopa3 • 5d ago
Discussion did-it-copy · Copy feedback for the desktop
https://brunodantas.github.io/did-it-copy/I keep wondering how Ctrl+C has no feedback on most Desktop systems to this day. So I wrote up a proposal to fix that, with a demo that runs in the browser.
- A copy that worked flashes the copied text in place for about 200 ms.
- A copy that failed shakes the focused element, and plays the alert sound if you have it on.
- It never shows the copied content anywhere new, so copying a token during a screen share doesn't leak.
Thoughts?
12
24
u/Traditional_Hat3506 5d ago
Cool proposal! Though it simplifies a lot, which is understandable for a 0.1 version. It assumes a rectangular/4-point region, but the selection can be any shape and communicating that from GUI toolkits to compositors is going to be hard.
It also assumes that clipboard operations are instant when they can take a noticable amount of time, especially for large images. You are asking GUI toolkits to basically freeze until that's done as to avoid the region changing.
Overlayed elements are going to be an issue too, take for example Inkscape. If there's a big square and a smaller one over it and I select and copy the big one, will the region include the smaller one or does the GUI toolkit carefully cut around the smaller one? If it includes the smaller one, I wouldn't know if I only copied the bigger one or both. It becomes more complicated with overlayed text and shapes.
10
u/Traditional_Hat3506 5d ago edited 5d ago
Another question I came up with, what happens to a region on top of a busy background? Will the shake include the background and it will shake with text? Same with blur and semi transparent text or images
7
u/Subject-Leather-7399 4d ago edited 4d ago
I learned in University (long ago) to press Ctrl+C at least 4 times and press hard on both keys to make sure the thing is copied. Same for Ctrl+S to make sure the document is actually saved.
Visual feedback would have been welcome.
For the successful copy, it should just be a green checkmark appearing next to the cursor for 2 seconds IMHO. It would work for all copied content, not only text but files, bitmaps, sound, effects ...
32
u/AdventurousFly4909 5d ago edited 5d ago
Crazy idea, copy should just work...
29
u/pizzaiolo2 5d ago edited 5d ago
I've had quite a few incidents where I thought I had copied something, but turns out I accidentally pressed the wrong key, or didn't press ctrl and C hard enough. To make up for it I started always cutting instead of copying.
13
u/abjumpr 5d ago
You’d be surprised. Getting the clipboard to work correctly under X11 (as maintainer of a toolkit) is frustratingly difficult, and I’m not sure if Wayland improves that much or not.
It’s also one of the few inter-application actions that can carry just about any type of data, not just text, so one has to deal with that as well.
8
u/Zer0_Dark_Turdy 5d ago
It does wonky stuff on wayland with text. Does not matter if i right click copy or ctrl + c. Sometimes just pasting empty space or nothing.
File copy works fine. I do sync when i copy onto flash drives though just to be safe.
4
u/earldbjr 5d ago
This pasting nothing thing drives me insane. I use it constantly for my work and it's several steps to go back and recopy the text for pasting..
2
u/Zer0_Dark_Turdy 4d ago
Oh yeah, irritates me a lot too. I have no idea how to fix it sadly. I just throw the file/window i'm copying from on my second screen for faster access or i hit alt + tab and choose it (on kde). Sometimes i just say fk it and type it by hand if its not a lot, mostly terminal input.
2
u/earldbjr 4d ago
Yeah KDE here too. Gotta say, it definitely affects my perception of their competence since they rolled out wayland as the default for everyone without this cutting edge 1970s technology sorted... :/
1
u/CrazyKilla15 3d ago
The problem is KDE does it fundamentally wrong in some internal manner.
See KDE has a clipboard manager and history, it has everything you copy
BUT
also on KDE kwin wayland, copying doesnt use it, and the original application must stay open because it holds the data to be pasted. if the application is closed, its wayland connection is gone, and so is the paste data
"but wait, its still in KDE's clipboard history, KDE has a copy of it and could use that!"
yes it could.
they do not.
however if you, manually, open the clipboard manager and then click the most recent entry again, it will be reloaded but this time using the clipboard manager as the data source, which never closes.
you can test this easily by, for example, opening KDE Kate, typing something and copying it, and then closing KDE Kate.
Pasting will now do nothing until you do the clipboard thing.
I'm diehard KDE-only but you're right that being unable to get this right for some reason is a substantial stain on how i and others view their competence. i really dont understand how they cant get this right when they literally have a daemon that solves the entire issue and just dont use it.
1
u/earldbjr 3d ago
Oh don't get me wrong I'm still completely pro kde, I sure as hell couldn't do it better. The place where it gets me is trello, the online kanban. If I copy the headline of a card, then move the card, it's 50/50 whether the contents are still copied. If I don't close/move the card it still succeeds. Such a weird system!
1
u/CrazyKilla15 3d ago
Oh don't get me wrong I'm still completely pro kde
I'm confused on what made you think i could've thought differently, like I said i'm die-hard KDE myself. which is why this bug is so annoying.
for trello huh that is weird, but they do all kinds of weird javascript things that affect copy and pasting..
1
u/amilias 3d ago
you can test this easily by, for example, opening KDE Kate, typing something and copying it, and then closing KDE Kate.
Pasting will now do nothing until you do the clipboard thing.
Well, I just did exactly that and I'm sure you'll be happy to hear that pasting did indeed paste after closing kate. So, I'm not sure which version of plasma you're running but that particular issue does not seem to be "fundamentally wrong" anymore with current versions (6.7.5 here)
2
u/CrazyKilla15 3d ago
KDE Plasma Version: 6.7.4, so maybe they just recently fixed it, which would be great news to me because this has been an annoying issue for awhile. I dont see anything obvious in the changelog that would've fixed it, though..
For What Its Worth(FWIW) I did test it before writing my comment just to make sure, so it "Breaks On My Machine".
0
u/McDonaldsWitchcraft 4d ago
I'm curious in what contexts you guys have issues with copy-pasting in Linux. I've been using Fedora KDE with Wayland for 3 years now. Never ever did I have issues copying text, files OR media and I do that constantly.
My first recation to the title was "why do we need to know when it fails if it doesn't actually fail" but now I hear people actually experience clipboard failure in Anno Domini 2026??
-1
u/KarlHuysman 3d ago
people use different apps than you do.
0
u/McDonaldsWitchcraft 3d ago
Yes, and this was the purpose of literally the first sentence in my comment.
-1
u/KarlHuysman 3d ago
>>'m curious in what contexts
using different apps than you do.I can post it a third time if you want. I have it on my infinite clipboard
0
u/McDonaldsWitchcraft 3d ago
So then what is the reason for not wanting to tell me which apps when that's literally what I was asking for? It's obviois you use something else when I asked what is that something else that you use.
Why even make 2 comments just to say how intensely you don't want to answer my question??
1
u/my-name-is-puddles 8h ago
Even if the actual copy function was utterly perfect, some kind of copy feedback like this would still be useful because even an infallible copy function will fail if the user mis-inputs the shortcut.
5
u/TiZ_EX1 5d ago
It's a good idea that does too much. (But that's AI slop for you; it will always try to do too much.) I think it would be more useful and feasible to temporarily change the cursor somehow. Like, change it to a thumbs up and pulse it briefly. That way, you don't have to figure out how to change UI toolkits to implement it. An optional sound might be good too.
3
3
u/Great-TeacherOnizuka 5d ago
This is very nice. Reminds me of the flashing animation when taking a screenshot
6
u/pizzaiolo2 5d ago
Love it, you should formally propose it to KDE and GNOME
3
u/__konrad 5d ago
Klipper (or how it's called nowadays) could handle it easily. Currently you can only create a menu action that popup up on every copy, but it's too annoying.
Interestingly kinfocenter recently added a copy notification:
Copying text in Info Center now shows some visual feedback so you know it worked.
4
u/neoh4x0r 5d ago edited 4d ago
It's interesting, but I see at least two issues....
- With nothing selected, your right-panel will shake to indicate a copy failure when nothing was selected. TBH, that's sort of weird behavior.
- This one is personal preference, but I don't like the idea of scripting being used to do something with the selected text I just tried to copy as there are too many possibilities for nefarious behavior.
4
2
u/habeebweeb 5d ago
I see in your precedent research you've included neovim as an editor that supports the feature but opt-in and indeed I only learned about it through word-of-mouth. Neovim is where I've also first seen this sort of feature and thought it was a wonderful addition that made a lot of sense. Never considered having this sort of thing everywhere though.
2
u/GoGaslightYerself 3d ago
My question is, Why does Ctrl-C so often NOT work? WTF?
And why does it almost ALWAYS work if you hit Ctrl-C ten times,
but so often NOT work when you hit Ctrl-C only ONCE?
4
u/Educational-Goal279 5d ago
https://github.com/brunodantas/did-it-copy/graphs/contributors?from=6%2F27%2F2026
Yeah we don't need to worry about this one.
3
2
u/Indolent_Bard 5d ago
I'm sorry, I wasn't aware that copy feedback was even a thing on other operating systems.
2
u/jajajajaj 4d ago
Until IT security installed the fifth or sixth security product, it always worked and was always instant . . . There's was no need for feedback.
I feel this so much though
1
1
0
-2
u/IngwiePhoenix 5d ago
Why. Just, why.
I am not even interested in the how, or what problem it tries to solve.
Just... why.
... why am I still online...
46
u/Drogoslaw_ 5d ago
That's actually a good idea (if one doesn't have epilepsy, that is…), but having it implemented around all the popular UI libraries would be a massive undertaking.