Skip to content

Commit

Permalink
cliphist: support images in clipboard history
Browse files Browse the repository at this point in the history
  • Loading branch information
zvolin authored Apr 28, 2024
1 parent 02002a0 commit c002bc0
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions modules/services/cliphist.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,14 @@ in {

package = lib.mkPackageOption pkgs "cliphist" { };

allowImages = lib.mkOption {
type = lib.types.bool;
default = true;
description = ''
Store images in clipboard history.
'';
};

systemdTarget = lib.mkOption {
type = lib.types.str;
default = "graphical-session.target";
Expand Down Expand Up @@ -46,5 +54,21 @@ in {

Install = { WantedBy = [ cfg.systemdTarget ]; };
};

systemd.user.services.cliphist-images = lib.mkIf cfg.allowImages {
Unit = {
Description = "Clipboard management daemon - images";
PartOf = [ "graphical-session.target" ];
};

Service = {
Type = "simple";
ExecStart =
"${pkgs.wl-clipboard}/bin/wl-paste --type image --watch ${cfg.package}/bin/cliphist store";
Restart = "on-failure";
};

Install = { WantedBy = [ cfg.systemdTarget ]; };
};
};
}

0 comments on commit c002bc0

Please sign in to comment.