* don't use kvm_* calls, just sysctl (so no suid perm necessary)
* sysctls calls in general aren't thread safe, collapse callbacks
using same sysctls (specifically total/running procs and proc list
ones).
Some sysctls need two calls (first to get size of obj returned,
second to get object self); if different threads use this schema
on same sysctl, weird values are returned (first/second calls
sequence should be serialized).
In general it makes not much sense too having more threads that use
the same sysctl; just get info once and populate all data.
* add DragonFly specific extended uname string ($version in conky.conf)
with git version and signature
Todo:
- top process list logic is old style, use top.cc funcs.
- find a solution for cpu freq
Signed-off-by: Pavel Labath <pavelo@centrum.sk>
Linux-specific code in top.cc was moved to linux.cc.
Redundant code (e.g. the parts sorting by CPU usage, CPU time or memory
usage) was removed. Sorting etc. happens in top.cc, whilst
platform-dependent code in linux.cc, freebsd.cc or openbsd.cc just
builds up the process table.
In the Linux code, some functions had a return value which was never
evaluated. They return void now.
I tested it on FreeBSD and Linux; The OpenBSD port does not compile
anyway. I changed the OpenBSD parts, too, so that it will be less
effort to get conky working under OpenBSD.
Signed-off-by: Alexander Graf <agraf@znc.in>
I've added $memwithbuffers to complement $mem, $memeasyfree, etc. This
variable indicates the used system memory, regardless of buffers/caches. If
the "no_buffers" option is set to "no", it will be the same as $mem. The
reason I find this change useful is that I like to display both the total
used system memory and the memory being used by applications.
I've also included a memwithbuffersbar, which is the same as membar except
that it uses $memwithbuffers as the size instead of $mem.
Signed-off-by: Pavel Labath <pavelo@centrum.sk>
- kill trailing whitespace (grep -n ' $' src/*.{c,cc,h})
- eliminate space before tab (grep -n ' ' src/*.{c,cc,h})
(insert tab by pressing CTRL-v first)
- little indenting fixup in configure.ac.in (we indent using tabs, not
spaces)
note: this should not change the actual code at all - if it does, feel
free to blame me personally ;)
instead:
- call XDefaultScreen() and XScreenCount() directly from the print
callback
- have no update callback at all for the desktop objects (seems to work
well without)