mirror of
https://github.com/arcan1s/arcanis.me.git
synced 2025-04-24 15:27:17 +00:00
1.2 KiB
1.2 KiB
category | type | hastr | layout | tags | title | short |
---|---|---|---|---|---|---|
en | paper | true | paper | linux, s3 | How to upload screenshots to S3 from linux | upload-screenshots-to-s3 |
For some reasons I'm forced to upload screenshots to S3 instead of public resourses. This paper describes simple solution which allows to upload screenshots and get link to it directly from screenshot tool.
Requirements
- Screenshot tool which allows to use custom applications to open image (I use Spectacle).
- Installed and configured s3cmd.
- Installed xsel to copy URL to clipboard.
- Text editor.
Desktop file
Create desktop file in $HOME/.local/share/applications/s3cmd.desktop
with the
following content
[Desktop Entry]
Name=s3cmd
Exec=s3cmd put --acl-public %U "s3://bucket-name/path/to/screenshots/`uuidgen`.png" | grep "Public URL" | cut -d ':' -f 2- | xsel -bi
Icon=image
Type=Application
Terminal=true
Categories=Graphics;
MimeType=image/png;
The magic is in Exec=
parameter. It uses path to temporary created file (%U
),
uploads image to S3 by using s3cmd
and gets URL from it with some bash magic.
Usage
Just do screenshot and open it with s3cmd
.