I'm aware of how to copy the contents of file:
xsel -b < myfile.txt
But this is not what I want.
I would like something like this:
./file2clip.sh myfile.txt
Which would copy myfile.txt to the clipboard so then I could ctrl + v (paste) or right click and paste the file anywhere (on the desktop, in the file explorer, etc.).
How can I copy a file/files to the clipboard so that I can paste it with ctrl + v anywhere in the gui?
Windows equivalent: (powershell)
Set-Clipboard -Path myfile.txt
Macos equivalent: (applescript)
#!/usr/bin/osascript
on run args
set the clipboard to POSIX file (first item of args)
end
./file2clip.applescript myfile.txt