<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[How to use Flameshot with XBackBone on GNU+Linux (fully automatic, no extra clicks)]]></title><description><![CDATA[<p dir="auto">If you've migrated from Windows and miss ShareX's one-key capture-and-upload workflow, this guide<br />
gets you there on Linux using <a href="https://flameshot.org" target="_blank" rel="noopener noreferrer nofollow ugc">Flameshot</a> and your self-hosted<br />
<a href="https://github.com/sergix44/XBackBone" target="_blank" rel="noopener noreferrer nofollow ugc">XBackBone</a> instance.</p>
<p dir="auto">The end result: press a key → Flameshot GUI opens → annotate → confirm → image uploads<br />
automatically → URL is in your clipboard → desktop notification appears. No extra clicks.</p>
<hr />
<h2>Why this isn't obvious</h2>
<p dir="auto">Flameshot v13+ deliberately removed its built-in Imgur uploader. The project's stance is that<br />
uploaders don't belong in core — they want a plugin system instead (still in progress). So there's<br />
no settings toggle for "upload to XBackBone".</p>
<p dir="auto">The approach below uses <code>flameshot gui -r</code> which pipes the captured PNG to a shell script,<br />
keeping the full Flameshot GUI (annotation tools, preview, cancel) intact.</p>
<hr />
<h2>Prerequisites</h2>
<p dir="auto">You'll need these installed:</p>
<ul>
<li><code>flameshot</code> — <strong>native package only, not Flatpak</strong> (Flatpak sandboxing prevents running external scripts)</li>
<li><code>curl</code> — HTTP upload</li>
<li><code>jq</code> — JSON parsing</li>
<li><code>wl-copy</code> — Wayland clipboard (package: <code>wl-clipboard</code>). X11 users: use <code>xclip</code> instead</li>
<li><code>notify-send</code> — desktop notifications (usually pre-installed)</li>
<li><code>xbindkeys</code> — key binding daemon (see Step 4)</li>
</ul>
<pre><code class="language-bash"># Fedora / Bazzite
sudo dnf install flameshot curl jq wl-clipboard xbindkeys

# Ubuntu / Debian
sudo apt install flameshot curl jq wl-clipboard xbindkeys
</code></pre>
<hr />
<h2>Step 1 — Get your XBackBone token</h2>
<p dir="auto">Log into your XBackBone instance → click your username → <strong>Profile</strong> → scroll to<br />
<strong>Linux Script</strong> → note the upload URL and token value.</p>
<hr />
<h2>Step 2 — Create the upload script</h2>
<pre><code class="language-bash">mkdir -p ~/.local/bin
nano ~/.local/bin/flameshot-xbackbone.sh
</code></pre>
<pre><code class="language-bash">#!/usr/bin/env bash
XBACKBONE_URL="https://xb.yourdomain.com/upload"
XBACKBONE_TOKEN="token_your_token_here"
LOGFILE="$HOME/.local/share/flameshot-xbackbone/upload.log"
mkdir -p "$(dirname "$LOGFILE")"

for cmd in flameshot curl jq wl-copy notify-send; do
    if ! command -v "$cmd" &amp;&gt;/dev/null; then
        notify-send "flameshot-xbackbone" "Missing: $cmd" -i dialog-error
        exit 1
    fi
done

TMPFILE=$(mktemp /tmp/flameshot-XXXXXX.png)
trap 'rm -f "$TMPFILE"' EXIT

flameshot gui -r &gt; "$TMPFILE" 2&gt;/dev/null

if [[ ! -s "$TMPFILE" ]]; then
    exit 0  # user cancelled — silent exit
fi

# Note: field name is "upload" not "file", token sent first (see troubleshooting)
RESPONSE=$(curl -s \
    -F "token=$XBACKBONE_TOKEN" \
    -F "upload=@$TMPFILE" \
    "$XBACKBONE_URL")

URL=$(echo "$RESPONSE" | jq -r '.url // empty' 2&gt;/dev/null)

if [[ -n "$URL" ]]; then
    printf '%s' "$URL" | wl-copy
    notify-send "Screenshot uploaded" "$URL" -i flameshot -t 6000
    echo "$(date '+%F %T') OK: $URL" &gt;&gt; "$LOGFILE"
else
    ERROR=$(echo "$RESPONSE" | jq -r '.message // "Unknown error"' 2&gt;/dev/null)
    notify-send "Upload failed" "$ERROR" -i dialog-error -t 10000
    echo "$(date '+%F %T') FAIL: $RESPONSE" &gt;&gt; "$LOGFILE"
    exit 1
fi
</code></pre>
<pre><code class="language-bash">chmod +x ~/.local/bin/flameshot-xbackbone.sh
# Test it manually first
~/.local/bin/flameshot-xbackbone.sh
</code></pre>
<hr />
<h2>Step 3 — First run: Wayland permission prompt</h2>
<p dir="auto">On the first capture, KDE/GNOME may show: <strong>"Allow [app] to take a screenshot?"</strong> — click Allow.<br />
This is a one-time Wayland portal prompt. It won't appear again.</p>
<hr />
<h2>Step 4 — Keyboard shortcut via xbindkeys</h2>
<blockquote>
<p dir="auto"><strong>Why not KDE Custom Shortcuts?</strong></p>
<p dir="auto">KDE Plasma 6 removed <code>khotkeys</code>, the daemon that powered custom shortcuts. The UI still exists<br />
but the daemon does not ship on Fedora-based systems. KDE's alternative service shortcut<br />
mechanism (<code>kglobalacceld</code>) works for system services but is unreliable for user scripts.<br />
On Wayland, Plasma's compositor also intercepts PrtSc and common modifier combinations<br />
(Ctrl+PrtSc, Meta+PrtSc) before the shortcut system sees them.</p>
<p dir="auto"><code>xbindkeys</code> is a standalone daemon that bypasses KDE's shortcut infrastructure entirely.<br />
It just works.</p>
</blockquote>
<pre><code class="language-bash"># Create the xbindkeys config
cat &gt; ~/.xbindkeysrc &lt;&lt; 'EOF'
"/home/YOUR_USERNAME/.local/bin/flameshot-xbackbone.sh"
  control + Pause
EOF

# Start it now (no reboot needed)
xbindkeys

# Verify
pgrep xbindkeys
</code></pre>
<p dir="auto"><strong>Recommended key: <code>Ctrl+Pause</code></strong> — nothing in KDE, Steam, Spectacle, or NVIDIA intercepts<br />
the Pause key. PrtSc variants will be grabbed by Plasma's compositor on Wayland.<br />
If you prefer a different key, use <code>xbindkeys --key</code> to get the key name interactively.</p>
<h3>Autostart xbindkeys on login</h3>
<pre><code class="language-bash">cat &gt; ~/.config/autostart/xbindkeys.desktop &lt;&lt; 'EOF'
[Desktop Entry]
Name=xbindkeys
Exec=xbindkeys
Type=Application
Terminal=false
StartupNotify=false
X-KDE-AutostartPhase=1
EOF
</code></pre>
<hr />
<h2>Troubleshooting</h2>
<p dir="auto"><strong>"Token not specified" error on large screenshots</strong></p>
<p dir="auto">This is a PHP behaviour: when a file exceeds <code>post_max_size</code>, PHP silently drops all POST fields<br />
including the token, returning a misleading error. Fix on your server:</p>
<ul>
<li><code>php.ini</code>: <code>post_max_size = 256M</code> and <code>upload_max_filesize = 256M</code></li>
<li><code>nginx.conf</code>: <code>client_max_body_size 256M</code></li>
</ul>
<p dir="auto">Both must be set — nginx rejects before PHP sees the request if its own limit is hit.</p>
<p dir="auto"><strong>Clipboard is empty after upload</strong></p>
<p dir="auto">You're on Wayland but using <code>xclip</code> instead of <code>wl-copy</code>. Install <code>wl-clipboard</code>:</p>
<pre><code class="language-bash">sudo dnf install wl-clipboard   # Fedora/Bazzite
sudo apt install wl-clipboard   # Ubuntu/Debian
</code></pre>
<p dir="auto"><strong>Flameshot doesn't open when shortcut is pressed</strong></p>
<p dir="auto">Test the script directly from a terminal first. If that works, check xbindkeys is running:</p>
<pre><code class="language-bash">pgrep xbindkeys || xbindkeys
</code></pre>
<p dir="auto"><strong>Logs</strong></p>
<pre><code class="language-bash">cat ~/.local/share/flameshot-xbackbone/upload.log
</code></pre>
<hr />
<p dir="auto"><em>Tested on Bazzite (Fedora-based, KDE Plasma 6, Wayland and X11) with Flameshot 13.3.0<br />
and XBackBone 3.8.1.</em></p>
<p dir="auto"><em>Full write-up including a tour of every failed KDE shortcut approach:<br />
<a href="https://wanderingmonster.dev/blog/flameshot-xbackbone-linux" target="_blank" rel="noopener noreferrer nofollow ugc">wanderingmonster.dev/blog/flameshot-xbackbone-linux</a></em></p>
<p dir="auto"><em>Reference implementation and upstream RFC:<br />
<a href="https://forgejo.wanderingmonster.dev/WanderingMonster/flameshot-post-capture-command" target="_blank" rel="noopener noreferrer nofollow ugc">forgejo.wanderingmonster.dev/WanderingMonster/flameshot-post-capture-command</a></em></p>
]]></description><link>https://forum.cloudron.io/topic/15352/how-to-use-flameshot-with-xbackbone-on-gnu-linux-fully-automatic-no-extra-clicks</link><generator>RSS for Node</generator><lastBuildDate>Mon, 06 Apr 2026 19:15:50 GMT</lastBuildDate><atom:link href="https://forum.cloudron.io/topic/15352.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 06 Apr 2026 14:25:56 GMT</pubDate><ttl>60</ttl></channel></rss>