2022-06-08 20:53:00 +00:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
|
|
|
|
let
|
2022-08-02 18:34:45 +00:00
|
|
|
handler = with pkgs; resholve.writeScriptBin "organize-downloads" {
|
|
|
|
interpreter = "${bash}/bin/bash";
|
|
|
|
inputs = [ coreutils efficient-compression-tool ];
|
|
|
|
} (builtins.readFile ./resources/organize-downloads);
|
2022-06-08 20:53:00 +00:00
|
|
|
in
|
|
|
|
{
|
|
|
|
config = {
|
|
|
|
systemd.user.paths.organize-downloads = {
|
|
|
|
Unit.Description = "Watch downloads";
|
|
|
|
Path.PathExistsGlob = "%h/Downloads/Screen{s,\\ S}hot\\ *.png";
|
|
|
|
Install.WantedBy = [ "default.target" ];
|
|
|
|
};
|
|
|
|
|
|
|
|
systemd.user.services.organize-downloads = {
|
|
|
|
Unit.Description = "Organize downloads";
|
|
|
|
Service.ExecStart = "${handler}/bin/organize-downloads";
|
|
|
|
Service.Nice = 10;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|