Age | Commit message (Collapse) | Author |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Fixes #466
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Fixes https://github.com/jaor/xmobar/issues/463.
|
|
|
|
|
|
|
|
|
|
Closes #457
|
|
|
|
|
|
As documented in the http-client library, calling newManager is an
expensive operation:
```
Creating a new Manager is a relatively expensive operation, you are
advised to share a single Manager between requests instead.
```
But inspite of the haddocks in xmobar claiming that once 'Manager' is
created, it will be used throughout the monitor is not true. Because for
every call of `startWeather` a new manager is being created.
Also I removed the option in WeatherOpts because even if it is false,
it will be ultimately created in `getData` function. Also without
using a manager - the plugin won't really work. So, I don't think
there is any reason for this option to exist.
I have introduced a new dependency http-client-tls to use the shared
global manager so that we reuse the same manager every time. This
simplifies a lot of code. Note that this is not really a new
dependency because http-conduit already depends on it transitively.
|
|
We avoid calling getTimeZone for each of the time the date has to be
updated. Instead, it's computed once at the start and re-used for each
invocation.
Looking at the implementation of 'getTimeZone', we can see that it's
very expensive:
https://www.stackage.org/haddock/lts-15.15/time-1.9.3/src/Data-Time-LocalTime-Internal-TimeZone.html#getTimeZone
It calls a C FFI each time to get the time
zone (getTimeZoneCTime). This is something which we can avoid and the
MR implements that.
I have been using my xmobar with this patch and the result has been
quite good. My xmobar CPU usage has used to hit 3~7%
intermittently. With this MR, It hits only 0.7% intermittently which
is nice. :-)
|
|
|
|
Fixes https://github.com/jaor/xmobar/issues/442
|
|
|
|
|
|
|
|
Right now, with the `StdinReader` plugin enabled - you can crash/cause
busy looping of xmobar if the following html file is opened:
```
<html>
<head>
<title>hello <fn=1>string</fn> </title>
</head>
</html>
```
More details about this bug is here:
https://github.com/jaor/xmobar/issues/442#issuecomment-625706001
This MR also fixes another bug which produces a crash in xmobar if you
pass non integer items between fn:
<fn=crash>
|
|
|
|
|
|
|
|
|
|
This specifically avoids situation described in this issue
https://github.com/jaor/xmobar/issues/438 where the handle was
throwing the IOException continously in a loop:
<stdin>: hGetLine: invalid argument (invalid byte sequence)
It happened because my system's environment was right, but the proper
behaviour hear would be to let it to throw the exception rather than
leading to a busy loop.
I did some git blame to find out that this commit introduced the
behaviour:
https://github.com/jaor/xmobar/commit/fc24dc1874dcf7c9e66e21502a58b40cbe627c85
but there was no reason mentioned in the commit for trying to capture
all exceptions.
|
|
|
|
|
|
hGetLineSafe is always hGetLine and hence we can directly use it.
|
|
|
|
|
|
|
|
|
|
|
|
This adds a new `HandleReader` plugin, which displays data from a
Haskell `Handle`. This is really only useful if you are running xmobar
from within another Haskell program, but lets you avoid the mechanics of
creating a named pipe with the proper file permissions.
Instead, you can use `System.Process.createPipe` to make a pair of read
& write Handles. If you pass the read handle to HandleReader, you can
use hPutStr on the write Handle to send data to xmobar from your
application code.
|
|
Version 0.10.8.1 contains a bug in the readFile function that misbehaves
on things like magic procfs files where stat(2) returns an st_size of
zero, which breaks the Net monitor and such; 0.10.8.2 contains the fix.
|