summaryrefslogtreecommitdiffhomepage
path: root/src/Xmobar/Plugins
AgeCommit message (Collapse)Author
2022-08-13fix: in -W0, char 0->[0,10], char 1->[10,20]...jao
2022-05-16Fix for -W "0" spec in logarithmic barsjao
Should address issue #630.
2022-05-12Remove the now useless -DUTF8 flagjao
2022-04-18CpuFreq: new template parameters max, min and avg.jao
Fixes #166.
2022-04-18Stylistic nits for previous Batt refactoring/fixjao
2022-04-18Split up battery reading functions; fixed unitsPatrick Günther
Every quantity is now read in its own function and Maybe and pattern matching is used for dealing with absent files. On top of that all units should be fixed now.
2022-04-16Fixed unit of battery power consumptionPatrick Günther
2022-04-14Memory: new argument to scale usage unitsjao
Fixes #624
2022-04-13make small refactoring of load linux codeMichal Zielonka
Add <$> for parsing content of file.
2022-04-11add load monitor for freebsdMichal Zielonka
2022-03-30Fix: consistent use of configured nastring instead of hardcoded N/Ajao
2022-03-30Wee clean-upsjao
2022-03-30Load: honour the -d (decimal digits) monitor argumentjao
2022-03-30Load monitor: correctly colorize according to -L/-Hjao
2022-03-30Load: new load average monitorjao
Closes #208
2022-03-29Apply hlint suggestions to MultiCoreTempRob Whitaker
2022-03-29Fix MultiCoreTemp's temperature file finding logicRob Whitaker
Instead of searching for a fixed set of files and directories (numbered 0-9), which would miss anything above 9, it now searches the relevant directories for files matching the right pattern, regardless of number. Fixes #616.
2022-02-19Strip new lines from X log messages (issue #590)jao
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-12-17add disk monitor for freebsdMichal Zielonka
2021-11-21Improvements for K10Temp's docsjao
2021-10-19add cirrus freebsd test (#580)Michał Zielonka
For start cirrus please use: https://cirrus-ci.org/guide/quick-start/ choose public repositories plan and add only xmobar as observed by cirrus. Also here is addes small fix for dividing by zero when cpu usage is calculated
2021-10-17start using kvm library from bsd for receiving swapinfoMichal Zielonka
Using this library allows us to receive swap info which is more similar with result of command swapinfo.
2021-10-16add top for freebsd procMichal Zielonka
In FreeBSD /proc/pid/stat is missing we should use for top procstat library.
2021-10-08try to add build action for freebsd + uptime plugin splitMichal Zielonka
2021-10-08try to reorganize modules per osMichal Zielonka
We should make better split os specify code for FreeBSD and Linux. Idea comes from @liskin.
2021-10-07add support swap info for freebsdMichal Zielonka
in freebsd swap info is available by sysctl
2021-10-07Add freebsd support for net monitor plugin.Michal Zielonka
In freebsd /sys/class/net is absent so we should use sysctl for obtaining info about stats of network. For parsing if_data struct we could use a "Foreign.Storable"
2021-10-04add reading memory specific for freebsdMichal Zielonka
In freebsd /proc/memoryinfo is absent so we should use sysctl for obtaining info about stats of memory.
2021-09-14Add the QueueReader plugin.Guy Gastineau
* A queue reader for xmobar using `TQueue a` from `stm`. This is a flexible and performat solution for sharing data between arbitrary haskell and xmobar. * I am not sure if I did the haddocks correctly.
2021-08-12Refactor Kbd plugin: avoid partials, fallback to group nameNikolay Yakimov
2021-08-08fix: padString should not make strings longerLeo Zhang
2021-07-13Replace forkIO with bracket & Concurrent.AsyncAmir Saeid
2021-07-13Reconnect on ConnectionClosed exceptionAmir Saeid
2021-07-13Remove redundanciesAmir Saeid
2021-07-13Add Kraken pluginAmir Saeid
2021-05-24NotmuchMail: Manually implement Read instanceslotThe
The automatically derived read instance expects the type to be given in record syntax; this is not what most users want. In order to simply specify the type via Run NotmuchMail "mail" [MailItem "name" "" "tag:unread"] 3000 we have to write our own Read instance. Related: https://github.com/jaor/xmobar/issues/547
2021-05-19Remove unused import; apply lint hintSam Kirby
2021-05-19Add k10temp pluginSam Kirby
The existing support for the coretemp kernel driver only works with Intel CPUs. This commit extends support for temperature monitoring to AMD CPUs. k10temp is a kernel driver for monitoring the temperature of AMD processors. It supports everything from AMD's 10h (Opteron/Athlon) family of processors to the latest 19h (Zen 3) family. Reference: https://www.kernel.org/doc/html/latest/hwmon/k10temp.html The meaning of the various temperatures made available has changed over the years and only `Tctl` is available on processors prior to the 17h family. Labels for these temperatures are present but as Tctl and Tdie do not contain a number I could not find a way to use these as `checkedDataRetrieval` expects an integer label. It is a PCI device and so an address needs to be supplied as part of the configuration. Example configuration: `Run K10Temp "0000:00:18.3" ["--template", "T: <Tdie>C | <Tccd1>C"] 60`
2021-03-30Add FreeBSD support to Cpu pluginKevin Zheng
2020-11-29Update readme and changelogslotThe
2020-11-29Add new plugin: NotmuchMailslotThe
This plugin checks for new mail, provided that this mail is indexed by notmuch. As mail that was tagged is moved from the new directory to cur, the 'Mail' plugin (and its variants) won't work for such mail.
2020-11-25More consistent argument order for MPDXjao
2020-11-24New monitor: MPDXjao
2020-11-19StdinReader: Remove throttling on exceptionTomas Janousek
Introducing the throttling unfortunately has a negative side-effect: it delays all stdin processing, including EOF detection, which can cause confusion the previous commit tries to fix. The only benefit of the throttling is to prevent 100% CPU usage when a lot of garbage is provided on xmobar stdin. We still don't know where that garbage comes from in https://github.com/jaor/xmobar/issues/438, or rather why there's more than a handful of lines of such garbage. @psibi has since fixed his setup to not produce that garbage, and no one else ever reported such a problem, so it's probably safe to ignore it for now. Should anyone ever encounter that again, feel free to ping me, even in the middle of the night, to help debug this. Fixes: 7759df11f746 ("StdinReader: Improve exception handling") Fixes: b7a3d6745817 ("Avoid busy looping by not catching all exceptions")
2020-11-19StdinReader: Improve exception handlingTomas Janousek
This corrects a misleading comment "EOF check is necessary for certain systems" which was added without complete understanding of the root cause of #442. That issue was in fact caused by old xmobars not being terminated on early EOF, and is thus necessary on _all_ systems that rely on EOF to terminate old xmobar before starting a new one. (To trigger the bug, one additionally needs to close the xmobar pipe before sending any input to it, which is unusual, but incorrectly configured xmonad might trigger that.) Furthermore, this fixes another execution path that could lead to xmobar not being terminated on EOF: `echo -e '\xff' | xmobar -c '[Run StdinReader]' -t '%StdinReader%'` would terminate the StdinReader thread upon catching the "invalid argument (invalid byte sequence)" so there'd be no thread to detect the subsequent EOF and xmobar would get stuck. Additionally, I believe that terminating either the thread or the entire xmobar upon receiving a single miscoded byte isn't desirable, as this might be an intermittent issue and another input line can be perfectly okay. Therefore I suggest that the original issue @psibi was trying to fix by b7a3d6745817 is worked around by introducing a throttling delay instead of terminating the thread, as I assume that exceptions other than async and EOF are recoverable. Fixes: b7a3d6745817 ("Avoid busy looping by not catching all exceptions") Fixes: 68ac4d3ae6f3 ("Update stderr and the bar on receiving exception") Fixes: ed0663aac942 ("Add EOF check before getLine operation from stdin") Fixes: https://github.com/jaor/xmobar/issues/442 Related: https://github.com/jaor/xmobar/pull/439 Related: https://github.com/jaor/xmobar/pull/448
2020-11-13Optimize Date plugin again (refresh timezone only once a minute)Tomas Janousek
This makes the Date plugin approximately twice as fast, and makes xmobar up to about 5–10 % faster if Date is the only active plugin. (If more expensive plugins like Network or MultiCpu are used, it doesn't make any measurable difference.) Micro-benchmark results on my HW: Date Benchmarks/Date mean 2.833 μs ( +- 16.08 ns ) Date Benchmarks/DateZonedTime mean 5.020 μs ( +- 32.91 ns ) Date Benchmarks/DateWithTimeZone mean 2.827 μs ( +- 20.52 ns ) (DateZonedTime is the original implementation and DateWithTimeZone is the implementation we had since 0.34 which never refreshes timezone.) Real-life measurements (done overnight on an idle laptop, with all measured xmobars running in parallel to ensure comparable conditions; xmobars configured to only display date and with rate 10 — once per second): $ time timeout 6h xmobar .xmobarrc-DateZonedTime real 360m0,010s user 0m9,867s sys 0m4,644s (9.867 + 4.644) / (360 * 60) = 0.000672 $ time timeout 6h xmobar .xmobarrc-Date real 360m0,008s user 0m9,535s sys 0m4,327s (9.535 + 4.327) / (360 * 60) = 0.000642 $ time timeout 6h xmobar .xmobarrc-Date-10m real 360m0,010s user 0m9,780s sys 0m4,215s (9.780 + 4.215) / (360 * 60) = 0.000648 $ time timeout 6h xmobar .xmobarrc-DateWithTimeZone real 360m0,006s user 0m9,658s sys 0m4,166s (9.658 + 4.166) / (360 * 60) = 0.000640 (.xmobarrc-Date-10m is the proposed implementation, but with timezone refresh every 10 minutes instead of every 1 minute) Interpretation of these results: * refreshing xmobar with just date takes around 650 μs * that is xmobar with just date uses around 0.065 % of CPU time * refreshing timezone takes additional cca 30 μs When we only refresh timezone once a minute, these 30 μs become 0.5 μs amortized, and that should be acceptable to even the most dedicated perfectionist :-) Fixes: a58e32f7c8af ("Revert "Optimize date plugin"") Fixes: 878db3908060 ("Optimize date plugin") Co-authored-by: Sibi Prabakaran <sibi@psibi.in>
2020-11-02Revert "Optimize date plugin"ivanbrennan
This reverts commit 878db39080607ba476ba8d8f547ad28259efb6a9. That commit optimized the date plugin by avoiding calling getTimeZone on each execution, instead calling it just once upon startup and reusing that zone. As a result, the time zone will not be updated dynamically, e.g. when shifting in or out of daylight savings time. I noticed this after my local time zone had shifted from EDT to EST. My xmobar showed 4:30 when the local time was in fact 3:30 (and running date on the command line confirmed that my system clock was actually aware of this shift). I had to restart xmobar in order to pick up the new time zone. I repro'd the unexpected behavior by temporarily disabling my system's time syncing, setting the time to 30 seconds before the zone shift, running date to confirm I'd set the correct time, restarting xmobar, and observing. sudo systemctl stop systemd-timesyncd.service date --set="01:59:30" date I observed my xmobar clock go from 1:59 to 2:00, rather than from 1:59 to 1:00 as expected. Following the same steps, I was able to verify that this commit fixes the issue.