Jump to content

Flameshot: Difference between revisions

From Official NixOS Wiki
Wo2wz (talk | contribs)
Add solution to fractional scaling bug on Wayland
Tags: Mobile edit Mobile web edit Visual edit
Phobos (talk | contribs)
m minor fix
 
(4 intermediate revisions by the same user 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://github.com/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}}


== Troubleshooting ==
== 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;


=== Flameshot only captures a portion of the screen ===


On Wayland, Flameshot might capture only the top left of the screen when fractional scaling is used. This can be solved by running it with the environment variable <code>QT_QPA_PLATFORM=xcb</code>. This will run it under X11, so Xwayland will need to be set up in your compositor. Keyboard input may not work correctly.
      # 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}}
[[Category:Applications]]
[[Category:Applications]]

Latest revision as of 00:22, 1 January 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;


      # 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";
    };
  };
};