zhengqunkoo avatar

xmobar

0 subscribers
HaskellNix

A minimalistic, mostly text-based status bar

Created Aug 2020

NOASSERTION license

Live activities

The README documentation for the <box> output template tag has been updated to provide clearer usage examples and full details on available parameters. New information covers margin settings (mt, mb, ml, mr) and provides concrete syntax examples for custom underlines and overlines. These refinements make it easier for users to leverage the tag for styling their text outputs.

Updated the README to include detailed usage instructions for the <box> tag, which allows users to decorate text with configurable borders. The documentation now covers supported options like line type, color, width, and positioning offsets. This makes it much easier to customize visual elements within the bar directly from configuration templates.

This update addresses an issue where forcing UTF-8 encoding during Xft rendering caused problems for the StdinReader monitor when handling non-binary handles. By conditionally avoiding redundant UTF-8 encoding, we ensure more consistent string handling and resolve potential display bugs noted in issue #476.

This change fixes how xmobar prepares strings before passing them to Xft for UTF-8 drawing. Instead of always mapping characters directly to code points, it now checks whether the string is already UTF-8 encoded and only runs explicit encoding when needed. That should avoid incorrect text rendering for some inputs while preserving the fast path for valid UTF-8 strings, making font drawing more reliable in practice.

This change fixes a compatibility edge case in Xmobar.Plugins.Monitors.Mpris where xesam:trackNumber can arrive as Word32 instead of the previously expected signed integer types. The metadata formatting logic was refactored slightly to handle Int32, Int64, and Word32 variants more cleanly, while preserving special formatting for durations and track numbers. In practice, xmobar should now display track numbers correctly for spotifyd and other slightly quirky MPRIS implementations.

This change fixes a text rendering issue in the X11/Xft path where xmobar was UTF-8 encoding strings again before drawing them. The implementation now passes the character data through directly instead of calling UTF8.encode, which avoids double-encoding and better matches the expectation that upstream data is already in the right form. In practice, this should prevent garbled text for affected inputs and make rendering behavior more predictable.

This change fixes a bug in the monitor output code where indexed bar rendering could try to access len - 1, which becomes negative when the bar length rounds to zero. The implementation now clamps that index with max 0, avoiding invalid indexing while preserving the existing rendering path for non-empty bars. In practice, percent bars now behave correctly at 0% instead of risking a crash or bad output.

This change refactors Plugins.Monitors.Volume so the internal channel' and channel helpers now take only a PerChannel value and return Nothing on failure instead of silently substituting fallback values like 0 or False. The result is a cleaner type signature and a more explicit distinction between “real value” and “couldn’t read the channel,” especially for volume, dB, and switch lookups. In practice, the volume monitor should now behave more predictably in error cases and the code is easier to reason about.

This change removes the push trigger from .github/workflows/haskell.yml, leaving the Haskell action to run for pull requests and manual dispatches only. It looks like a cleanup to align the workflow with its intended scope after it was still firing on master pushes. The practical effect is less redundant CI noise and fewer unnecessary workflow runs.

This commit introduces CI for the project with a GitHub Actions workflow that builds across multiple GHC versions, installs system and Haskell dependencies, runs hlint on the source tree, and executes the test suite. The workflow triggers on pushes, pull requests, and manual runs, which helps catch compatibility issues and style regressions earlier in development. In practice, contributors now get automated feedback before changes land, making master more reliable.

This change updates src/Xmobar/X11/Draw.hs to make the border-drawing case analysis formally exhaustive by adding an explicit unreachable fallback branch. The behavior shouldn't change at runtime under valid inputs, but it removes a compiler warning and makes the intent clearer for future maintenance. Practical effect: cleaner builds with one less warning to sift through.

This change reworks the X11 box tag parser from a positional <box=...> format to a more flexible attribute-style syntax, adding explicit support for type, offset, width, color, and individual margins like mt, mr, mb, and ml. The drawing code was updated accordingly so box borders honor those margins and use a structured offset representation instead of unpacked positional fields. In practice, theme authors get finer control over boxed segments and more robust parsing when styling status bar output.

This change fixes how xmobar draws box borders when a non-default line width is configured. The renderer now passes the line width through to the border-drawing helper and offsets top, bottom, and right edges to account for stroke thickness, which better matches how X11 centers lines. In practice, boxes should now render with the expected visual width and alignment instead of looking too thin or slightly misplaced.

This change updates the documentation for the output template box syntax to show that <box=BBFull> is valid without explicitly passing alignment, offset, width, and color. The README now makes it clear that only the Position parameter is required and the rest fall back to default values. It’s a small docs-only change, but it removes confusion around a useful formatting feature and makes the API easier to discover in practice.

- End of feed -