Solved Color picker and Wayland

It looks like graphics/gcolor3 doesn't work under Wayland, at least under x11-wm/labwc. Anyone else can confirm this?

Code:
┬─[fmc000@tu45b-freebsd:~]─[19:12:52]
╰─>$ gcolor3

** (gcolor3:36984): WARNING **: 19:13:00.980: Cannot count number of items: Key file does not have group “Colors”


** (gcolor3:36984): WARNING **: 19:13:00.980: Cannot count number of items: Key file does not have group “Colors”


** (gcolor3:36984): WARNING **: 19:13:03.861: Failed to pick color: GDBus.Error:org.freedesktop.DBus.Error.UnknownMethod: No such interface “org.freedesktop.portal.Screenshot” on object at path /org/freedesktop/portal/desktop
┬─[fmc000@tu45b-freebsd:~]─[19:13:07]
╰─>$
 
you can use grim,slurp and imagemagick as a colour picker
if you are running a wlroots wayland compositor

running the following command and then clicking a colour on screen
with the cursor will output the value with imagemagick

Code:
#!/bin/sh

# colour-picker

grim -g "$(slurp -p)" -t ppm - | convert - -format '%[pixel:p{0,0}]' txt:-

Code:
# ImageMagick pixel enumeration: 1,1,0,255,srgb
0,0: (134,0,0)  #860000  srgb(134,0,0)
 
Thanks, will try that tomorrow. However, I would like to know why gcolor3 doesn't work OOTB.

Edit: the script works just fine, thank you again.
 
Back
Top