{ config, pkgs, lib, ... }:
let
  cfg = config.snowhawk.satty;
in
{
  options.snowhawk.satty = {
    enable = lib.mkEnableOption "satty module";
  };

  config = lib.mkIf cfg.enable {
    home.packages = with pkgs; [
      grim
      jq
      satty
      slurp
      wl-clipboard
      astal.river
    ];

    xdg.configFile = {
      "satty/config.toml".source = pkgs.writers.writeTOML "satty-config.toml" {
        general = {
          action-on-enter = "save-to-clipboard";
          copy-command = "${pkgs.wl-clipboard}/bin/wl-copy -t image/png";
          output-filename = "${config.home.homeDirectory}/Pictures/screenShots/screenshot-%FT%T.png";
          save-after-copy = true;
        };
      };
    };
  };
}