Created
September 5, 2022 22:29
-
-
Save lsjostro/8253985f7d16724f08e82a18828de13a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -e -o pipefail | |
gdbus call --session --dest org.gnome.Shell.Screenshot --object-path /org/gnome/Shell/Screenshot --method org.gnome.Shell.Screenshot.PickColor | | |
sed 's#.*: <(\([0-9].[0-9]*\), \([0-9].[0-9]*\), \([0-9].[0-9]*\).*#{"r":\1, "g":\2, "b":\3 }#' | | |
jq -r '{r:(.r*255),g:(.g*255),b:(.b*255)}| join(" ")' | | |
xargs printf "#%x%x%x\n" | xclip -selection clipboard |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment