From b84b6ae6634c324f560ba31003a6cc4d2d7e79e9 Mon Sep 17 00:00:00 2001 From: speedie Date: Tue, 6 Dec 2022 19:27:19 +0100 Subject: [PATCH] better document barmodules --- TODO | 3 +++ bar.h | 71 ++++++++++++++++++++++++++++++++++++++++++++++++++--------- 2 files changed, 63 insertions(+), 11 deletions(-) create mode 100644 TODO diff --git a/TODO b/TODO new file mode 100644 index 0000000..df59a5f --- /dev/null +++ b/TODO @@ -0,0 +1,3 @@ +- Give proper credit to authors of patches that went into this project. +- Document the bar better. +- Rewrite statuscmd and powerline status syntax so that they can be used together. diff --git a/bar.h b/bar.h index 447ede6..ebe51a3 100644 --- a/bar.h +++ b/bar.h @@ -1,17 +1,66 @@ -/* Bar rules allow you to configure what is shown where on the bar, as well as - * introducing your own bar modules. +/* Bar configuration + * + * This header is for configuring the bar along with its modules. Below are some usage notes. + * + * Monitor: + * -1: Show the module on all monitors. + * 0": Show on the main monitor (monitor 0). + * 'A': Show on the focused monitor. + * + * Bar: + * 0: Main bar. + * 1: Extra bar. + * + * Alignment: + * bar_align_left: Force the module to be placed on the left side of the bar if possible. + * bar_align_right: Force the module to be placed on the right side of the bar if possible. + * bar_align_center: Force the module to be placed in the center of the bar if possible. + * bar_align_left_left: Force the module to be placed on the left side of the bar next to the center split. + * bar_align_left_right: Force the module to be placed on the right side of the bar next to the center split. + * bar_align_left_center: Force the module to be placed on the center in the middle of the remaining space left of the center split on the left.. + * bar_align_right_left: Force the module to be placed on the left side of the bar next to the center split. + * bar_align_right_right: Force the module to be placed on the right side of the bar next to the center split. + * bar_align_right_center: Force the module to be placed on the center in the middle of the remaining space left of the center split on the right. + * bar_align_right_none: No specific alignment. This will give the module the remaining space. + * + * Width: + * Function to run when getting the width of the module. + * + * Syntax: width_ + * Example: width_tags_pwl + * + * Draw + * Function to run when drawing the module. + * + * Syntax: draw_ + * Example: draw_tags_pwl + * + * Click + * Function to run when getting a click. + * + * Syntax: click_ + * Example: click_tags_pwl + * + * Module name + * Does nothing special, just helpful for debugging among other things. + * + * Module list + * + * List of modules that can be used. + * + * ltsymbol: Standard, basic layout icon. + * tags: Basic tags, without powerlines. + * tags_pwl: Tags with powerlines. + * systray: System tray. + * status_basic: Basic status bar. + * status: Clickable status bar with color support. + * status_pwl: Status with powerlines. + * title: Title, shows all windows, including hidden windows. + * title_basic: Basic title, shows focused window. * - * monitor: - * -1 show on all monitors - * 0 show on monitor 0 - * 'A' show on active monitor (i.e. focused / selected) (or just -1 for active?) - * bar - bar index, 0 is default, 1 is extrabar - * alignment - how the module is aligned compared to other modules - * widthfunc, drawfunc, clickfunc - providing bar module width, draw and click functions - * name - does nothing, intended for visual clue and for logging / debugging */ static const BarRule barrules[] = { - /* monitor bar alignment width function draw function click function name */ + /* Monitor Bar Alignment Width Draw Click Module name */ { -1, 0, bar_align_left, width_ltsymbol, draw_ltsymbol, click_ltsymbol, "layout" }, //{ -1, 0, bar_align_left, width_tags, draw_tags, click_tags, "tags" }, { -1, 0, bar_align_left, width_tags_pwl, draw_tags_pwl, click_tags_pwl, "powerline tags" },