-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Fix some colour settings in swaybar #965
Conversation
If these aren't defined in config, color settings without 'focused_' prefix are used as a fallback.
|
||
bool has_binding_mode_border; | ||
bool has_binding_mode_bg; | ||
bool has_binding_mode_text; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there any way we could encode these into the char arrays? i.e. "inherit" or something.
json_object_object_add(colors, "binding_mode_border", json_object_new_string(bar->colors.binding_mode_border)); | ||
} else { | ||
json_object_object_add(colors, "binding_mode_border", json_object_new_string(bar->colors.urgent_workspace_border)); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does i3 do this, or why would you fall back to urgent_workspace_border
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This commit removes has_* booleans from bar color struct. It also generalizes of functions in commands/bar/colors.c.
// every color has 9 characters plus \0 | ||
*name = malloc(10); | ||
strcpy(*name, value); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about just using strdup everywhere instead of this function?
Why not keep the static buffers? Is there any need for them to be dynamically allocated? |
Putting them on the heap is a bit cleaner imo |
This should fix #932 - if binding_mode colours are not defined, use urgent_workspace colours as a fallback.
Three missing settings were also implemented: focused_(workspace|statusline|separator)
They provide different colours for swaybar on the focused output.