This repository has been archived on 2024-04-07. You can view files and clone it, but cannot push or open issues or pull requests.
dotfiles-old/scripts/.local/bin/color-picker

22 lines
331 B
Bash
Executable File

#!/bin/sh
set -e
if pgrep redshift;then
echo r true
pkill redshift
red=true
else
echo r false
red=false
fi
grim -g "$(slurp -p)" - |
convert - -format '%[pixel:p{0,0}]' txt:- |
grep -oE '#[0-9a-f]{6}' |
wl-copy
notify-send "$(wl-paste)" "Copied to clipboard"
$red && redshift &> /dev/null &