summaryrefslogtreecommitdiffhomepage
path: root/src/Xmobar/Run
AgeCommit message (Collapse)Author
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-10-26Avoid redundant use of IO monadEnrico Maria De Angelis
2024-05-18ArchUpdatesEnrico Maria De Angelis
2024-03-30fix for unmet pattern matches warnings (clean build)jao
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-02-05actions: spawnCommand instead of deprecated systemjao
This should address the problems reported in issue #688
2022-09-30Run.Parsers -> Config.Templatejao
2022-09-16little clean-upsjao
2022-09-15cairo: box drawingjao
2022-09-14whitespacejao
2022-09-11x event loop clean-upsjao
2022-09-11cairo: outer borderjao
2022-02-07swaybar-protocol: additionalFonts via pango markupjao
2022-02-06swaybar-protocol: support for clickable Actionjao
2022-02-04Refactoring: event loop handling simplificationsjao
2022-02-04Xmobar.X11.Parsers -> Xmobar.Run.Parsersjao
2022-02-04Xmobar.App.CommandThreads -> Xmobar.Run.Loopjao
2022-02-04Xmobar.App.Timer -> Xmobar.Run.Timerjao
2022-02-03Xmobar.X11.Actions -> Xmobar.Run.Actionsjao
2022-01-29Xmobar.Run.Command -> Xmobar.Plugins.Commandjao
2021-07-13Add Kraken pluginAmir Saeid
2021-05-24Merge branch 'notmuchmail-fix' [#548]jao
2021-05-24Add NotmuchMail as a runnable typeslotThe
This is needed for the plugin to parse properly in non-Haskell based configurations. Related: https://github.com/jaor/xmobar/issues/547
2021-05-22Add show instances for several types so that configs can be generated ↵Ryan Trinkle
programmatically
2020-05-02Update stderr and the bar on receiving exceptionSibi Prabakaran
2020-04-30Refactor the usage of hGetLineSafeSibi Prabakaran
hGetLineSafe is always hGetLine and hence we can directly use it.
2020-02-22Timer coalescing: gracefully uncoalesce slow timersTomas Janousek
The first implementation assumed all timers (monitors) are fast and frequent (which happens to be the case in my configuration). This meant that a single on-line weather monitor could block the entire xmobar instance for a long time due to the refresh pausing (meant to reduce power consumption). This commit attempts to fix that by limiting the refresh pause time and using the old periodic sleep method for these slow timers (monitors).
2020-02-22Implement timer coalescing (noticeably less CPU/power usage)Tomas Janousek
xmobar currently runs every monitor in its own thread. Monitors that do periodic updates simply sleep and loop. This unfortunately leads to these threads coming out of sync, and xmobar ends up waking up and redrawing for every periodic monitor. In my case, that is 7 times per second, which is enough for xmobar to be at the top of "top" with more than 1% CPU usage, and to have a noticeable impact on battery life. This commit adds a central timer coordination thread which makes sure that periodic updates happen together and that we only redraw once they're all done. Together with PR #409, I managed to lower the idle power draw of my laptop from 4W to 3W.
2020-02-22Refactor code from tenthSeconds to doEveryTenthSecondsTomas Janousek
A preparation for timer coalescing: tenthSeconds is just a sleep whereas doEveryTenthSeconds enables using a central timer and waiting for all monitors to update before refreshing the window. This commit is just a simple refactor, the actual timer coalescing code comes later.
2018-12-02Fix: exposing the Command constructors in libjao
2018-11-26Xmobar.Config.Parsejao
2018-11-25Xmobar.System.Utils, Xmobar.X11.Eventsjao
2018-11-25Xmobar.App.Mainjao
2018-11-25Xmobar.App and small refactoringsjao
2018-11-25Back to app/src, since it seems they're the default convention for stackjao