commit e006142e0825ddc1cda5e9defc9bedbcf4acebbb parent 6994070fda5d8d5f945e5e08c6313d590003f4e6 Author: Alex Balgavy <alexander.balgavy@spaceapplications.com> Date: Sat, 23 Dec 2023 00:00:13 +0100 dmenu-colorpicker script Diffstat:
A | scripts/dmenu-colorpicker | | | 12 | ++++++++++++ |
1 file changed, 12 insertions(+), 0 deletions(-)
diff --git a/scripts/dmenu-colorpicker b/scripts/dmenu-colorpicker @@ -0,0 +1,12 @@ +#!/bin/sh +die() { printf '%s\n' "$1" >&2 && exit 1; } +command -v xcolor || die "xcolor not found." + +case "$(printf 'Hex\nRGB\n' | dmenu -l 2 -p "Color format> " -i)" in + Hex) + xcolor --format hex | clc + ;; + RGB) + xcolor --format rgb | clc + ;; +esac