1
0
mirror of https://github.com/Llewellynvdm/conky.git synced 2024-10-02 06:59:09 +00:00
Commit Graph

33 Commits

Author SHA1 Message Date
Brenden Matthews
283129e283
Apply clang-format. 2021-01-23 18:19:04 -06:00
freddii
b62e115830 fixed wrong spelled words 2021-01-23 17:59:07 -06:00
Paweł Bielecki
b2a5a47a28 Print uid in top if user doesnt exist. 2020-03-07 10:54:16 -05:00
ndwarshuis
8978b13ff9 properly format PIDs longer than 5 digits 2019-10-19 12:10:56 -04:00
Shark-Teeth
0d449029ea Fix negative RAM usage (#878)
This seems to be causing some issues with clobbering memory values, and
since there is callback functionality already working, this seems
unnecessary.

* Make all calculations local to function

I moved from making the assignments and calculations of certain memory
values to doing the calculations on local variables and assigning them
at the end of the function for update_meminfo().

This is to keep the info.memX variables from having 'intermediary'
values that may give wrong values to other functions if the structure is
read from while the function is currently executing.

As a matter of keeping the variables consistent across function calls, I
removed the zeroing out of certain info struct variables so that if they
are read from, they'll still report a sane value. Since the only change
to the value a direct assignment at the end of the function, they
shouldn't need zeroing out in the first place.
2019-08-27 12:03:41 -05:00
Brenden Matthews
46abd3b75a Apply fixes from clang-tidy/format. 2019-02-23 17:13:19 -05:00
lasers
7eec746b82 update copyright year to 2019 2019-01-05 11:15:36 -06:00
Brenden Matthews
8ff1d9845d
Fix sonar issues. 2018-12-22 12:45:25 -05:00
Brenden Matthews
45b4c80ec2
Fix compiler warnings. 2018-12-20 21:20:43 -05:00
Nikolas Garofil
34848ef0b1 Complete 'Use unsigned int for p_max_size in obj_cb.print' 2018-08-08 15:54:47 -04:00
su8
25eac4c0e5 top.cc: Dont crash on null, and fix for https://github.com/brndnmtthws/conky/issues/220 2018-08-06 10:42:08 +02:00
Brenden Matthews
4b92556fca
Build improvements: clang-tidy, sonar, Dockerfile. (#488) 2018-05-12 19:26:31 -04:00
Brenden Matthews
eebc8c653b
Add formatting/static analysis (#486)
* Reform source with clang-format.

Rules applied with:
    $ find . -iname *.h -o -iname *.cc | xargs clang-format \
        -style=file -i -fallback-style=google

* Add clang-format and analyze to build.

Based on the excellent work at: https://github.com/ttroy50/cmake-examples

* Clean up CMake stuff on macOS.

* Remove vim/emacs modelines.

* Update copyright dates.

* Build fixes.

* Build fixes.

* Build fixes.

* Build fixes.

* Build fixes.

* Build fixes.
2018-05-12 12:03:00 -04:00
deep-42-thought
0523929d4a top.cc: remove hard coded values of MAX_SP (#346) 2016-12-04 10:02:38 -05:00
Marc Payne
03a5cc5047 Add basename support to top
The new top_name_verbose option works in most cases, but it will fail if the
executable name contains spaces. Trying to parse command lines from
/proc/<pid>/* turned out to be quite complex due to the many edge cases. My
solution, once again, is to fall back to 1.9.x behavior. If top_name_verbose is
true, use the full command line. Otherwise, use basename.

Fixes #131.
2015-08-26 11:59:26 -06:00
Marc Payne
99ffe6a0d6 Add basename support to if_running
Currently, in order to match a running process with ${if_running}, a user needs
to specify the full command line plus arguments in conky.conf. This commit keeps
that behavior and adds a fallback that is equivalent to the 1.9.x bevahior,
namely matching against the executable name contained in /proc/<pid>/stat.

This completes the fix for #121.
2015-08-26 11:57:38 -06:00
Marc Payne
d8ff24a6f0 Add support for basenames (short executable names)
Since we now store a full command line for each process, a few problems are
apparent. For example, the names displayed by ${top ...} are verbose. This has
been partially addressed by the top_name_verbose option, but it is broken
whenever an executable name contains spaces. Another example is ${if_running},
which only matches the input if it exactly matches the entire command line.

This commit adds a basename (i.e. executable filename) entry to the process
struct. The intention is to store the executable filename from /proc/<pid>/stat,
which was the old 1.9.x behavior. This way, we have the best of both worlds.
Those who like the full command line can have it, and those who prefer the old
way can be satisfied too.
2015-08-26 11:16:20 -06:00
Marc Payne
06722e4a2a Add top_name_verbose option
Since commit 749083a, the output of ${top name <num>} contains the full
command line of each process, including arguments. While this feature can
be very useful, it changes the default behavior of Conky.

The present commit adds a new top_name_verbose option that allows the user
to toggle between basenames with no arguments (the old behavior) and full
command lines with arguments. To remain consistent with past versions of
Conky, the default value of top_name_verbose is false.

Fixes #113 (https://github.com/brndnmtthws/conky/issues/113).
2015-07-20 17:27:45 -06:00
Magliano Andrea
9268165d71 Usable state reached (use top.cc + minor changes)
* process* management left to top.cc
* compile with -Wall -Werror (lots of wasted time for stupid errors)
* unify find_process() and new_process(), as used always together

Signed-off-by: Pavel Labath <pavelo@centrum.sk>
2012-06-28 19:04:31 +02:00
Brenden Matthews
ddef05d4eb Update version, copyright. 2012-05-03 16:34:44 -07:00
Kevin Lyles
810535a386 Fix overflow in comparisons.
Fix other comparison issues (integer truncation, overflow in cpu time)

Signed-off-by: Brenden Matthews <brenden@diddyinc.com>
2012-05-03 14:08:04 -07:00
Pavel Labath
6c04ba542b Add uid to "top" output (sf.net #3178916)
original patch submitted by Thomas Wiegner, I added support for printing of raw uids.
2011-10-10 22:11:34 +02:00
Pavel Labath
9d0932d711 Use the new callback system instead of add_update_callback() & co. 2010-12-31 13:39:54 +01:00
Pavel Labath
47d9a63dff Make update_interval{,_on_battery} lua settings 2010-09-11 14:25:19 +02:00
Pavel Labath
ef2b39a97f Make text_buffer_size a lua setting 2010-08-29 23:50:32 +02:00
Pavel Labath
31cbd710a6 Make top_name_width a lua setting 2010-08-25 19:09:15 +02:00
Alexander Graf
1180733e13 ${top}: fix bug of living dead processes
This fixes a bug occurred with 0b3e3c637e.
Dead processes still appeared in ${top} under FreeBSD and OpenBSD.  This was
because I forgot to update the g_time variable which is used as time stamp in
the process list.

Signed-off-by: Alexander Graf <agraf@znc.in>
2010-06-03 22:11:57 +02:00
Alexander Graf
319ff32283 shorten top compare functions
A substraction is used instead of if, else if, else.  This is much
shorter.

Signed-off-by: Alexander Graf <agraf@znc.in>
2010-05-30 17:52:00 +02:00
Nikolas Garofil
bf7c2bafc2 fix tiny memleak when $top is used wrong 2010-05-30 17:13:40 +02:00
Alexander Graf
0b3e3c637e ${top}: big cleanup
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>
2010-05-30 13:55:50 +02:00
Nikolas Garofil
da76381300 Use free_and_zero in [st]*.cc where appropriate 2010-02-24 11:52:59 +01:00
Pavel Labath
4c2d634f07 Unbreak weather and iostats
The weather still doesn't quite work for me though.
2010-01-07 19:14:53 +01:00
Brenden Matthews
620e9876a4 C++ conversions WIP.
Currently stuck on an issue with g++ and using '%lli' with printf/scanf.
2010-01-04 19:21:12 -08:00