add clip-color script

This commit is contained in:
Guilherme Rugai Freire 2021-08-28 17:24:09 -03:00
parent 9cf7146e3f
commit 43b7773876
No known key found for this signature in database
GPG Key ID: 0F9FE41723A8A297
3 changed files with 22 additions and 0 deletions

1
bin/clip-color Symbolic link
View File

@ -0,0 +1 @@
../clip-color/clip-color.sh

9
clip-color/README.md Normal file
View File

@ -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)

12
clip-color/clip-color.sh Executable file
View File

@ -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!"