wlfrn

joined 3 years ago
[–] wlfrn@lemmy.ml 2 points 5 months ago

There are lots of ways to move data between or within graphical windows! But the list is shrinking

  • clipboard - cltr-c / ctrl-v
  • drag and drop - mouse selection, mouse drag
  • primary - mouse selection -> middle click (or shift+ins); moves text cursor
  • secondary - ctrl+select (alt+select in emacs); secondary doesn't move text cursor. largely forgoten. motif, patched gtk; not in qt, tk, mainline gtk, etc
  • cut-buffer - deprecated everywhere. set by application using X11 window property for state

https://en.wikipedia.org/wiki/X_Window_System_selection

[–] wlfrn@lemmy.ml 1 points 5 months ago
[–] wlfrn@lemmy.ml 2 points 5 months ago (2 children)

You're describing the primary selection. The article's about patching secondary selection back into gtk3 (c. 2015?). It's ctrl+select followed by ctrl+middle to paste as yet another clipboard. This has the unique and useful property that neither selection nor paste changes the text cursor's position.

A more in-depth look at secondary selection is in the embedded video which has it's own write-up on https://www.cs.man.ac.uk/~lindsec/secondary.html

[I suspect primary-secondardy selection is not a confusion you have, but one a casual skip-the-article-direct-to-comments reader might have]

[–] wlfrn@lemmy.ml 2 points 5 months ago* (last edited 5 months ago)

And the keyboard shortcut for primary clipboard paste (Shift+Ins) is already gone from gtk.

26
X11 Secondary Selection (www.cs.man.ac.uk)
submitted 5 months ago* (last edited 5 months ago) by wlfrn@lemmy.ml to c/linux@lemmy.ml
 

The secondary-selection is used when the cursor is in some focussed Recipient window, in order to grab some text (or whatever) from some Donor window (possibly the same window as the Recipient) and have that text pasted at the Recipient's insertion-point (overwriting any primary-selection in the Recipient).

[–] wlfrn@lemmy.ml 5 points 6 months ago* (last edited 6 months ago) (2 children)

For interactive editing, the keybind alt+. inserts the last argument from the previous command. Using this instead of $_ has the potential to make your shell history a little more explicit. (vim $_ isn't as likely to work a few commands later, but vim actual_file.sh might)

[–] wlfrn@lemmy.ml 4 points 6 months ago* (last edited 6 months ago)

https://atuin.sh/ does one better. history with context: $PWD, $HOST, time. There's a bunch of other bells and whistles, but they're easy to ignore to get an noninvasive upgrade to ctrl+R