8

Whenever I copy any text via X11's copy/paste feature, I would like all formatting to be removed. I waste time daily dumping the text into a terminal, then copying again.

Is this possible?

1
  • 2
    What kind of formatting are you refering to? Which applications are you copying from and into? Are you using the PRIMARY selection (mouse selection and middle click to paste) or the CLIPBOARD selection (Ctrl+C/Ctrl+V)? Commented Aug 1, 2015 at 22:32

3 Answers 3

5

This should do it:

xclip -selection c -o | xclip -selection c
2
  • 1
    Thank you! I've been trying to figure out how to do this for so long now. I'll just bind that command to a fluxbox keyboard shortcut, and it will give me the option to remove formatting if I want!
    – cat pants
    Commented Aug 3, 2015 at 6:56
  • 1
    Is there a way to automatically run this command every time some thing copied? I tried whit the clipboard from KDE but no luck.
    – Den
    Commented May 9, 2018 at 9:07
0

This will also do it in case you have xsel instead of xclip. You may need to use the -b option on both commands if it's in your CLIPBOARD instead of your primary SELECTION (See xsel man page).

xsel | xsel

Mac users can do this with pbcopy / pbpaste.

pbpaste | pbcopy
0

Ubuntu distros can do this by default with CtrlShiftV.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .