Skip to main content
Flameshot is a powerful screenshot tool for Linux. This guide shows you how to integrate Flameshot with Zipline to automatically upload screenshots to your server.

Prerequisites

  • A running Zipline instance
  • Flameshot installed on your Linux machine
  • curl and jq installed (for processing uploads)
  • A Zipline user account with an API token

Quick Setup

Zipline can generate a ready-to-use upload script for Flameshot:
1

Log in to Zipline

Navigate to your Zipline instance and log in to your account.
2

Generate Upload Script

Go to SettingsGeneratorsFlameshot.Download the generated shell script (zipline-flameshot-file.sh).
3

Make Script Executable

chmod +x zipline-flameshot-file.sh
4

Run the Script

./zipline-flameshot-file.sh
The script automatically captures a screenshot with Flameshot, uploads it to Zipline, and copies the URL to your clipboard.

Manual Configuration

If you prefer to create the upload script manually:

Basic Upload Script

zipline-upload.sh
#!/bin/bash

# Take screenshot and save to temporary file
flameshot gui -r > /tmp/screenshot.png

# Upload to Zipline and copy URL to clipboard
curl -H "authorization: YOUR_API_TOKEN" \
  https://your-zipline-instance.com/api/upload \
  -F file=@/tmp/screenshot.png \
  -H 'content-type: multipart/form-data' \
  | jq -r .files[0].url | tr -d '\n' | xclip -selection clipboard
Replace YOUR_API_TOKEN with your actual API token and https://your-zipline-instance.com with your Zipline server URL.

Getting Your API Token

To get your API token:
  1. Log in to your Zipline dashboard
  2. Navigate to SettingsUserAPI Token
  3. Click Show Token or Regenerate Token

Platform-Specific Configurations

macOS

For macOS users running Flameshot:
#!/bin/bash
/Applications/flameshot.app/Contents/MacOS/flameshot gui -r > /tmp/screenshot.png
curl -H "authorization: YOUR_API_TOKEN" \
  https://your-zipline-instance.com/api/upload \
  -F file=@/tmp/screenshot.png \
  -H 'content-type: multipart/form-data' \
  | jq -r .files[0].url | tr -d '\n' | pbcopy

Wayland Compositors

For Wayland users experiencing compatibility issues:
#!/bin/bash
export XDG_CURRENT_DESKTOP=sway
flameshot gui -r > /tmp/screenshot.png
curl -H "authorization: YOUR_API_TOKEN" \
  https://your-zipline-instance.com/api/upload \
  -F file=@/tmp/screenshot.png \
  -H 'content-type: multipart/form-data' \
  | jq -r .files[0].url | tr -d '\n' | wl-copy
For Wayland, use wl-copy instead of xclip for clipboard functionality.

Advanced Upload Options

You can customize uploads using additional headers:
curl -H "authorization: YOUR_API_TOKEN" \
  -H "x-zipline-deletes-at: 24h" \
  https://your-zipline-instance.com/api/upload \
  -F file=@/tmp/screenshot.png \
  | jq -r .files[0].url | tr -d '\n' | xclip -selection clipboard

Available Options

HeaderDescriptionExample
x-zipline-deletes-atSet expiration time24h, 7d, never
x-zipline-formatFilename formatrandom, uuid, date
x-zipline-image-compression-percentCompression quality (0-100)80
x-zipline-max-viewsMax views before deletion10
x-zipline-original-namePreserve original filenametrue
x-zipline-no-jsonReturn plain text URLtrue

Setting Up Keyboard Shortcuts

GNOME/KDE

1

Open Keyboard Settings

Navigate to SettingsKeyboardCustom Shortcuts.
2

Create New Shortcut

  • Name: Zipline Screenshot Upload
  • Command: /path/to/zipline-upload.sh
  • Shortcut: Choose your preferred key combination (e.g., Ctrl+Shift+U)

i3/Sway

Add to your config file:
~/.config/i3/config
bindsym $mod+Shift+u exec /path/to/zipline-upload.sh
For Sway:
~/.config/sway/config
bindsym $mod+Shift+u exec /path/to/zipline-upload.sh

URL Shortening Script

You can also create a script for URL shortening:
zipline-shorten.sh
#!/bin/bash

if [ -z "$1" ]; then
  echo "Usage: $0 <url>"
  exit 1
fi

curl -H "authorization: YOUR_API_TOKEN" \
  -H "content-type: application/json" \
  https://your-zipline-instance.com/api/user/urls \
  -d "{\"destination\": \"$1\"}" \
  | jq -r .url | tr -d '\n' | xclip -selection clipboard

echo "Shortened URL copied to clipboard!"
Usage:
chmod +x zipline-shorten.sh
./zipline-shorten.sh https://example.com/very/long/url

Troubleshooting

Screenshot not uploading

Check dependencies:
which flameshot curl jq xclip
Install missing dependencies:
# Debian/Ubuntu
sudo apt install flameshot curl jq xclip

# Fedora
sudo dnf install flameshot curl jq xclip

# Arch
sudo pacman -S flameshot curl jq xclip

Clipboard not working on Wayland

Replace xclip -selection clipboard with wl-copy:
sudo apt install wl-clipboard  # Debian/Ubuntu

Permission denied errors

Ensure the script is executable:
chmod +x /path/to/zipline-upload.sh

jq: command not found

If you prefer not to install jq, use the plain text response option:
curl -H "authorization: YOUR_API_TOKEN" \
  -H "x-zipline-no-json: true" \
  https://your-zipline-instance.com/api/upload \
  -F file=@/tmp/screenshot.png

Next Steps

Upload API

Learn about the upload API endpoint

ShareX Integration

Set up ShareX on Windows

Build docs developers (and LLMs) love