Skip to content

termux-clipboard is not so easy to install (in order to support copy paste via pbcopy, pbpaste commands) #899

@robertvandeneynde

Description

@robertvandeneynde

On macOS X, the pbcopy and pbpaste command can be used to manipulate the clipboard.

On Desktop linux that's the xclip -selection command, so I made alias pbcopy='xclip -selection clipboard' and alias pbpaste='xclip -selection clipboard -o' for the command to be portable with macOS X.

That's very useful for a lot of text replacement applications :

pbpaste > file.txt     # into a file
pbcopy file.txt        # from a file
cat file.txt | pbcopy  # from a file, using a pipe
pbpaste | sed 's/ /-/g' | pbcopy  # direct replacement of clipboard
pbpaste | python 'import sys
sys.stdout.write(sys.stdin.read().replace(" ", "-"))
' | pbcopy  # use python for more complicated Operations !
pbpaste | python replace_stuff.py | pbcopy  # why not from a python file ?

I have no clue how clipboard work in android but I think that's manageable !

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions