Skip to content

idea: configure bar components via config.h #49

@phkrl

Description

@phkrl

The idea is inspired by the way slstatus is configured. Roughly, i think about the following structure:

typedef struct {
  char *(*status)();
  void (*action)(const Arg arg);
} Barconfig;

Here status is the function which gets text to display, action is the function called if this text is pressed (if needed).
In config.h it could be used as follows:

const Barconfig leftaligned[] = {
  { tags_list, NULL },
};
const Barconfig centeraligned[] = {
  { client_name, NULL },
}
const Barconfig rightaligned[] = {
  { status, NULL },
}

Afterwards three cycles over these configs are performed to draw in left, center and right parts of the bar.
This way, i think, it will be a lot easier to add any objects to the bar. The colorscheme and data for status text should be available from global variables.

I'll try to implement it myself but maybe someone could be quicker than me.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions