summary refs log tree commit diff
path: root/bin/colorpick
blob: af2807f3d37404577bce7d711fbaaa905683a3a0 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/bin/sh
# dependencies: grim slurp wl-clipboard
# src: https://git.sr.ht/~sircmpwn/dotfiles/tree/f9e7e88a72c2b87e5ab823205cb3a3aa8f3babd0/bin/colorpick
notify-send \
	--icon '/usr/share/icons/Adwaita/scalable/actions/color-select-symbolic.svg' \
	"Pick a color"

(
	color=$(grim -g "$(slurp -p -b 00000000)" - | convert - txt:- | awk 'END{print $3}')
	wl-copy "$color"
)

notify-send \
	--icon '/usr/share/icons/Adwaita/scalable/actions/color-select-symbolic.svg' \
	"Color copied to clipboard" "$color"