NixOS-Config/modules/home/wms/programs/wlpicker/default.nix

16 lines
440 B
Nix

{ pkgs, config, ... }:
{
home.packages = with pkgs; [
(pkgs.writeScriptBin "wlpicker" ''
# Get color position
position=$(slurp -b 00000000 -p)
# Sleep to prevet grim always returning improper color
sleep 1
# Store the hex color value using imagemagick
grim -g "$position" -t png - | convert - -format '%[pixel:p{0,0}]' txt:- | tail -n 1 | cut -d ' ' -f 4 | wl-copy -n
'')
];
}