From 1de12e7b20e7ce38e2777218f1d922b3255599e1 Mon Sep 17 00:00:00 2001 From: Marco Hunsicker Date: Wed, 5 Mar 2014 20:53:07 +0100 Subject: Support align and min_width module options This patch enables users to define "align" and "min_width" options right in the i3status module config sections. Specifically this patch: * Adds macros for the two new options that are used in the option definitions. As the min_width option can take either a string or a number, a custom type has been added along with a corresponding callback function that parses the provided value (and provides input validation). The align option also uses a callback for input validation * Expands all module config option definitions to include the new options * Extends the SEC_CLOSE_MAP() macro to generate the JSON for the new options as necessary * Updates the manpage to explain the new options --- man/i3status.man | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'man/i3status.man') diff --git a/man/i3status.man b/man/i3status.man index 7ba4422..656a8bf 100644 --- a/man/i3status.man +++ b/man/i3status.man @@ -404,6 +404,35 @@ volume master { } ------------------------------------------------------------- +== Universal module options + +When using the i3bar output format, there are a few additional options that +can be used with all modules to customize their appearance: + +align:: + The alignment policy to use when the minimum width (see below) is not + reached. Either +center+ (default), +right+ or +left+. +min_width:: + The minimum width (in pixels) the module should occupy. If the module takes + less space than the specified size, the block will be padded to the left + and/or the right side, according to the defined alignment policy. This is + useful when you want to prevent the whole status line from shifting when + values take more or less space between each iteration. + The option can also be a string. In this case, the width of the given text + determines the minimum width of the block. This is useful when you want to + set a sensible minimum width regardless of which font you are using, and at + what particular size. Please note that a number enclosed with quotes will + still be treated as a number. + +*Example configuration*: +------------------------------------------------------------- +disk "/" { + format = "%avail" + align = "left" + min_width = 100 +} +------------------------------------------------------------- + == Using i3status with dzen2 After installing dzen2, you can directly use it with i3status. Just ensure that -- cgit v1.2.3