• thingsiplay@beehaw.org
      link
      fedilink
      arrow-up
      6
      ·
      2 days ago

      Then I tell you something that might either blow your mind or be useful in future (or just being fun fact):

      On Linux there is the regular copy/paste clipboard, which you already know how it works. But then there is this primary clipboard called primary selection too, that is independent from normal clipboard. Text will be copied to primary selection when you select a text (in example in Firefox). Just by selection the text with the mouse is enough and it will not affect the normal clipboard. Then you can middle click the text from primary clipboard.

      Read more here: https://tronche.com/gui/x/icccm/sec-2.html#s-2.6.1

      • Blisterexe@lemmy.zip
        link
        fedilink
        arrow-up
        3
        ·
        2 days ago

        It’s cool, but I cannot count the amount of times I was confused by that and accidentally pasted after switching, I would be glad if it became configurable.

      • djdarren@piefed.social
        link
        fedilink
        English
        arrow-up
        2
        ·
        2 days ago

        Well fuck me. That’s kinda neat.

        Shame it doesn’t subsequently work with ctrl+v, because that would be even cooler.

        • MouldyCat@feddit.uk
          link
          fedilink
          arrow-up
          4
          ·
          2 days ago

          Once you’re used to it, you can use the two separate clipboards independently. Say you wrote a sentence like, “one two five four three”, you can correct it by selecting “three”, cutting with Ctrl-X, then selecting “five” (meaning it is now in the selection buffer), hitting Ctrl-V to paste “three” from the clipboard, and then finally middle-click where you need to paste the “five”.

        • mystik@lemmy.world
          link
          fedilink
          arrow-up
          2
          ·
          2 days ago

          on some apps; it works with ctrl-shift-v. so ctrl-v for the clipboard, and ctrl-shift-v for the cut buffer.

        • thingsiplay@beehaw.org
          link
          fedilink
          arrow-up
          2
          ·
          2 days ago

          I guess one could create shortcuts to a tool like wl-copy and wl-paste to either copy or paste content to primary selection (or regular clipboard for that matter). So in that case a simple script could run the command and in your desktop environment you setup a shortcut to run the script.

          Yes its hacky, but in Linux nothing is impossible. :-) (unless it is…)