1
submitted 9 months ago* (last edited 9 months ago) by Object@sh.itjust.works to c/bashing@sh.itjust.works

Requirements: moreutils, which contains vipe command, Wayland for clipboard. vipe is a command that takes in text, creates a temporary file with that text, and prints the content in the editor when it closes.

Code:

# Change editor if necessary. Also see the notes below.
# export EDITOR="kate -b"
wl-paste | vipe | wl-copy -n 2>/dev/null

How it works:

wl-paste: Gets your clipboard content, and print that

vipe: Gets the printed clipboard content, open an editor pre-filled with it

wl-copy: Gets the edited result, add it back to your clipboard without the newline at the end


Notes:

You must save the content in the editor before quitting.

The editor must not run detached. Otherwise, vipe thinks the editor is done editing, and does nothing. For example, use environment variable EDITOR="kate -b" (flag to make kate to run in blocking mode) to use kate for editing your clipboard.

no comments (yet)
sorted by: hot top new old
there doesn't seem to be anything here
this post was submitted on 20 Feb 2026
1 points (100.0% liked)

BASHing

51 readers
1 users here now

Share your bash scripts here!

founded 10 months ago
MODERATORS