dotfiles/bin/colorpicker
Gabriel Arazas 0681d1fd7c Structure the project with NixOS-styled distros
It's been a while but I've been using NixOS (or anything styled like it
like GuixSD, for example) and distro-hopped from Arch Linux.
I think it's high noon for making the structure of this setup to be
truer to one of the big objectives which is how easy to transfer this
between different setups.
Which means I removed some things such as the package lists, systemd
config files, and package manager-specific configs.
While the solution is easy (which is to simply ignore the
system-specific files) but I'm not going with the pragmatic solution not
because I'm a dumbass but because I'm so smart that I want to create a
challenge for myself to solve a puzzle on figuring out a way on how to
structure my dotfiles. :)

Such a productive use of my time, that's for sure.
2020-09-11 03:12:26 +08:00

19 lines
666 B
Bash
Executable File

#!/usr/bin/env bash
# Selects the region, echoes the hex string (in RGBA format) of the average color of the region.
# Depedencies:
# * maim v5.6.3
# * ImageMagick 7.0.10
# It's a small script and the main code is a chain of commands so a pipeline fail is appropriate here.
set -o pipefail
# Make some form of user feedback.
notify-send "Select a region for color picking."
# The color picker code.
# Take note it uses a slop shader named `crosshair` from the shader examples of the official repo at https://github.com/naelstrof/slop.
maim --select --shader crosshair --tolerance 0 --hidecursor | magick convert - -resize 1x1\! -format '#%[hex:p{0,0}]' info:-