nixers
Lemonbar can't allocate colors! - Printable Version
+- nixers (https://nixers.net)
+-- Forum: Desktop Customization, Efficiency, and Aesthetics (https://nixers.net/Forum-Desktop-Customization-Efficiency-and-Aesthetics)
+--- Forum: Desktop Customization & Workflow (https://nixers.net/Forum-Desktop-Customization-Workflow)
+--- Thread: Lemonbar can't allocate colors! (/Thread-Lemonbar-can-t-allocate-colors)


Lemonbar can't allocate colors! - nekrilia - 02-08-2015

I'm attempting to set up lemonbar on bspwm, and when invoking lemobar via
Code:
example.sh | lemonbar -p
I get a 'Could not allocate "Insert Color Here"' error message.

Anyone have any ideas what's going on?

Googled and posted the issue on the project's github.


RE: Lemonbar can't allocate colors! - dkeg - 02-08-2015

Hi nekrilia. Exactly that. Seems you are setting colors in your script which aren't correct. Post your script.


RE: Lemonbar can't allocate colors! - nekrilia - 02-08-2015

Hi! Thanks for the reply.

Code:
#!/usr/bin/bash

# Define the clock
Clock() {
        DATE=$(date "+%a %b %d, %T")

        echo -n "$DATE"
}

# Print the clock

while true; do
        echo "%{c}%{F#ffffff}%{B#000000} $(Clock)%{F-}"
        sleep 1;
done



RE: Lemonbar can't allocate colors! - Houseoftea - 02-08-2015

There's your issue!

Remember that # is comment

You are commenting out your colors


RE: Lemonbar can't allocate colors! - dkeg - 02-08-2015

lemonbar is looking for hex format with the Alpha value included. Alpha,Red,Green,Blue or #aarrggbb. You're also missing the -B and -F flages. So you'll want
Code:
echo "%{c} -F %{F#FFffffff} -B %{B#FF000000} $(Clock)%{F-}"



RE: Lemonbar can't allocate colors! - nekrilia - 02-08-2015

After updating example.sh with those fixes, I'm still getting the same errors. Just to confirm, I now have:

Code:
#!/usr/bin/bash

# Define the clock
Clock() {
        DATE=$(date "+%a %b %d, %T")

        echo -n "$DATE"
}

# Print the clock

while true; do
        echo "%{c} -F %{F#FFffffff} -B %{B#FF000000} $(Clock)%{F-}"
        sleep 1;
done

I've tried using this from other terminals, and to my knowledge there is no debug flag I could use with the lemobar command. Let me know if there's any more information I can give.


RE: Lemonbar can't allocate colors! - dkeg - 02-08-2015

sorry, I sent you down the wrong track. Background and foreground global colors do not require the %{B} or %{F} piece. Also the way you're implementing it is off.
You can do it as you have, but you'll give lemonbar its paramenters when you pipe your script through it
Code:
script|lemonbar -F "#FFffffff" -B "#FF000000"
OR you can set the script as
Code:
#!/usr/bin/bash

# Define the clock
Clock() {
        DATE=$(date "+%a %b %d, %T")

        echo -n "$DATE"
}

# Print the clock

while true; do
        echo "%{c}$(Clock)"
        sleep 1;
done | lemonbar -F "#FFffffff" -B "#FF000000"
If you wanted to change the color of BG or Text for a different output. Say if you added memory, and you wanted the bg of memory to be white with black text instead, you would do
Code:
echo "%{F#FF000000}%{B#FFffffff}$(mem)%{F-}%{B-}%{c}$(Clock)"
Hope that helps


RE: Lemonbar can't allocate colors! - nekrilia - 02-08-2015

Thanks for doing all that, but the same error is still showing. I wonder if I have something that could be conflicting with lemonbar? I have no idea what, though.


RE: Lemonbar can't allocate colors! - dkeg - 02-08-2015

hmm, I don't know. That sux. I tested it before I posted. The only difference is I'm still using just 'bar' before the updates to change to 'lemonbar'. But as far as I know, the biggest 'obvious' difference is requiring an -f flag for each font, as before it could be comma seperated.


RE: Lemonbar can't allocate colors! - nekrilia - 02-08-2015

Yeah, I've moved on to using dzen2. Really wanted to use lemonbar.


RE: Lemonbar can't allocate colors! - io86 - 03-08-2015

nekrilia, you can't give up so easily, man. Look again at dkeg's last code example, It works just fine for me too, with a version already called 'lemonbar'.


RE: Lemonbar can't allocate colors! - z3bra - 03-08-2015

(02-08-2015, 02:59 PM)nekrilia Wrote:
Code:
#!/usr/bin/bash

# Define the clock
Clock() {
        DATE=$(date "+%a %b %d, %T")

        echo -n "$DATE"
}

# Print the clock

while true; do
        echo "%{c}%{F#ffffff}%{B#000000} $(Clock)%{F-}"
        sleep 1;
done

This script works perfectly for me. And I don't get any error. Try updating lemonbar to the latest version perhaps?


RE: Lemonbar can't allocate colors! - nekrilia - 03-08-2015

(03-08-2015, 04:34 AM)io86 Wrote: nekrilia, you can't give up so easily, man.
You're right, but it was more or less just put on the back burner.

(03-08-2015, 07:53 AM)z3bra Wrote: Try updating lemonbar to the latest version perhaps?
Tried the arch package and the git repo to see if that was the issue.

I'm thinking there's some obscure packages conflicting with lemonbar. Is that even possible?


RE: Lemonbar can't allocate colors! - z3bra - 04-08-2015

(03-08-2015, 04:40 PM)nekrilia Wrote: I'm thinking there's some obscure packages conflicting with lemonbar. Is that even possible?
I don't think so. The "Can't allocate color" usually happens when you have typos in the color format.


RE: Lemonbar can't allocate colors! - venam - 04-08-2015

It might be a problem with your shell adding characters to the outputting or behaving in a wrong way.


RE: Lemonbar can't allocate colors! - nekrilia - 04-08-2015

(04-08-2015, 04:38 AM)venam Wrote: It might be a problem with your shell adding characters to the outputting or behaving in a wrong way.
Is there any way to troubleshoot this?