2 ms·
Iterating on this idea just a little bit, you realize you want to apply any shell filter to your clipboard ... #!/bin/sh # save as xfilt xsel -ob |
by jepler 10y ago
Iterating on this idea just a little bit, you realize you want to apply any shell filter to your clipboard ...
#!/bin/sh
# save as xfilt
xsel -ob | "$@" | xsel -ib
so, for instance, get a bit of json in your clipboard http://json.org/example.html http://json.org/example.html and run xfilt jq .glossary.title. Now your clipboard contains "example glossary" instead of the whole json file.
One wrinkle is, if you get your filter wrong, you have to return to the original source to copy again, because the operation is destructive each time...