On Linux, use the newer field presented by the kernel for calculating
the amount of memory in use. This was introduced in commit
34e431b0ae398fc54ea69ff85ec700722c9da773 to the Linux kernel.
Signed-off-by: Joseph Benden <joe@benden.us>
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.
There's not a single instance of using info.bufmem in any other source
file aside from linux.cc. If there was any plan to use this check (and
info.bufmem) with any other source file, the check should be made in
that specific source file instead.
This fixes #650 'Bad arguments: " unk" and '59"' where `link_qual_max`
would occasionally get updated with an invalid value. Now the update
will ignore bad values and only use valid numbers.
Graphs would appear to change their previous data when any of the
displayed special types (e.g. $color, $hr, $offset) was added or removed
from the display (e.g. from a conditional statement). This is because
Graphs were just looking at memory locations for previous graph data,
but those locations could change if any special types were added or
removed. Now the previous graph data will get stored explicitly.
The specific behavior was retained as far as the exact timings of
the ++/--. Maybe it can get cleaned up more, but at least the
if statement logic is more clear now.
Nested exec expressions like ${execp echo '${execp echo hi}'} are not
evaluated correctly because parsing expressions like these generates and
registers new callbacks but we never wait for these callbacks to
complete before returning the result of the evaluation.
Fix this by re-evaluating expressions after running all pending
callbacks.
- use sccache for build caching
- add coverage reports as build artifacts
- add lcov-summary for coverage summary
- clean up/refactor CI yaml
This resolves the FreeBSD part of #754.
[PROBLEM]
Some hwmon device number may change due to module load sequence.
E.g:
One boot would cause the following layout:
hwmon0->acpitz
hwmon1->pch_skylake
hwmon2->thinkpad
hwmon3->coretemp
hwmon4->iwlwifi
While another boot could lead to:
hwmon0->acpitz
hwmon1->pch_skylake
hwmon2->coretemp
hwmon3->thinkpad
hwmon4->iwlwifi
[ENHANCEMENT]
This patch will enhance the hwmon command to accept hwmon device name as
first parameter instead of number.
Now "hwmon 3 temp 1" can be converted to "hwmon coretemp temp 1", which
is more readable and user won't ever need to bother the hwmon sequence
number change.
Signed-off-by: Qu Wenruo <wqu@suse.com>
Otherwise I get this error while building:
/wrkdirs/usr/ports/sysutils/conky/work/conky-1.11.1/src/core.cc:1503:50: error: assigning to 'void (*)(struct text_object *, char *, unsigned int)' from incompatible type 'void (*)(struct text_object *, char *, int)': type mismatch at 3rd parameter ('unsigned int' vs 'int')
END OBJ(apm_adapter, 0) obj->callbacks.print = &print_apm_adapter;
^~~~~~~~~~~~~~~~~~
/wrkdirs/usr/ports/sysutils/conky/work/conky-1.11.1/src/core.cc:1504:55: error: assigning to 'void (*)(struct text_object *, char *, unsigned int)' from incompatible type 'void (*)(struct text_object *, char *, int)': type mismatch at 3rd parameter ('unsigned int' vs 'int')
END OBJ(apm_battery_life, 0) obj->callbacks.print = &print_apm_battery_life;
^~~~~~~~~~~~~~~~~~~~~~~
/wrkdirs/usr/ports/sysutils/conky/work/conky-1.11.1/src/core.cc:1505:55: error: assigning to 'void (*)(struct text_object *, char *, unsigned int)' from incompatible type 'void (*)(struct text_object *, char *, int)': type mismatch at 3rd parameter ('unsigned int' vs 'int')
END OBJ(apm_battery_time, 0) obj->callbacks.print = &print_apm_battery_time;
^~~~~~~~~~~~~~~~~~~~~~~
3 errors generated.
*** [src/CMakeFiles/conky.dir/core.cc.o] Error code 1
* First commit!
* Import to git
* Droping down CMake requirement
* Corrected installation of libraries
* Adding travis build
* Updated cmake macros
* Fixed find package
* Updated travis hook
* Updated travis hook
* Patch to support Lua 5.3.
* Fix Lua header include directives in tolua++.h
Use angle bracket rather than double quotes when including Lua headers in the tolua++ header. This fixes a problem on systems that default to a Lua version newer than 5.1 and install the tolua++ header to the same directory as newer Lua headers.
As there are (usually) no Lua headers in the same directory when building tolua++ itself, the preprocessor will look to the include directories passed to the compiler, one of which would be the Lua 5.1 include directory, and tolua++ will build with those (correct) headers. Then the tolua++ header is usually installed in the default include directory, alongside the newer Lua headers, which you wouldn't expect to cause any trouble.
But it does cause trouble when trying to build other programs that include the tolua++ header, because now the preprocessor does find Lua headers in the same directory as the tolua++ header, which are the newer (incorrect) headers. Now the program will either fail to compile, because it doesn't support the newer headers, or fail to link with the tolua++ shared object because they were compiled against different Lua headers.
Using angle brackets instead of double quotes in the include directives will fix the problem, because then the preprocessor will look to the include directories passed to the compiler first.
See http://www.cegui.org.uk/forum/viewtopic.php?f=10&t=7195
* Remove email notifications.
* Update travis build.
* Build shared and static libs.
* Patch toluapp to support Lua 5.3.
With this change, support for Lua 5.1 is dropped.
This resolve #116.
* Add some comments to clarify the toluapp handling.
* Add minor sonar fix.
* Get rid of silly `if (not ...` exp.
* Apply code fixes from sonar.
* Build fix.
* Apply more fixes from sonar.
* Apply more fixes from sonar.
* Apply more fixes from sonar.
A previous change in 5b541b4 (to replace unsafe string functions with
safer equivalents) made a change which broke loading of shared libs.
The cause is a miscalculation of string length before executing a
strncpy(). The calculating did not account for the null character.
This resolves #705.
* Fix XShape handling.
* Fix crash when XDamage is disabled.
* Make sure the nvidia COOLER target is available before trying to pull
attribute values.
* Check the nvidia extension is actually available.
* Check that the display is valid.
* Fix race condition in gw_info handling.
* Fix a couple potential nullptr derefs.
* Fix font handling without x.
* Fix regression in output to ncurses with X disabled.
* Apply some formatting/code smell fixes.
* Add config option to disable blending
This is intended to work around issues with some images blending incorrectly with ARGB visuals.
* Fix order of config documentation.
* Update configuration variable name to simply "draw_blended".
* Fix for SonarCloud malloc warning.
* Update free to delete as part of malloc change.
* Fix goto in ncurses mode when compiled without BUILD_X11
* Fix some issues raised by SonarCloud
* Define delete_block_and_zero() function and use it to replace some malloc calls
* Add fontN config and text variables
fontN, N in {0..9} allows setting a fontN variable to some font settings
which can later be recalled in text, like colorN.
* Add documentation for fontN
* Add syntax-highlighting config for fontN
* Work for #17 : Now we have ssid
* Since we are using Objective-C++ NSStrings, we need to link to Foundation.framework, too!
* If interface is UP use the interface SSID; otherwise "off/any" following the Linux implementation.
Add more
* More
* cleanup
* Add new ${github} variable to count all unread notifications
* doc/variables.xml: add github_notifications
* common.cc: Make the "skip" variable static so on each iteration to preserve the current state
* Use uniform print_pid_Xid to fix code duplication
* fix codesmell: no default in switch
* fix missing break after default
* fix missing in print_pid_Xid and replace if's by switch
* common.cc,diskio.cc: Display units in "SI" as per https://github.com/brndnmtthws/conky/issues/86 request
* Make the mem* and swap* variables to accept additional argument to print the usage in SI units
* common.cc: Fix indentation
* core.cc: Make the strndup() function call as manifest constant
* Add two more formal parameters to "human_readable()"
* diskio.cc: Restore the multiply of 1024LL
* Move the base multiplying into standalone function
* Use the "apply_base_multiplier()" function where necessary
* Try to amend #31
* BUILD_WLAN should be available for all OS.
Keep BUILD_WLAN OFF by default for compatibility reasons.
* WLAN-related variables should be available for every OS.
There are some problems (probably null-dereference)
* Fix $wireless_essid crashing conky if no argument provided.
Conky wasn't parsing the argument of the variable as it should, thus wasn't allocating the `dev` member variable.
Also fix some documentation stuff.
* Improve `get_freq` #20
Using the Intel® Power Gadget API (https://software.intel.com/en-us/blogs/2012/12/13/using-the-intel-power-gadget-api-on-mac-os-x) we can now get actual Core frequency and not the constant factory one.
Though, for some weird reason the API gives the same freq for all Cores, thus the |cpu| arg becomes useless.
* Oops, this accidently slipped in
* Introduce BUILD_IPGFREQ build option
This build option has been introduced for one particular reason:
On macOS getting current core-frequency is not supported by the APIs. A solution is to install Intel's ® Power Gadget which comes with an .app, a Framework and a kernel-extension. Though, this may trouble some alot, thus introduce BUILD_IPGFREQ.
* Forgot static here.
* Some improvements for get_freq again.
Fix frequency not printing correctly (I wasn't using the divisor)
Add more guards.
* Setup cmake files and project code for Objective-C code #17
We want to use CoreWLAN framework.
* update_cpu_usage() now supports multiple cores
Also, some cleanup.
* Updated default conky config to monitor Mac Networking
* Made Mac Friendly BuildOptions and generic default conky configs
* Undid Xdamage config and cleaned up previous IF statements
* Re-Added XDamage fix
* Finish up the algorithm. I think its now correct. Closes: #33
* Cleanup macro and introduce a no-op free_cpu() function for ALL cpu-related variables
free_cpu() must be implemented for every OS and on all except macOS its a no-op function.
* Reformat, add empty comment.
* Require at least glib-2.36 (from 03/2013) to remove deprecated g_type_init()
* Fix empty continuation line in Dockerfile
* Require at least libmicrohttpd 0.9.25 (from 09/2012) to replace deprecated MHD_create_response_from_data()
* fix versioncheck libmicrohttpd
* Missing char for null-terminator in print_v6addrs()
* safe_asprintf to fix /proc/subdir bufferoverflows
There is no max length of /proc/subdir, increasing the value of /proc/sys/kernel/pid_max is one way this can happen
* Fix conversion constant c++ string to variable char array
* Fix strncpy using unrelated MPD_BUFFER_MAX_LENGTH
* Use strncpy instead of strcpy in eve.cc
* Use strncpy instead of strcpy in libmpdclient.cc
* move safe_asprintf back and use ostreams in proc.cc to make sonarcloud happy
* Documentation fixes for macOS
This commit fixes documentation of a macOS specific variable (sip_status) as promised in #480.
Also, fix some identation problems in darwin.cc
* Amend #18 by polling less often! This will help lower CPU usage, too!