How can I save the RGB values of grabc in variables?
grabc -rgb
or this other code:
xwd -root -silent | convert xwd:- -depth 8 -crop "1x1+$X+$Y" txt:- | grep -om1 '#\w\+'
How can I save the RGB values of grabc in variables?
grabc -rgb
or this other code:
xwd -root -silent | convert xwd:- -depth 8 -crop "1x1+$X+$Y" txt:- | grep -om1 '#\w\+'
To save variables in bash you can put your command between the following quotes ''
For example:
VAR='COMANDO'
So for the second command you're probably looking for something like this:
VAR='xwd -root -silent | convert xwd:- -depth 8 -crop "1x1+$X+$Y" txt:- | grep -om1 '#\w\+''
The first one is a bit different, because by looking at the documentation , it seems that the -rgb
parameter makes the utlity write STDERR instead of STDOUT, so you will need to redirect the output to be able to save the content in the variable:
VAR='grabc -rgb 2>&1'