mirror of
https://github.com/GRFreire/scripts.git
synced 2026-01-10 04:59:38 +00:00
add clip-color script
This commit is contained in:
parent
9cf7146e3f
commit
43b7773876
1
bin/clip-color
Symbolic link
1
bin/clip-color
Symbolic link
@ -0,0 +1 @@
|
|||||||
|
../clip-color/clip-color.sh
|
||||||
9
clip-color/README.md
Normal file
9
clip-color/README.md
Normal 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
12
clip-color/clip-color.sh
Executable 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!"
|
||||||
Loading…
Reference in New Issue
Block a user