summaryrefslogtreecommitdiffhomepage
path: root/src/Xmobar
AgeCommit message (Collapse)Author
10 hourshlint warningsHEADmasterjao
10 daysAccordion - a few cleanupsEnrico Maria De Angelis
- Use `RecordWildCards` language extension - Use `concurrently_` and `mapConcurrently_` instead of `withAsync` - Use `Bool` instead of `Maybe ()` - Use `whenM` instead of `when` - Add signature to `loop`
2026-03-12Accordion: remove unnecessary context from `Exec` instanceEnrico Maria De Angelis
2026-03-11Fix #767 - 1st attemptEnrico Maria De Angelis
2026-03-09Update doc for PacmanUpdatesEnrico Maria De Angelis
This is a minor follow up to https://codeberg.org/xmobar/xmobar/pulls/764, so see that one as well if you got here because the plugin told you it's deprecated. This change consists of: - turning the deprecated constructor in a pattern synonym for the new ones (which are also pattern synonyms for calling convenience), - dropping the `PacmanUpdatesDeprecated` type entirely, - adding documentation with usage examples.
2026-03-08Improve `PacmanUpdates`Enrico Maria De Angelis
Recently, I've seen the usefulness in knowning whether one of the pending updates is a kernel update (which means we should most likely reboot after next system update), and also whether the running kernel is older than the installed kernel package (which means we've probably not rebooted yet), so I thought I should update this plugin. However, the feature of knowing whether a kernel update is contained in the available updates requires that one knows the kernel package name, so that's to be a `String` input to the plugin. But one might not want to pass it, and be happy with just the detection of whether the running kernel is older than the installed one. Since recently, I've been studying type families and also come across pattern synonyms, I thought I could leverage these, so I thought I could parametrize the plugin over kind `Bool`, and branch on it to provide the different APIs; then I could use type synonyms to lift the burden of having to use type application at the user code. Furthermore, rather than still customizing the message by asking the user to provide `String`s for the various cases (0 updates, 1 update, 2+ updates), I thought it was better to ask the caller to provide a function that accepts the relevant inputs (`Int` number of updates, `Bool` telling whether such and such) and turns them into a `String`. With this change, I'm - renaming the previous type `PacmanUpdates` to `PacmanUpdatesDeprecated` - deprecating such type (with a pragma and by printing a clickable note in the plugin text) with the intention of deleting it in a year from now, - preserving its data ctor's to avoid breaking existing code right now, - creating a new `PacmanUpdates` type that is parametrized over kind `Bool` - the `True` instance allows passing the name of the kernel package that the plugin uses to detect whether there's a pending kernel update - the `False` instance doesn't, - accordingly the two instances accept from the caller a printing function with different signature (see haddock comments for details), - hiding (i.e. not exporting) the constructor of such new type, - provided pattern synonyms to more conveniently create a `PacmanUpdates False` (for `PacmanUpdates True` is just the same as the ctor), - changing the approach with which the final `String` is produced, from asking the user to provide a bunch of some sort of template `String`, to asking them for a function that produces a `String` given the required inputs (e.g. the number of available updates).
2026-02-28Remove deprecated ArchUpdates pluginEnrico Maria De Angelis
Users should have long switched to PacmanUpdates, as communicated in #723. Furthemore, we had forgotten to list PacmanUpdates in the plugins wrappable in Runnable. Fixed now.
2025-12-24Remove unnecessary `extensible-exceptions` dependencykonsumlamm
2025-10-26Avoid redundant use of IO monadEnrico Maria De Angelis
2025-10-23Accordion: avoid spawing a process to read from pipeEnrico Maria De Angelis
The reason is that this way the issue https://codeberg.org/Aster89/xnobar/issues/15#issue-2346829 is fixed. See https://codeberg.org/Aster89/xnobar/issues/15#issuecomment-7864955 for more details.
2025-06-04MPD compilable again by default with all_extensionsjao
2025-06-02swap_enabled is not accessable in FreeBSD 15/CurrentMichal Zielonka
instead of swap_enabled in top program currently checking number of swap devices is used.
2025-06-01Accordion: new constructor to allow short version to have plugins tooEnrico Maria De Angelis
2025-06-01Accordion: some renaming and reformattingEnrico Maria De Angelis
2025-04-14feat: add new PacmanUpdates pluginAlexander 'ccntrq' Pankoff
the new PacmanUpdates plugin behaves similar to the ArchUpdates plugin while additionally allowing to pass in a custom error message for unknown pacman failures. The default error message of `pacman: Unknown cause of failure.` of the ArchUpdates plugin is too long for my taste. The ArchUpdates plugin was modified to delegate to the new PacmanUpdates plugin while providing the default error message and to show a deprecation notice in the zero updates case. The new name better represents the Plugin's compatibility with all pacman-based distributions, not just Arch. The docs have been updated to reflect the existence of the new plugin and to highlight the similarities between the ArchUpdates and PacmanUpdates plugins. The ArchUpdates plugin has been marked has deprecated there to.
2025-03-31copyright yearsjao
2025-03-31hlintingjao
2025-03-31mpris: Read track length from Word64 tooClaudio Bley
According to the MPRIS v2 spec, the length of a track "must be given in microseconds, and be represented as a signed 64-bit integer". [1] But Spotify does not follow the spec and represents it as an unsigned 64-bit integer: ``` $ dbus-send --session --print-reply --reply-timeout=150 --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.freedesktop.DBus.Properties.Get string:org.mpris.MediaPlayer2.Player string:Metadata method return time=1743433787.301824 sender=:1.142 -> destination=:1.178 serial=1071 reply_serial=2 variant array [ dict entry( string "mpris:length" variant uint64 152000000 ) ... ``` This always made the `length` template argument end up empty, but allowing a Word64 for this attribute fixes this problem. [1]: https://specifications.freedesktop.org/mpris-spec/latest/Track_List_Interface.html#Mapping:Metadata_Map
2024-08-26fallback to weather in weatherSjao
2024-08-25wee refactoringjao
2024-08-25new template variable weatherS for WeatherXjao
2024-06-21Accordion: a plugin two wrap other plugins and collapse them to a single ↵Enrico Maria De Angelis
replacement string
2024-05-22Remove 1-arg ctor for ArchUpdatesEnrico Maria De Angelis
2024-05-18ArchUpdatesEnrico Maria De Angelis
2024-05-07Revert "Make the Kbd monitor clickable, with click selecting the next layout"jao
This reverts commit 0fec9d3fdf9bc86187f9f670dafd2ef57fe03f29. Mouse actions can already be attached to the monitor, and for instance use there invocations to setxbdmap to switch layouts. Fixes #703.
2024-03-30fix for unmet pattern matches warnings (clean build)jao
2024-03-30Add ctor for Locks plugin to accpet on/off labelsEnrico Maria De Angelis
2024-03-30Fix waitForProcess errors when configuration is recompiledUlrik de Muelenaere
Previously, xmobar would ignore SIGCHLD, but only when the configuration is recompiled. This means child processes would not leave zombies, so that waiting for them to exit (either directly by calling waitForProcess, or indirectly through another function from System.Process, like system or readProcessWithExitCode) would produce an error. This breaks the Alsa, Com (#657) and NotmuchMail plugins, as well as the <action> tag (#687) and low battery action (#688). As far as I can tell, bracketing the recompilation in uninstallSignalHandlers and installSignalHandlers was inherited from xmonad. In xmonad, SIGPIPE and SIGCHLD are always ignored (installSignalHandlers is called at the start of xmonad and launch), so the bracket is necessary to be able to wait for the compiler or build script to exit. Since xmobar does not otherwise ignore the signals, it is not necessary to change signal handlers at all during recompilation. Removing it leaves the default action for SIGCHLD, which fixes the issues described above. Fixes #657, #687 and #688.
2024-03-30Fix zombie processes left by <action> tag and low battery actionUlrik de Muelenaere
This effectively reverts c54d93e and 991a168. While those fix #687 and #688 respectively in the case where the configuration is recompiled, in all other cases they leave zombie processes, since they undo the fix for #181. However, instead of reverting to the deprecated system function, we use the newer spawnCommand and waitForProcess. And like with 991a168, the low battery action now runs in the background to avoid blocking the bar.
2024-03-17Make the Kbd monitor clickable, with click selecting the next layoutEnrico Maria De Angelis
2024-03-06copyright yearsjao
2024-02-18battery: spawnCommand instead of system when running actions0.47.4jao
should fix for real #688 this time
2024-02-05actions: spawnCommand instead of deprecated systemjao
This should address the problems reported in issue #688
2024-01-31Enable use of shared librariesVekhir
Haskell libraries can be linked statically or dynamically. Either way, all packages must be linked the same way. This means that if all dependencies of `xmobar` are shared libraries, then `xmobar` itself must be built using dynamic linking. Therefore, to compile the individual `xmobar` executables, add the `-dynamic` flag to signal that they are built with shared libraries. This flag is put behind an #ifdef to easily configure static vs dynamic linking. To use shared libraries, define SHARED_LIBRARIES
2023-11-11compatibility with GHC 9.6jao
2023-08-30changelog and copyright years0.47jao
2023-06-02center middle section for templates of the form "}M{" (fixes #677)jao
2023-03-22Handle SocketError when attempting to connect to dbusCorey Halpin
Extends the solution from 8a53271cd6 to also handle SocketError, so that the process will not terminate. See also issue #537.
2022-12-31layout: special case for empty left segment (see #655)jao
2022-12-23Fix for #663: honour explicit bg/fg colors for iconsjao
2022-12-10off by onesjao
2022-12-10off by onejao
2022-12-10alignment: avoid overlapping of left and right segmentsjao
Might help with #655
2022-11-30lintingjao
2022-11-30Adds DPI configuration (#660)jgrocho
Adds a new DPI configuration, especially useful for HiDPI displays. This changes the scaling factor for fonts as displayed by Pango. It defaults to 96.0 which corresponds to an average screen and is the default in [Cairo](https://hackage.haskell.org/package/pango-0.13.5.0/docs/Graphics-Rendering-Pango-Cairo.html#v:cairoFontMapGetDefault). It's also possible to supply a zero or negative value to use the default scaling factor, but I felt setting the default to 96.0 makes it more explicit. It also adds a matching command line option. I haven't tested it too thoroughly, but in my limited use it appears to be working as intended. One thing this does not do is scale XBM and XPM bitmap files which I'm unsure how to do or if that should even be our concern (instead leaving it up to the user to supply appropriate bitmaps). Co-authored-by: Jonathan Grochowski <jon@grocho.net> Reviewed-on: https://codeberg.org/xmobar/xmobar/pulls/660 Co-authored-by: jgrocho <codeberg@jon.grocho.net> Co-committed-by: jgrocho <codeberg@jon.grocho.net>
2022-11-16cairo: recover pre-cairo z-ordering of segmentsjao
2022-11-16cairo: fix: don't draw outside maximum allowed offsetjao
2022-11-13similar take on centering the centerjao
2022-11-13center segment drawn in the center of the barjao
should make things better for #650 and #655
2022-11-08Fixes offset of the pseudo-transparent backgroundKostas Agnantis