2025-01-01 11:30:16 -05:00
|
|
|
{ config, lib, pkgs, ... }:
|
2024-12-03 16:50:23 -05:00
|
|
|
{
|
2025-01-01 11:30:16 -05:00
|
|
|
home.packages = with pkgs; lib.mkIf config.home.desktop.enable [
|
2024-12-03 16:50:23 -05:00
|
|
|
(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
|
2024-12-25 00:53:30 -05:00
|
|
|
grim -g "$position" -t png - | magick - -format '%[pixel:p{0,0}]' txt:- | tail -n 1 | cut -d ' ' -f 4 | wl-copy -n
|
2024-12-03 16:50:23 -05:00
|
|
|
'')
|
|
|
|
];
|
|
|
|
}
|