If BUILD_IPV6=ON (default), but the user has disabled ipv6 support
in the kernel using the parameter ipv6.disable=1, then conky fails
to open /proc/net/if_inet6. This leads to a segfault when conky
calls fclose(file) regardless. This fix simply moves the fclose call
into the preceding if statement.
In our XCreateWindow call, we always set the backing_store attribute
to 'Always'. But since we never add the CWBackingStore to our value
mask, the backing_store setting always gets set to the default
NotUseful. This means that the backing store is never turned on, and
so when unobscuring the conky window, portions of the display will not
be drawn immediately if conky is blocked doing something else (e.g.
network, disk, the process is stopped), which is really annoying.
To fix this, specify the CWBackingStore flag in our value mask, so the
conky data is always visible, even if conky is blocking on some other
operation.
x11 shape extension (version >= 1.1) provide ability to set up input region
set up empty input region for undecorated window to create transparent window for mouse events
It now reports only reclaimable memory, by excluding shared memory,
and including the reclaimable part of the SLAB cache.
So '$mem' with 'no_buffers yes' is now the "really used" (unreclaimable) memory.
And when reaching OOM conditions, conky will always report high memory usage.
Related post:
http://calimeroteknik.free.fr/blag/?article20/really-used-memory-on-gnu-linux
In particular:
- Don't call get_battery_perct() recursively.
- Use define for length of string holding battery name.
- We can use strcpy() since bat is zero-terminated.
Currently we set inotify_fd to the value 0 when inotify_fd hasn't been
created yet, or after we close it. But 0 is a valid fd, and we check
for the value -1 to see if it's been initialized. So, if inotify
support is compiled in, but we disable_auto_reload, we can end up
closing fd 0. This can screw up various other things in weird ways,
including that exec'd processes appear to have an invalid stdin.
So, set inotify_fd to -1 to clear all of this up.