Jump to content

Flameshot: Difference between revisions

From Official NixOS Wiki
Serif (talk | contribs)
Created page and added instructions for building on Wayland.
 
m Multi-monitor screenshot prompt: spacing between equals sign.
 
(10 intermediate revisions by 5 users not shown)
Line 1: Line 1:
[https://flameshot.org/ Flameshot] is a powerful screenshot and screenshot annotation tool. It allows the user to take and then draw, write text, blur, crop, and otherwise edit screenshots easily.
[https://flameshot.org/ Flameshot] is a powerful screenshot and screenshot annotation tool. Flameshot allows the user to take a screenshot and then draw, write text, blur, crop, and otherwise edit screenshots with ease.


== Wayland ==
== Install ==
For X11 you can install Flameshot by simply adding it to your configuration file.
{{File|3=environment.systemPackages = with pkgs; [
  flameshot
];|name=/etc/nixos/configuration.nix|lang=nix}}


=== Install on Wayland ===
In order to use Flameshot on Wayland you will need to install [https://gitlab.freedesktop.org/emersion/grim Grim] and configure Flameshot to use it.


To install flameshot on Wayland, add the following to your package list:<syntaxhighlight lang="nix">
==== Install Grim ====
(flameshot.override { enableWlrSupport = true; })
{{File|3=environment.systemPackages = with pkgs; [
  grim
];|name=/etc/nixos/configuration.nix|lang=nix}}


</syntaxhighlight>
==== Configure Flameshot ====
You may do this through Home Manager, or you may configure it manually in ~/.config/flameshot.
{{File|3=services.flameshot = {
  # Also installs/enables flameshot
  enable = true;
  settings = {
    General = {
      useGrimAdapter = true;
      # Stops warnings for using Grim
      disabledGrimWarning = true;
    };
  };
};|name=/etc/nixos/home.nix|lang=nix}}
 
== Home Manager ==
You can configure Flameshot settings through Home Manager with the following syntax. Additional settings may be found on the [https://github.com/flameshot-org/flameshot/blob/master/flameshot.example.ini Flameshot] Github and adapted into Nix. See documented settings in the [https://nix-community.github.io/home-manager/options.xhtml#opt-services.flameshot.enable Home Manager Appendix - services.flameshot].
{{File|3=services.flameshot = {
  enable = true;
  settings = {
    General = {
       
      # More settings may be found on the Flameshot Github
 
      # Save Path
      savePath = "/home/user/Screenshots";
      # Tray
      disabledTrayIcon = true;
      # Greeting message 
      showStartupLaunchMessage = false;
      # Default file extension for screenshots (.png by default)
      saveAsFileExtension = ".png";
      # Desktop notifications
      showDesktopNotification = true;
      # Notification for cancelled screenshot
      showAbortNotification = false;
      # Whether to show the info panel in the center in GUI mode
      showHelp = true;
      # Whether to show the left side button in GUI mode
      showSidePanelButton = true;
      # Whether to enable legacy (pre-xdg-desktop-portal) screenshotting on X11
      useX11LegacyScreenshot = true;
      # Whether to skip display selection prompt (X11-only)
      captureActiveMonitor = true;
 
 
      # Color Customization
      uiColor = "#740096";
      contrastUiColor = "#270032";
      drawColor = "#ff0000";
 
      # For Wayland (Install Grim seperately)
      useGrimAdapter = true;
      # Stops warnings for using Grim
      disabledGrimWarning = true;
    };
  };
};|name=/etc/nixos/home.nix|lang=nix}}
 
== Setting Shortcuts ==
Setting shortcuts is different depending on your Desktop Environment. You can can check Flameshot CLI commands that you can use for shortcuts by running <code>man flameshot</code>.
 
=== Sway ===
{{File|3=wayland.windowManager.sway = {
  enable = true;
  # Sets modifier to Super Key
  modifier = "Mod4";
  config = {
    keybindings = lib.mkOptionDefault {
    # Manual screenshot GUI that saves to clipboard and closes on selection.
    "${modifier}+Shift+s" = "exec flameshot gui --clipboard --accept-on-select";
    # Takes a screenshot of the screen containing the cursor.
    "${modifier}+Shift+a" = "exec flameshot screen --clipboard";
    # Takes a manual screenshot that shows options after selection.
    "Print" = "exec flameshot gui";
    };
  };
};|name=/etc/nixos/home.nix|lang=nix}}
 
== Troubleshooting ==
With the release of v14.0.0 of Flameshot, users may experience several issues depending on their setup. This section will cover most common situations and their solutions.
 
=== Unable to take a screenshot: portal timed out/screenshot aborted ===
By default, Flameshot now uses XDG desktop portal calls for screenshotting. This necessitates having <code>xdg-desktop-portal</code> + portal(s) with Access and Screenshot interfaces installed (see ArchWiki's [https://wiki.archlinux.org/title/XDG_Desktop_Portal#List_of_backends_and_interfaces Portal Backends] list). Without those, screenshot attempts will fail.
 
Users on X11 window managers will be unable to use the default method; no portal provides a Screenshot interface there. The solution is to enable "Use legacy X11 screenshot" method located in the "General" tab of Flameshot GUI config. If using Home Manager's Flameshot module, this option can be enabled by adding <code>useX11LegacyScreenshot = true</code> to the settings configuration. 
 
=== Multi-monitor screenshot prompt ===
When taking screenshots, Flameshot will now open a prompt on multi-monitor setups to choose a display to capture. This is contrast with the pre-v14 behaviour, where capturing was rendered across all screens. Users on X11 may disable this behaviour by enabling "Capture active monitor (skip monitor selection)" in the "General" tab Flameshot GUI config. If using Home Manager's Flameshot module, this option can be enabled by adding <code>captureActiveMonitor = true</code> to the settings configuration.
 
Wayland users are unable to disable this due to its security design and lack of cross-platform solutions. To circumvent this behaviour, it is recommended to change keybind from default <code>flameshot gui</code> to, for example <code>flameshot screen --edit</code>. This will capture the currently active display (wherever the cursor is) and open the GUI editor. This will occasionally incorrectly select a display, however.
 
=== Incorrect capture overlay render ===
Some users, most commonly on X11 window managers, may experience regressions in how screen capture is rendered, more so on multi-monitor setups. Instead of opening as an overlay, it might open as a separate window. The cause is currently unknown and solutions may vary depending on how window management is implemented by each manager.
 
[[Category:Applications]]

Latest revision as of 07:48, 26 June 2026

Flameshot is a powerful screenshot and screenshot annotation tool. Flameshot allows the user to take a screenshot and then draw, write text, blur, crop, and otherwise edit screenshots with ease.

Install

For X11 you can install Flameshot by simply adding it to your configuration file.

❄︎ /etc/nixos/configuration.nix
environment.systemPackages = with pkgs; [
  flameshot
];

Install on Wayland

In order to use Flameshot on Wayland you will need to install Grim and configure Flameshot to use it.

Install Grim

❄︎ /etc/nixos/configuration.nix
environment.systemPackages = with pkgs; [
  grim
];

Configure Flameshot

You may do this through Home Manager, or you may configure it manually in ~/.config/flameshot.

❄︎ /etc/nixos/home.nix
services.flameshot = {
  # Also installs/enables flameshot
  enable = true;
  settings = {
    General = {
      useGrimAdapter = true;
      # Stops warnings for using Grim
      disabledGrimWarning = true;
    };
  };
};

Home Manager

You can configure Flameshot settings through Home Manager with the following syntax. Additional settings may be found on the Flameshot Github and adapted into Nix. See documented settings in the Home Manager Appendix - services.flameshot.

❄︎ /etc/nixos/home.nix
services.flameshot = {
  enable = true;
  settings = {
    General = {
        
      # More settings may be found on the Flameshot Github

      # Save Path
      savePath = "/home/user/Screenshots";
      # Tray
      disabledTrayIcon = true;
      # Greeting message   
      showStartupLaunchMessage = false;
      # Default file extension for screenshots (.png by default)
      saveAsFileExtension = ".png";
      # Desktop notifications
      showDesktopNotification = true;
      # Notification for cancelled screenshot
      showAbortNotification = false;
      # Whether to show the info panel in the center in GUI mode
      showHelp = true;
      # Whether to show the left side button in GUI mode
      showSidePanelButton = true;
      # Whether to enable legacy (pre-xdg-desktop-portal) screenshotting on X11
      useX11LegacyScreenshot = true;
      # Whether to skip display selection prompt (X11-only)
      captureActiveMonitor = true;


      # Color Customization
      uiColor = "#740096";
      contrastUiColor = "#270032";
      drawColor = "#ff0000";

      # For Wayland (Install Grim seperately)
      useGrimAdapter = true;
      # Stops warnings for using Grim
      disabledGrimWarning = true;
    };
  };
};

Setting Shortcuts

Setting shortcuts is different depending on your Desktop Environment. You can can check Flameshot CLI commands that you can use for shortcuts by running man flameshot.

Sway

❄︎ /etc/nixos/home.nix
wayland.windowManager.sway = {
  enable = true;
  # Sets modifier to Super Key
  modifier = "Mod4";
  config = {
    keybindings = lib.mkOptionDefault {
    # Manual screenshot GUI that saves to clipboard and closes on selection.
    "${modifier}+Shift+s" = "exec flameshot gui --clipboard --accept-on-select";
    # Takes a screenshot of the screen containing the cursor.
    "${modifier}+Shift+a" = "exec flameshot screen --clipboard";
    # Takes a manual screenshot that shows options after selection.
    "Print" = "exec flameshot gui";
    };
  };
};

Troubleshooting

With the release of v14.0.0 of Flameshot, users may experience several issues depending on their setup. This section will cover most common situations and their solutions.

Unable to take a screenshot: portal timed out/screenshot aborted

By default, Flameshot now uses XDG desktop portal calls for screenshotting. This necessitates having xdg-desktop-portal + portal(s) with Access and Screenshot interfaces installed (see ArchWiki's Portal Backends list). Without those, screenshot attempts will fail.

Users on X11 window managers will be unable to use the default method; no portal provides a Screenshot interface there. The solution is to enable "Use legacy X11 screenshot" method located in the "General" tab of Flameshot GUI config. If using Home Manager's Flameshot module, this option can be enabled by adding useX11LegacyScreenshot = true to the settings configuration.

Multi-monitor screenshot prompt

When taking screenshots, Flameshot will now open a prompt on multi-monitor setups to choose a display to capture. This is contrast with the pre-v14 behaviour, where capturing was rendered across all screens. Users on X11 may disable this behaviour by enabling "Capture active monitor (skip monitor selection)" in the "General" tab Flameshot GUI config. If using Home Manager's Flameshot module, this option can be enabled by adding captureActiveMonitor = true to the settings configuration.

Wayland users are unable to disable this due to its security design and lack of cross-platform solutions. To circumvent this behaviour, it is recommended to change keybind from default flameshot gui to, for example flameshot screen --edit. This will capture the currently active display (wherever the cursor is) and open the GUI editor. This will occasionally incorrectly select a display, however.

Incorrect capture overlay render

Some users, most commonly on X11 window managers, may experience regressions in how screen capture is rendered, more so on multi-monitor setups. Instead of opening as an overlay, it might open as a separate window. The cause is currently unknown and solutions may vary depending on how window management is implemented by each manager.