Lemonbar can't allocate colors! - Desktop Customization & Workflow

Users browsing this thread: 1 Guest(s)
nekrilia
Members
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.
dkeg
Members
Hi nekrilia. Exactly that. Seems you are setting colors in your script which aren't correct. Post your script.
work hard, complain less
nekrilia
Members
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
Houseoftea
Long time nixers
There's your issue!

Remember that # is comment

You are commenting out your colors
dkeg
Members
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-}"
work hard, complain less
nekrilia
Members
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.
dkeg
Members
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
work hard, complain less
nekrilia
Members
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.
dkeg
Members
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.
work hard, complain less
nekrilia
Members
Yeah, I've moved on to using dzen2. Really wanted to use lemonbar.
io86
Members
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'.
z3bra
Grey Hair Nixers
(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?
nekrilia
Members
(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?
z3bra
Grey Hair Nixers
(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.
venam
Administrators
It might be a problem with your shell adding characters to the outputting or behaving in a wrong way.
nekrilia
Members
(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?