~ruther/nixos-config

ref: 509b41049b045885bde71c8eb68e4d665f7c00e8 nixos-config/modules/services/flameshot.nix -rw-r--r-- 943 bytes
509b4104 — Frantisek Bohacek chore: remove unnecessary code, use modules instead of imports, split files 1 year, 3 days ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#
# Screenshots
#

{ config, lib, ... }:

let
  screensDir = "${config.home.homeDirectory}/screens";
in {

  systemd.user.services.flameshot = lib.mkIf config.services.flameshot.enable {
    Unit = {
      PartOf = lib.mkForce [ "qtile-services.target" ];
    };
    Install = {
      WantedBy = lib.mkForce [ "qtile-services.target" ];
    };
  };

  services = {                                    # sxhkd shortcut = Printscreen button (Print)
    flameshot = {
      enable = true;
      settings = {
        General = {                               # Settings
          savePath = screensDir;
          saveAsFileExtension = ".png";
          uiColor = "#2d0096";
          showHelp = "false";
          disabledTrayIcon = "true";              # Hide from systray
        };
      };
    };
  };

  home.activation = {
    ensureScreensDirCreated = lib.hm.dag.entryAfter [ "writeBoundary" ] ''
      mkdir -p ${screensDir}
    '';
  };
}
Do not follow this link