Skip to content

Instantly share code, notes, and snippets.

@THOUSAND-SKY
Created February 13, 2024 20:11
Show Gist options
  • Save THOUSAND-SKY/6435375f6bd15db456e30b88374ee98e to your computer and use it in GitHub Desktop.
Save THOUSAND-SKY/6435375f6bd15db456e30b88374ee98e to your computer and use it in GitHub Desktop.
Copy a file from CLI on X11, and paste it into other GUI apps
#!/bin/bash
# Usage: ezdrop myfile.png
# ^ ctrl+v into browser (discord/slack/whatever)
f="$(realpath "$@")"
echo -n "file://$f" | xclip -se c -t 'text/uri-list'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment