#!/bin/sh

## Simple Script To Pick Color Quickly.

color=$(gpick -pso --no-newline)

main() {
	if [[ "$color" ]]; then
		# copy color code to clipboard
		echo "$color" | tr -d "\n" | xclip -selection clipboard
		# notify about it
		dunstify -u low --replace=69 -i /usr/share/icons/Papirus-Dark/symbolic/status/notification-symbolic.svg "$color, copied to clipboard."
	fi
}

# Run the script
main
