diff --git a/bin/clip-color b/bin/clip-color new file mode 120000 index 0000000..336d544 --- /dev/null +++ b/bin/clip-color @@ -0,0 +1 @@ +../clip-color/clip-color.sh \ No newline at end of file diff --git a/clip-color/README.md b/clip-color/README.md new file mode 100644 index 0000000..9c8b751 --- /dev/null +++ b/clip-color/README.md @@ -0,0 +1,9 @@ +# clip-color + +## About +A simple colorpicker wrapper that copies the color to the clipboard. + +## Requirements +- [colorpicker](https://github.com/Jack12816/colorpicker) +- [xclip](https://github.com/astrand/xclip) +- [notify-send](https://gitlab.gnome.org/GNOME/libnotify) (optional) diff --git a/clip-color/clip-color.sh b/clip-color/clip-color.sh new file mode 100755 index 0000000..d9a7605 --- /dev/null +++ b/clip-color/clip-color.sh @@ -0,0 +1,12 @@ +#!/bin/sh + +notify() { + if [ "$(command -v notify-send)" ]; then + notify-send "$@" + fi +} + +COLOR="$(colorpicker --short --one-shot --preview)" + +printf "%s" "$COLOR" | xclip -selection clipboard +notify "clip-color" "Color $COLOR copied!"