# Flameshot setup: capture and upload

How to set up Flameshot with hematite on Linux or macOS: download the script, put it on a key, and every capture goes up with its link on your clipboard.

[Flameshot](https://flameshot.org) is a free screenshot tool for Linux and macOS (and Windows, where [ShareX](https://hematite.gg/docs/uploaders/sharex) is the better fit). It has no upload of its own for hematite, so [hematite's upload script](https://hematite.gg/docs/uploaders/upload-script) does it: on a key of your choice, it opens Flameshot's capture, uploads what you select, and copies the link.

## Set it up

1. **Download the script.** In hematite, open [Settings → Uploaders](https://hematite.gg/settings/uploaders) and press **Download script** beside Flameshot. You get `hematite-upload.sh`.
2. **Put it in place,** where only you can read it:

   ```sh
   mkdir -p ~/.local/bin
   mv ~/Downloads/hematite-upload.sh ~/.local/bin/
   chmod 700 ~/.local/bin/hematite-upload.sh
   ```

3. **Put it on a key.** In your desktop's keyboard settings, add a custom shortcut that runs the script by its full path, such as `sh /home/nova/.local/bin/hematite-upload.sh`. On a Mac, a shortcut in the Shortcuts app with a **Run Shell Script** action does the same.
4. **Press the key.** Flameshot opens: select an area and press ↵. The capture goes up, and a notice says the link is on your clipboard.

Press Esc to cancel: nothing is uploaded and nothing is said. To try it in a terminal first, run `sh ~/.local/bin/hematite-upload.sh`: it prints the link, or why it failed.

> **Warning: The script holds a token: keep it to yourself**
>
> Each download carries a new upload token, which is shown nowhere else. If the
> script gets out, remove the token and download a new one.

## What it needs

- **Flameshot,** on your `PATH`, or at `/Applications/flameshot.app` on a Mac. The script runs `flameshot gui --raw`, which hands it the capture as a PNG.
- **`curl`,** and to copy the link: `wl-copy` on Wayland, or `xclip` or `xsel` on X11. Without one, the link is in the notice and nothing is copied.
- **`notify-send`** for the notice on Linux; macOS has its own.

## Your upload tokens

The script's token lasts 90 days and counts toward your ten. It's listed as **Flameshot** on [Settings → Uploaders](https://hematite.gg/settings/uploaders) and in [Settings → Security](https://hematite.gg/settings/security). Remove it in either place and the script stops uploading; your other uploaders carry on. [The upload script's guide](https://hematite.gg/docs/uploaders/upload-script#when-it-fails) lists what it says when an upload fails.
