this post was submitted on 09 Aug 2024
29 points (100.0% liked)

Linux

48143 readers
770 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
 

I want to be able to copy text to a "Copy Box".

In early RTS you could bind units to number keys 1 through 10 by pressing Ctrl + # and then # to recall that selection.

I want to be able to have Multiple Copy & Paste boxes like Copy 1, Copy 2, Paste 3

Is there anything like this on Wayland already?

all 10 comments
sorted by: hot top controversial new old
[–] thingsiplay@beehaw.org 8 points 3 months ago (2 children)

I'm not sure in what context do you mean? Do you mean a Clipboard manager? At least in KDE there is a widget (in other words a tool) that has a menu with a history of copied elements. Clicking one of the list items from the history will copy it back to current clipboard. Do you ask something like that?

[–] electricprism@lemmy.ml 6 points 3 months ago* (last edited 3 months ago) (1 children)

(Similar to) tiling window managers typically having 6-10 workspaces

I would like to be able to split Copy & Paste from 2 Actions into 20 Actions.

I'm not sure exactly what key binding yet but something like Ctrl+C+1 to copy to Box 1 and Ctrl + V +1 to Paste from Box 1, rinse and repeat for numbers 2 through 10.

Use case example, I want to login to a website but my login is in an email

Ctrl+C+1 To copy to URL to clipboard box 1

Ctrl+C+2 To copy the username

Ctrl+C+3 To copy the password

Open the browser

Ctrl+V+1 Paste URL in location bar

Ctrl+V+2 Paste username

Ctrl+V+3 Paste password

This allows me to complete the task without switching back and forth between windows 3 times. I still press copy and paste 6 times but don't need to switch windows, and I still have 7 clipboard boxes left to copy & paste other important things in case I want to use the login again then I can simply Paste saving me finding the login or whatever else and copying it again to memory.

[–] thingsiplay@beehaw.org 3 points 3 months ago

I see. I think this should be possible with the widget that KDE comes with.

You could also build your own very simple manager. There is a Wayland commandline tool to save or load something in clipboard: https://github.com/bugaevc/wl-clipboard It should be in the repositories of most distros I think. It comes with a copy and a past command. Using file redirection, you could write and read to files.

Following commands: wl-paste > ~/.cache/copybox/1 in example would save the current clipboard content into a file named 1 in the copybox (you can have any directory name, I just chose this as an example) directory under ~/.cache. You would need to make sure that the directory exist, so creating it first. wl-paste > ~/.cache/copybox/2 would save the content to a file named 2. And to read back a file into clipboard use wl-copy < ~/.cache/copybox/2

In your system you need to setup shortcuts for each of these actions to read or write the clipboard. Don't forget to create the directory you chose (in this example ~/.cache/copybox). What shortcuts you choose is up to you. Alternatively you could use a menu builder tool such as wofi, a tool that is similar to rofi. But that requires additional understandings and scripting. If you don't find any solution, then these could be your steps to create your own. Or maybe someone else does it.

[–] lord_ryvan@ttrpg.network 3 points 3 months ago

And there's diodon which works excellent in Cinnamon, GNOME! (and I suppose KDE, too)

[–] jbrains@sh.itjust.works 6 points 3 months ago (1 children)

I use copyq for this purpose. It doesn't do exactly what you've asked for, but it solves a very similar underlying problem.

[–] Rentlar@lemmy.ca 3 points 2 months ago* (last edited 2 months ago)

I found a solution today using Fcitx, the clipboard addon, and the default shortcut Ctrl+semicolon. However, it works more like a history that pushes each older item down, rather than 10 separately accessible boxes. It seems as though it will work with the use case you described.

Note: I have no idea how well Fcitx is supported in Wayland.

[–] nous@programming.dev 2 points 3 months ago

One of the big problems with this is there is no global shortcut for copy and pasting. At most there are the primary, secondary and selection buffers which applications can copy into and paste from. But each application handles the copy/pasting functionality in their own way. Or rather they typically let the toolkit they are using deal with it.

Klipper, the kde clipboard manager comes close to something like what you want. You can CTRL+C multiple times and it stores a history of everything, then you can assign shortcuts to cycle through the entries and paste them out again. All it is really doing is reading the clipboard when it changes, saving that value than essentially copying from that saved list when you cycle though it. So it would be possible to write something similar that has specific numbered buffers - but you would still be saving/loading into the primary clipboard which applications can then paste from rather than creating a new set of shortcuts to paste from each buffer directly into an application.