Flameshot CLI Guide: Capture, Edit, and Upload Screenshots Rapidly

6月20日 Published inSystem Utilities

Flameshot is an open-source screenshot utility that offers a robust set of editing features. It is efficient, highly customizable, and designed to stay out of the user's way. You can annotate images in real-time, upload them directly to Imgur, or automate captures through DBus scripting.

If you run flameshot without any arguments, the application initializes in the background. On desktops with a system tray, the Flameshot icon will appear there for quick access.

Command Examples

Open the GUI to select a specific area: flameshot gui

Capture an area and save it directly to a designated folder: flameshot gui -p ~/myStuff/captures

Introduce a two-second delay before the UI appears—useful for capturing tooltips or hover states: flameshot gui -d 2000

Capture the entire screen without the GUI after a five-second delay and save to disk: flameshot full -p ~/myStuff/captures -d 5000

Capture the full screen, save it, and copy it to the clipboard simultaneously: flameshot full -c -p ~/myStuff/captures

Capture the active monitor, include the cursor, and output the result as raw PNG bytes: flameshot screen -r

Capture the contents of monitor 1 and copy the image to the clipboard: flameshot screen -n 1 -c

CLI Configuration

Flameshot can be adjusted through its graphical settings menu or configured directly via the terminal.

Open the configuration panel: flameshot config

Enable the initial help message in capture mode: flameshot config --showhelp true

View all available configuration flags: flameshot config -h

Config File Locations

You can manually edit the .ini file to override defaults or customize the interface colors.

  • Linux: ~/.config/flameshot/flameshot.ini
  • Windows: C:\Users\{YOURNAME}\AppData\Roaming\flameshot\flameshot.ini

If you migrate your config file between Linux and Windows, ensure you update the savePath line. Incorrect paths will prevent Flameshot from successfully saving files.

Keyboard Shortcuts (GUI Mode)

Key Action
P Pencil tool
D Line tool
A Arrow tool
S Selection tool
R Rectangle tool
C Circle tool
M Marker tool
T Text tool
B Pixelate tool
←, ↓, ↑, → Move selection by 1px
Shift + Arrow Resize selection by 1px
Ctrl + Shift + Arrow Symmetrical resize by 2px
Esc Cancel capture
Ctrl + M Move selection
Ctrl + C Copy to clipboard
Ctrl + S Save selection
Ctrl + Z Undo
Ctrl + Shift + Z Redo
Ctrl + Q Quit capture
Ctrl + O Open with an external application
Ctrl + Return Finalize text entry
Ctrl + Backspace Clear current selection
Return Upload to Imgur
Spacebar Toggle side panel, color picker, and history
Right-click Show color wheel
Mouse wheel Adjust tool thickness
Print Screen Capture screen
Shift + Print Open screenshot history
Ctrl + draw line/arrow Constrain to horizontal, vertical, or diagonal
Ctrl + draw rect/circle Lock aspect ratio

Global Hotkeys (Linux)

By default, the global shortcut is Print Screen on Windows and Cmd-Shift-X on macOS.

KDE Plasma A pre-configured file is available in the repository to set up recommended shortcuts.

Key Action
Prt Sc Launch Flameshot GUI
Ctrl + Prt Sc 3-second delay, then launch GUI
Shift + Prt Sc Capture and save full screen (all monitors)
Ctrl + Shift + Prt Sc Capture full screen to clipboard

Setup Steps:

  1. Create a screenshots folder: mkdir -p ~/Pictures/Screenshots
  2. Download the configuration: cd ~/Desktop && wget https://raw.githubusercontent.com/flameshot-org/flameshot/master/docs/shortcuts-config/flameshot-shortcuts-kde.khotkeys
  3. Ensure khotkeys is installed.
  4. Navigate to System Settings > Shortcuts > Custom Shortcuts.
  5. Disable any existing Spectacle entries.
  6. Import the downloaded file and apply the changes.

Ubuntu (22.04)

  1. Remove the default binding: Settings > Keyboard > View and Customize Shortcuts > Screenshots > Interactive Screenshot. Press Backspace to clear it.
  2. Add a custom shortcut by clicking the "+" button. Name it "Flameshot" and enter the command: /usr/bin/flameshot gui.
  3. Assign Prt Sc as the activation key.

XFCE 4

  1. Open Keyboard settings.
  2. Navigate to the Application Shortcuts tab.
  3. Locate xfce4-screenshooter -fd 1 and replace it with flameshot gui.

Fluxbox

  1. Edit the file: ~/.fluxbox/keys.
  2. Append the following line: Print :Exec flameshot gui
  3. Reconfigure Fluxbox via the menu.

Installation

Linux Repositories

  • Arch: pacman -S flameshot (Development builds available via AUR: flameshot-git)
  • Debian 10+: apt install flameshot
  • Ubuntu 18.04+: apt install flameshot
  • openSUSE: zypper install flameshot
  • Void: xbps-install flameshot
  • Solus: eopkg it flameshot
  • Fedora: dnf install flameshot
  • NixOS: nix-env -iA nixos.flameshot

macOS

  • MacPorts: sudo port selfupdate && sudo port install flameshot
  • Homebrew: brew install --cask flameshot

Note: The first launch might trigger a macOS security warning. To bypass this, right-click the application in Finder, select "Open," and confirm the dialog.

Windows

  • Chocolatey: choco install flameshot

Building from Source

Prerequisites

  • Build Tools: Qt >= 5.9, GCC >= 7.4, CMake >= 3.29
  • Runtime: Qt and SVG libraries
  • Optional: Git, OpenSSL, and CA certificates

Compilation (Optional) Define the build directory and installation prefix:

export BUILD_DIR=build
export CMAKE_INSTALL_PREFIX=/opt/flameshot

Initiate the build process:

# Linux
cmake -S . -B "$BUILD_DIR" && cmake --build "$BUILD_DIR"

# macOS
cmake -S . -B "$BUILD_DIR" -DQt5_DIR="$(brew --prefix qt5)/lib/cmake/Qt5" && cmake --build "$BUILD_DIR"

Once compiled, you can launch Flameshot from the project_folder/build/src directory.

Installation

cmake --install "$BUILD_DIR"           # Using a custom prefix (CMake >= 3.29)
sudo cmake --install "$BUILD_DIR"      # System default installation

Windows binaries are signed by SignPath.io using a certificate from the SignPath Foundation. Because the signing process is manual, some patch releases may not be immediately signed.