The previous change obviously didn't work for renderers like the Pango
markup renderer since the highlighting code uses regular spaces and not
no-break spaces. Now spaces are replaced in the contents and dividers
only, and it's done before highlighting the segment so the added
highlighting code stays untouched.
Refs #113.
This commit introduces the following changes to themes and segment
rendering:
- Spacer segments are now regular string/function type segments with
"width": "auto" in the themes.
- The "rjust"/"ljust" properties have been replaced by the "width"
option combined with a new "align" option.
- Renderer._render_segments() is now a generator which renders each
segment separately, and assigns the rendered contents to
"_rendered_hl" and "_rendered_raw" in the segment dict.
- Renderer.render() returns the segments by joining the "_rendered_hl"
values for each segment.
- Spacer segment widths are calculated in the render() method, and
assigned to "_space_left" and "_space_right" in the segment dict.
These spaces are then applied in Renderer._render_segments().
- All space characters are converted to no-break spaces (U+00A0) in the
"_rendered_hl" property.
Refs #113.
Refs #154.
Some applications using Pango and/or Cairo draw square unknown character
glyphs next to divider glyphs instead of regular spaces. Non-breaking
spaces resolves this issue, and they are probably more correct to use
(no application should break lines at the padding spaces since they
"glue" the segment and dividers together as one unit).
This commit appears to work fine in all supported applications on Linux.
This commit resolves the gvim font rendering problems mentioned in
issue #113.
Awesome WM uses the Pango Text Attribute Markup Language
(http://developer.gnome.org/pango/stable/PangoMarkupFormat.html), and
since other applications and window managers may use the same markup
language it's better to have a common renderer for this markup language.
Modules can now be any string, and an informative error message will be
written to sys.stdout if the module doesn't exist. The
`last_pipe_status` argument will also automatically be split into
a list.
This allows the hl() methods to wrap highlighting code *around* the
segment contents, this is required for e.g. Pango markup in Awesome
statuslines (segments must be wrapped in <span ...>...</span> tags).
Bash has weird initialization: bashrc is sourced in non-login
interactive shell, but not in login interactive shell; profile is
sourced in login interactive shell, but not in non-login interactive,
thus exporting in profile does make sense. In zsh case zshrc is always
sourced when shell is interactive and exporting thus makes no sense.