Msys2-packages: request: Modify the Windows clipboard in some way? (xclip/xsel)

Created on 29 Apr 2016  路  3Comments  路  Source: msys2/MSYS2-packages

Would it be possible, in one way or another, to from within msys2 modify the Windows clipboard in the same way xclip and xsel can do?

Most helpful comment

I'm unsure about what xclip nor xsel, but I usually simply do:

$ echo 'Wow, clipboarded!' > /dev/clipboard
$ cat /dev/clipboard
Wow, clipboarded!

# Copy something in Windows uisng Ctrl+C
$ cat /dev/clipboard
# Copied content here

Note: Don't copy the cat /dev/clipboard line, type it directly instead. Otherwise, you will have overwritten clipboard content and you would end up with this:

$ cat /dev/clipboard
 cat /dev/clipboard

Don't make same mistake I made :D

The special /dev/clipboard is like any input/ouput device, so you can pipe it to make some nice stuff like cat /dev/clipboard | jq '.users[0]'.

Maybe it's enough for your use case.

All 3 comments

I'm unsure about what xclip nor xsel, but I usually simply do:

$ echo 'Wow, clipboarded!' > /dev/clipboard
$ cat /dev/clipboard
Wow, clipboarded!

# Copy something in Windows uisng Ctrl+C
$ cat /dev/clipboard
# Copied content here

Note: Don't copy the cat /dev/clipboard line, type it directly instead. Otherwise, you will have overwritten clipboard content and you would end up with this:

$ cat /dev/clipboard
 cat /dev/clipboard

Don't make same mistake I made :D

The special /dev/clipboard is like any input/ouput device, so you can pipe it to make some nice stuff like cat /dev/clipboard | jq '.users[0]'.

Maybe it's enough for your use case.

Oh yeah; I love you! Suddenly my life became that much easier! Cheers man!

Glad I could make someone happy and hope it will help others :D

Regards,
Matt

Was this page helpful?
0 / 5 - 0 ratings

Related issues

borekb picture borekb  路  4Comments

OortJacek picture OortJacek  路  5Comments

hiroakit picture hiroakit  路  5Comments

Arnold1 picture Arnold1  路  8Comments

Dwitee picture Dwitee  路  7Comments