Add colorpicker

This commit is contained in:
Tobias Reisinger 2024-05-20 18:59:26 +02:00
parent 6085c9f417
commit 1a40104856
Signed by: serguzim
GPG key ID: 13AD60C237A28DFE
4 changed files with 10 additions and 2 deletions

6
.bin/colorpicker Executable file
View file

@ -0,0 +1,6 @@
#!/usr/bin/env sh
grim -g "$(slurp -c bd93f9 -p)" -t ppm - \
| convert - -format '%[pixel:p{0,0}]' txt:- \
| grep -o '#[0-9A-F]\{6\}' \
| wl-copy -n

View file

@ -38,7 +38,7 @@ call_screenshot_tool() {
flameshot)
result=$(flameshot gui -r | tee $screenshot_path | wc -c) ;;
grim)
result=$(grim -g "$(slurp)" - | tee $screenshot_path | wc -c) ;;
result=$(grim -g "$(slurp -c bd93f9)" - | tee $screenshot_path | wc -c) ;;
*)
echo "Unknown screenshot tool: $tool"
return 1 ;;