removed title component

This commit is contained in:
FelixKratz 2021-08-23 14:45:28 +02:00
parent e25c8b5af2
commit 096315e72d
2 changed files with 2 additions and 12 deletions

View file

@ -64,21 +64,11 @@ void bar_item_script_update(struct bar_item* bar_item, bool forced) {
void bar_item_update_component(struct bar_item* bar_item, uint32_t did, uint32_t sid) { void bar_item_update_component(struct bar_item* bar_item, uint32_t did, uint32_t sid) {
if (bar_item->type == BAR_COMPONENT) { if (bar_item->type == BAR_COMPONENT) {
if (strcmp(bar_item->identifier, BAR_COMPONENT_TITLE) == 0) { if (strcmp(bar_item->identifier, BAR_COMPONENT_SPACE) == 0) {
char* focused_window = focused_window_title();
if (focused_window) {
bar_item_set_label(bar_item, string_copy(focused_window));
}
else {
bar_item_set_label(bar_item, string_copy(""));
}
}
else if (strcmp(bar_item->identifier, BAR_COMPONENT_SPACE) == 0) {
if ((1 << sid) & bar_item->associated_space && (1 << did) & bar_item->associated_display) if ((1 << sid) & bar_item->associated_space && (1 << did) & bar_item->associated_display)
bar_item_set_icon(bar_item, bar_item->icon, bar_item->icon_highlight_color); bar_item_set_icon(bar_item, bar_item->icon, bar_item->icon_highlight_color);
else else
bar_item_set_icon(bar_item, bar_item->icon, bar_item->icon_color); bar_item_set_icon(bar_item, bar_item->icon, bar_item->icon_color);
} }
} }
} }

View file

@ -70,7 +70,6 @@ extern bool g_verbose;
#define BAR_COMPONENT_SPACE "space" #define BAR_COMPONENT_SPACE "space"
#define BAR_COMPONENT_GRAPH "graph" #define BAR_COMPONENT_GRAPH "graph"
#define BAR_COMPONENT_TITLE "title"
#define BAR_POSITION_LEFT 'l' #define BAR_POSITION_LEFT 'l'
#define BAR_POSITION_RIGHT 'r' #define BAR_POSITION_RIGHT 'r'
@ -255,6 +254,7 @@ static void handle_domain_add(FILE* rsp, struct token domain, char* message) {
bar_item->identifier = token_to_string(name); bar_item->identifier = token_to_string(name);
} else if (token_equals(command, COMMAND_ADD_COMPONENT)) { } else if (token_equals(command, COMMAND_ADD_COMPONENT)) {
struct token identifier = get_token(&message); struct token identifier = get_token(&message);
if (token_equals(identifier, "title")) printf("Title component deprecated please use windowTitle.sh script");
name = get_token(&message); name = get_token(&message);
position = get_token(&message); position = get_token(&message);