Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Color key has no effect. #146

Closed
beanaroo opened this issue Oct 29, 2015 · 24 comments

Comments

@beanaroo
Copy link

@beanaroo beanaroo commented Oct 29, 2015

I have tested this using the default configuration provided. Colors passed by blocklets scripts work as expected.
This occurs on the git based package for Arch Linux. Release 1.4 works as expected.
I am using i3gaps by Airblader, if that's relevant.

@beanaroo beanaroo changed the title Colors key has no effect. Color key has no effect. Oct 29, 2015
@kb100

This comment has been minimized.

Copy link
Contributor

@kb100 kb100 commented Oct 29, 2015

Related? #138

@SageEx

This comment has been minimized.

Copy link

@SageEx SageEx commented Nov 11, 2015

In arch aur, i3-blocks-git has same problem. The normal i3-blocks is fine.

@kb100

This comment has been minimized.

Copy link
Contributor

@kb100 kb100 commented Nov 13, 2015

@SageEx would it be possible to git-bisect until you find the first commit in which the bug occurs?

@zenhaeus

This comment has been minimized.

Copy link

@zenhaeus zenhaeus commented Nov 20, 2015

Same problem here... i3 on Ubuntu 14.04. None of my blocklets are colored, unless the color is passed by the blocklet script.

@ghost

This comment has been minimized.

Copy link

@ghost ghost commented Nov 20, 2015

Here's the key question: is anyone experiencing this without using i3gaps? I had a play with the gaps fork but the project seems too under documented for my tastes.

It's just that i3blocks is designed to adhere to the official i3bar protocol API. If the fork has broken or changed something, there is probably nothing we can do. I don't use gaps so I'm not really prepared to hunt down the source of this bug. If someone (anyone) has this problem in the official i3 implementation, I'm more than happy to address this issue.

@japareaggae

This comment has been minimized.

Copy link

@japareaggae japareaggae commented Nov 20, 2015

@Nycroth @kb100 I'm using stock i3 on Arch Linux and I have this issue. I bisected it and the bug appears on commit 701dd3f.

@zenhaeus

This comment has been minimized.

Copy link

@zenhaeus zenhaeus commented Nov 21, 2015

@Nycroth I don't use i3gaps.

@ghost

This comment has been minimized.

Copy link

@ghost ghost commented Nov 21, 2015

Not a problem then, I will see what's up. I have a paper to write today so I may not get to it now but I will look into this over the weekend.

@bookercodes

This comment has been minimized.

Copy link

@bookercodes bookercodes commented Nov 24, 2015

In my experience, this problem only occurs with i3blocks gaps.

I think this because running:

yaourt -R i3blocks-gaps-git
yaourt i3blocks

Makes colours work 😮

@ghost

This comment has been minimized.

Copy link

@ghost ghost commented Nov 24, 2015

Holy.... Thank you @japareaggae! Yeah, that is exactly the problem. Wild.

Hey @vivien, I really have no idea why this happens (an explanation would be awesome (bubby C coder)) but it's true. Removing the if broke colors from the INI file (tested with both i3 and i3's next branch).

@japareaggae

This comment has been minimized.

Copy link

@japareaggae japareaggae commented Nov 25, 2015

My guess is that this is the same problem from issue #138: i3blocks reads an empty line and uses it to set the color, overwriting the color key on the config file. PR #143 fixed it, but only for persistent blocks.

@m3l7

This comment has been minimized.

Copy link

@m3l7 m3l7 commented Feb 2, 2016

I have the same issue.
I can confirm that 701dd3f is the offending commit.
8f7097b doesn't solve for me, so I will return to c5b9734

@darko-mesaros

This comment has been minimized.

Copy link

@darko-mesaros darko-mesaros commented Apr 15, 2016

Same issue with here with version 1.4-21-g017395f

@dkarwowski

This comment has been minimized.

Copy link

@dkarwowski dkarwowski commented Apr 25, 2016

Yeah, this is reading an empty line when reaching the color and overwriting. I was able to fix this with this patch. Commit 701dd3f is the problem, since it's reading the empty lines and overwriting for color as well as the others. It's at least a fix.

diff --git a/src/block.c b/src/block.c
index 7a72c0c..67b68b4 100644
--- a/src/block.c
+++ b/src/block.c
@@ -163,7 +163,8 @@ block_update_plain_text(struct block *block, char *buf)
                 return;

    linecpy(&lines, props->short_text, sizeof(props->short_text) - 1);
-   linecpy(&lines, props->color, sizeof(props->color) - 1);
+   if (*lines)
+       linecpy(&lines, props->color, sizeof(props->color) - 1);
 }

 static void
@japareaggae

This comment has been minimized.

Copy link

@japareaggae japareaggae commented Apr 28, 2016

I have tried @dkarwowski's patch and I can confirm that it fixes this issue.

@vician

This comment has been minimized.

Copy link

@vician vician commented May 2, 2016

@dkarwowski thanks, also works for me.

@radimsuckr

This comment has been minimized.

Copy link

@radimsuckr radimsuckr commented Jun 15, 2016

Any update on this? Is @dkarwowski's patch anywhere upstream or do I have to include it by myself?

@radimsuckr

This comment has been minimized.

Copy link

@radimsuckr radimsuckr commented Jun 21, 2016

@vivien @Airblader Is there any chance of including @dkarwowski's patch to i3blocks?

@Airblader

This comment has been minimized.

Copy link
Contributor

@Airblader Airblader commented Jun 21, 2016

@Grelek I don't maintain i3blocks, only i3blocks-gaps. If I find some time I'll test the patch and merge it to i3blocks-gaps, provided it works. I'd prefer @vivien merging it upstream, of course. :-)

@radimsuckr

This comment has been minimized.

Copy link

@radimsuckr radimsuckr commented Jun 21, 2016

@Airblader Yes, I know you maintain only the gaps version but I mentioned both of you in one comment as I found it more efficient. ;) I can tell from my experience that the patch works but I didn't run any tests or something like that so I have literally no idea how well it integrates with the rest of the project.

Airblader added a commit to Airblader/i3blocks-gaps that referenced this issue Jun 21, 2016
@Airblader

This comment has been minimized.

Copy link
Contributor

@Airblader Airblader commented Jun 21, 2016

@Grelek I've pushed the commit to i3blocks-gaps.

@Nixpower

This comment has been minimized.

Copy link

@Nixpower Nixpower commented Jun 21, 2016

@Airblader Oh wow, my bar is restored to full beauty, thank you 👍

@radimsuckr

This comment has been minimized.

Copy link

@radimsuckr radimsuckr commented Jun 22, 2016

@Airblader Thank you very much 👍

ammarnajjar added a commit to ammarnajjar/i3blocks that referenced this issue Jul 24, 2016
The original mantainer did not add the patch, so I had to fork it and
apply the patch myself.
the patch is mentioned already in issue#146:
vivien#146
ammarnajjar added a commit to ammarnajjar/i3blocks that referenced this issue Jul 24, 2016
the patch is mentioned already in issue#146:
vivien#146
@vivien vivien closed this in 40e396a Jul 25, 2016
@vivien

This comment has been minimized.

Copy link
Owner

@vivien vivien commented Jul 25, 2016

Fix merged. Thank you guys for the report, patch, PR and test, sorry for the delay ;-)

grensjo added a commit to grensjo/i3blocks-gaps that referenced this issue Nov 22, 2016
Apply patch from @dkarwowski who said:

"Commit 701dd3f is the problem, since it's reading the empty lines and
overwriting for color as well as the others. It's at least a fix."

Fixes vivien#146
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
You can’t perform that action at this time.