committing random WM stuff
This commit is contained in:
23
colorpicker
Executable file
23
colorpicker
Executable file
@@ -0,0 +1,23 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
## Copyright (C) 2020-2024 Aditya Shakya <adi1090x@gmail.com>
|
||||
##
|
||||
## Simple Script To Pick Color Quickly.
|
||||
|
||||
#color=$(grim -g "`slurp -b 00000000 -p`" -t ppm - | convert - -format '%[pixel:p{0,0}]' txt:- | tail -n1 | cut -d' ' -f4)
|
||||
color=`$(which hyprpicker)`
|
||||
image=/tmp/${color}.png
|
||||
|
||||
main() {
|
||||
if [[ "$color" ]]; then
|
||||
# copy color code to clipboard
|
||||
echo $color | tr -d "\n" | wl-copy
|
||||
# generate preview
|
||||
convert -size 48x48 xc:"$color" ${image}
|
||||
# notify about it
|
||||
notify-send -h string:x-canonical-private-synchronous:sys-notify-picker -u low -i ${image} "$color, copied to clipboard."
|
||||
fi
|
||||
}
|
||||
|
||||
# Run the script
|
||||
main
|
||||
Reference in New Issue
Block a user