1
0
mirror of https://github.com/Llewellynvdm/conky.git synced 2024-11-16 18:15:17 +00:00
Commit Graph

2796 Commits

Author SHA1 Message Date
Brenden Matthews
33aa5060c2
Make sure gradient width is >=2.
This should resolve #1070 for real this time.
2021-03-09 07:54:37 -06:00
Brenden Matthews
16f2ed659e
Tidy up gradient stuff. 2021-03-06 06:58:08 -06:00
Brenden Matthews
0f3c706336 Replace temporary colour array with smart pointer.
This should fix #1070.
2021-03-04 09:56:20 -05:00
Brenden Matthews
3c43c4c7fe Refactor hsv code. 2021-03-03 12:19:20 -05:00
Brenden Matthews
dbdc003a96
Appese clang-format. 2021-03-02 13:38:08 -06:00
Brenden Matthews
5da4481f55
Fix non-IPV6 build (resolves #1033). 2021-03-02 13:17:46 -06:00
Brenden Matthews
08d77f05ba
Remove this here pragma. 2021-02-27 10:21:41 -06:00
Brenden Matthews
e7cbc43f62
Drop support for systemd <= 205. 2021-02-27 09:26:11 -06:00
Brenden Matthews
308f2cb8ea
Update copyright, authors. 2021-02-27 09:14:19 -06:00
Brenden Matthews
91a3f2ed87 Fix formatting, remove bad line. 2021-02-05 08:44:29 -06:00
nihilix-melix
c2c9e07afc Update linux.cc 2021-02-05 08:44:29 -06:00
Vladimir D. Seleznev
8ce3855b50 Fix conky window crawling
The conky window is crawling when some other is moving around it.

To reproduce this bug run conky with the following config:

   double_buffer yes

   TEXT
   TEST

And slowly move other window near conky window.

The bug was introduced in e2bd14e7b7.

Reported and patch by: George V. Kouryachy (Fr. Br. George) <george@altlinux.org>
2021-02-05 08:39:08 -06:00
Brenden Matthews
68868f4cc0
Run clang-format. 2021-02-03 18:38:41 -06:00
Brenden Matthews
9adaba449a
Run clang-format. 2021-02-01 17:30:17 -06:00
Syco
5ee577ec1f fix file permission
Signed-off-by: Syco <alberto.rinaudo+dino@gmail.com>
2021-01-31 08:26:46 -06:00
Syco
050ee5d3c4 change y coordinate
Signed-off-by: Syco <alberto.rinaudo+dino@gmail.com>
2021-01-31 08:26:46 -06:00
Syco
bea6a5cb9b tests for issue 236 2021-01-31 08:26:46 -06:00
Christian Kögler
c3dab80fc1 Fix memory leak for keyboard_layout
see also https://github.com/brndnmtthws/conky/issues/968
2021-01-30 18:58:09 -06:00
Brenden Matthews
1f0434ed65
Prefer std::abs() over abs(). 2021-01-24 09:53:43 -06:00
Brenden Matthews
0f99ff0bca
Two more formatting fixes. 2021-01-24 09:08:29 -06:00
Brenden Matthews
617e9f14a2
Fix incorrect callback argument for MHD. 2021-01-24 09:07:24 -06:00
Brenden Matthews
168607829d
Apply a few minor formatting fixes. 2021-01-24 08:44:28 -06:00
Brenden Matthews
e4fad17dc0
Apply clang-format. 2021-01-23 19:47:57 -06:00
Brenden Matthews
36faf216df
Fix incorrect param order. 2021-01-23 19:17:40 -06:00
Brenden Matthews
05321f375a
Run clang-format. 2021-01-23 18:41:22 -06:00
humanoid2050
351a7a8d22 made fan data available for indices higher than the gpu card count, and added some protection against bad requests 2021-01-23 18:40:51 -06:00
Brenden Matthews
b679b54508
Run clang-format. 2021-01-23 18:39:35 -06:00
Mithil Poojary
0a4eb8fda5 Replace vulnerable functions with safer alternatives 2021-01-23 18:39:01 -06:00
Mithil Poojary
6bda01266b Confirm pointer is not null and use sizeof object instead of struct 2021-01-23 18:39:01 -06:00
Mithil Poojary
ddb70b4ba9 Confirm that index is greater than 0 2021-01-23 18:39:01 -06:00
Mithil Poojary
b97eff4dbe Fix order of freeing memory 2021-01-23 18:39:01 -06:00
Mithil Poojary
87a31ba039 Avoid passing null pointer to strncpy 2021-01-23 18:39:01 -06:00
Mithil Poojary
a9ecfbaae5 Free memory after use 2021-01-23 18:39:01 -06:00
Mithil Poojary
e9fcca035b Avoid out of bound memory access
Value of idx is -1, if find_match_op returns -1.
Later idx is used as index for accessing element of expr_dup
causing our of bound memory access.
2021-01-23 18:39:01 -06:00
Mithil Poojary
366c384bde Remove redundant break statement 2021-01-23 18:39:01 -06:00
Brenden Matthews
3c9c4074b3
Prefer functions over macros. 2021-01-23 18:30:57 -06:00
Brenden Matthews
283129e283
Apply clang-format. 2021-01-23 18:19:04 -06:00
isaac
36d685eb88 refactor and unit test 2021-01-23 18:00:53 -06:00
isaac
56920fde12 add build option 2021-01-23 18:00:53 -06:00
isaac
d25e0a72f4 added hsv gradient 2021-01-23 18:00:53 -06:00
freddii
b62e115830 fixed wrong spelled words 2021-01-23 17:59:07 -06:00
Carl A Joslin
92df0cf550 Correct width of formated data rates. 2021-01-23 17:54:18 -06:00
François Revol
3355740d23 llua: expose cpu_count
This avoids having to hardcode the CPU count, and crashing with scripts
with too many cpus prepared (typically rings).
2021-01-15 09:59:09 -06:00
Guido Falsi
389d24b4e0 Disable including dev/wi/if_wavelan_ieee.h as it has ben removed from FreeBSD source code in head
It looks like the code actually using this include is already included in an #if 0 block and disabled, so I'm disabling this include unconditionally.
2021-01-15 09:58:25 -06:00
François Revol
8769c57dd9 Get rid of last "not " 2021-01-14 10:12:14 -06:00
François Revol
11431da1a5 fix typo 2021-01-14 10:12:14 -06:00
François Revol
7de6ec0669 Fix build with older microhttpd 2021-01-14 10:11:36 -06:00
Brenden Matthews
16be0e1571
Build fix for libmicrohttpd. 2020-10-22 13:02:00 -04:00
Brenden Matthews
1c599a2752
Add missing mpd_comment variable. 2020-07-27 08:01:52 -04:00
Paweł Bielecki
b2a5a47a28 Print uid in top if user doesnt exist. 2020-03-07 10:54:16 -05:00
Andrew Deason
5651cf1529 Remove length limit on curl URLs
Currently, the ${curl} directive only uses the first 127 characters in
the given URL, discarding the rest. Change the parsing in
curl_parse_arg to dynamically allocate the URL string instead,
allowing ${curl} to use URLs of any length.
2020-02-05 18:06:26 -05:00
AlexApps99
9bee2eec39 Made various misc.cc functions more concise 2020-01-31 19:11:44 -05:00
AlexApps99
8dc04f3902 Renamed to rstrip to allow for future lstrip or even strip (rstrip+lstrip) command 2020-01-24 19:27:31 -05:00
AlexApps99
b8d3515f19 Added strip command
Strips trailing whitespace from string
2020-01-24 19:27:31 -05:00
AlexApps99
703e9a6add Removed null-termination from print_xcases
The strings are already null-terminated
2020-01-24 19:27:31 -05:00
AlexApps99
1924081173 Added lowercase config to match uppercase 2020-01-24 19:27:31 -05:00
AlexApps99
435d05dc6e Optimised and corrected print_startcase 2020-01-21 13:04:13 -05:00
AlexApps99
49638c6c19 Ran clang-format 2020-01-21 13:04:13 -05:00
AlexApps99
f7c15b027a Renamed start_case to startcase, lower_case to lowercase and upper_case to uppercase 2020-01-21 13:04:13 -05:00
AlexApps99
12bced05fe I ran clang-format instead of check-clang-format
Formatting has been fixed now
2020-01-21 13:04:13 -05:00
AlexApps99
1bb8754dce Added lower_case and upper_case commands 2020-01-21 13:04:13 -05:00
helmat
6ad788b78d Fix if_mounted & if_running variables for FreeBSD 2020-01-08 13:21:00 -05:00
Kevin Velghe
2a7226d893 Fix segfault on pulseaudio tunnel sinks 2019-12-30 11:43:28 -05:00
Joseph Benden
11695b076a linux: update statistics based on newer kernel interface (#859)
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>
2019-10-20 19:01:05 -05:00
ndwarshuis
8978b13ff9 properly format PIDs longer than 5 digits 2019-10-19 12:10:56 -04:00
Joseph Benden
dae65af726 add SI unit to graph limits
Signed-off-by: Joseph Benden <joe@benden.us>
2019-10-17 13:28:49 -04:00
Thomas Ingvarsson
9517ab1e6c Add nvidia driverversion variable (#889) 2019-09-19 00:50:20 -05: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
屑鉄さらい;Scrap Trawler
c6b9d2edb5 Removed no_buffers check completely from common.cc
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.
2019-08-12 17:53:54 -04:00
屑鉄さらい;Scrap Trawler
3b752693bd Fix for the issue I made (#860) 2019-08-12 17:53:54 -04:00
Haochen Tong
d467a79fdb Fix heap use-after-free with setlocale
In glibc the return value of setlocale() is allocated in static storage,
which may be invalidated by subsequent calls.
2019-07-23 11:06:00 -04:00
Travis Yaeger
d1a3c0eaa3 Refactor update_net_stats
Clean up
2019-07-23 11:05:21 -04:00
Travis Yaeger
b177dbc4b2 Clean up 2019-07-23 11:05:21 -04:00
Travis Yaeger
f3b1c05cd6 Fix link_qual_max getting updated with bad value
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.
2019-07-23 11:05:21 -04:00
Joseph Benden
afd5594a1f Fix graph leak and the uninitialized values (#858)
Signed-off-by: Joseph Benden <joe@benden.us>
2019-07-08 05:29:58 -05:00
Travis Yaeger
dcc188ebe2 Clear stored graphs on config reload
Includes missed formatting from previous commit.
2019-06-10 10:25:40 -04:00
Travis Yaeger
594d0c85ba Fix bug of "Graph reset when using conditional color"
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.
2019-06-10 10:25:40 -04:00
Travis Yaeger
0ad2119bb4 Remove REQUIRE from cpu Test
cpu_barval now has the same behavior as cpu_percentage when trying to 
get info from a non-existent cpu.
2019-06-02 13:25:02 -04:00
Travis Yaeger
08847314bd Rename remaining round_to_int
The rename refactor didn't work as well as I assumed.
2019-06-02 13:25:02 -04:00
Travis Yaeger
9da1101b5b Rename round_to_int to round_to_positive_int 2019-06-02 13:25:02 -04:00
Travis Yaeger
262f83cefb Fix various SonarCloud warnings in scroll.cc 2019-05-21 09:16:09 -04:00
Travis Yaeger
024ce09c04 Remove side effects from if statements
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.
2019-05-21 09:16:09 -04:00
Jan Senolt
2bfef11061 Fix incorrect Solaris CPU reporting (#838) 2019-05-17 20:17:34 -05:00
Lukáš Cezner
ba8b190459 Typing error removed 2019-04-26 16:35:17 -04:00
Lukáš Cezner
a2983ad794 Fix support for nested exec expressions 2019-04-26 16:35:17 -04:00
Jan Senolt
5c7f3b6666 synchronize access to kstat 2019-04-16 09:03:31 -04:00
Brenden Matthews
84ceeff23f Increase default number of net interfaces.
This should resolve the issue noted in #564.
2019-04-03 08:47:23 -04:00
Daniel Pielmeier
40ead046df Do not install libraries into subdirectories 2019-03-09 11:51:54 -05:00
Daniel Pielmeier
dbdc78fe5a Install libtcp-portmon. 2019-03-09 07:30:37 -05:00
Daniel Pielmeier
58d310808d Install libraries to the proper directories. 2019-03-09 07:30:37 -05:00
senjan
d295fe4393 idtype enum breaks Solaris conky 2019-03-08 08:17:55 -05:00
Kushagra Sinha
c352069b31 Add support for nested |exec| expressions
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.
2019-03-03 13:24:23 -05:00
Kushagra Sinha
4cb79fb3e1 Revert "exec.cc: Cache the result to another variable and return it when we have a empty/invalid value. (#646)"
This reverts commit a644600bc5.
2019-03-03 13:24:23 -05:00
Monsterovich
fc250d8047 fix spaces 2019-02-25 17:11:14 -05:00
Monsterovich
3893146995 Added option to disable redraw on desktop change 2019-02-25 17:11:14 -05:00
Brenden Matthews
40a438be3e FreeBSD fixes, GitLab CI build improvements.
- 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.
2019-02-25 11:22:19 -05:00
Brenden Matthews
dc35a1b0a8 Add more build envs to GitLab CI.
Adding:

 - clang-8
 - gcc-5 through gcc-8
 - fedora & centos builds

Fixing:
 - mysqlclient default search path
 - build on centos6
2019-02-24 09:46:45 -05:00
Brenden Matthews
46abd3b75a Apply fixes from clang-tidy/format. 2019-02-23 17:13:19 -05:00
Brenden Matthews
90673cf161 Make GitLab build work with clang checks. 2019-02-23 17:13:19 -05:00
Qu Wenruo
14e3b80c45 conky: Allow hwmon command to accept hwmon device name
[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>
2019-02-17 09:24:15 -05:00
Brenden Matthews
1fc2b17eb5 FreeBSD build fix. 2019-01-13 12:45:20 -05:00
Brenden Matthews
298eb76434 Include missing FreeBSD header. 2019-01-12 11:50:50 -05:00
Brenden Matthews
aa2de72541 Fix build with BUILD_BUILTIN_CONFIG=OFF. 2019-01-09 09:42:54 -05:00
Brenden Matthews
e834782ddb Build fix for x86 arch.
size_t is unsigned long on x86-64, but not x86.

This fixes #759.
2019-01-09 08:18:07 -05:00
Brenden Matthews
8feae589dc Install libconky_core, too, if wanted.
If someone decides to install the testing build, it doesn't include
libconky_core.

This fixes #756.
2019-01-08 20:02:53 -05:00
Brenden Matthews
6a7dc0cd65 Fix update_total_processes() missing return val. 2019-01-07 20:26:24 -05:00
Guido Falsi
21b4a0a403 These changes are required to make it build on FreeBSD i386 (x86/32)
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
2019-01-07 19:38:04 -05:00
Guido Falsi
a3b03f2257 Add missing return statement.
It was removed in commit e91b91d.
2019-01-07 19:17:14 -05:00
lasers
7eec746b82 update copyright year to 2019 2019-01-05 11:15:36 -06:00
lasers
9dd559b1e9 remove deprecated BMPx support 2019-01-04 19:58:52 -06:00
Brenden Matthews
282160156f Remove deprecated EVE online support.
The EVE API that was in use is now deprecated and no longer works.

This resolves #732.
2019-01-03 10:42:49 -05:00
Brenden Matthews
edb7f84ecd Fix an FD leak in APCUPSD.
In some cases the socket FD may have not been closed in the APCUPSD
update function.

This fixes #725.
2018-12-31 09:27:33 -05:00
Brenden Matthews
6c09affaf7 Add some basic unit tests.
Introduced the Catch2 unit testing framework.
2018-12-24 02:02:01 -05:00
Brenden Matthews
d422aa47d2 Fix more sonar issues. 2018-12-23 15:39:05 -05:00
Brenden Matthews
3df87776d5 Fix more sonar issues. 2018-12-23 14:27:11 -05:00
Brenden Matthews
db471102bb Fix wtf file encoding. 2018-12-23 14:27:11 -05:00
Brenden Matthews
3c5fd4399a Fix some more sonar issues.
Run clang-7 build first so that sonar data gets reported earlier, enable nvidia
in travis builds.
2018-12-23 14:27:11 -05:00
Brenden Matthews
4ef597da92
Parallelize sonar execution. 2018-12-22 19:25:00 -05:00
Brenden Matthews
8e1d3cfdd3
Apply fixes from sonar. 2018-12-22 19:10:10 -05:00
Brenden Matthews
bc60fb2c2f
More build fixes. 2018-12-22 18:34:29 -05:00
Brenden Matthews
94a854cfa2
More build fixes. 2018-12-22 15:53:34 -05:00
Brenden Matthews
198cc9230a
More build fixes. 2018-12-22 15:43:40 -05:00
Brenden Matthews
d191a5fa5c
More build fixes. 2018-12-22 15:42:46 -05:00
Brenden Matthews
5e7b1764b2
Merge branch 'master' into fix-build-with-warnings-enabled 2018-12-22 13:32:51 -05:00
Brenden Matthews
41c32bb72f
More warning fixes. 2018-12-22 13:25:32 -05: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
Brenden Matthews
bb8723dd36
Add toluapp subtree (#712)
* 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.
2018-12-20 15:18:51 -05:00
Brenden Matthews
3a3092902e
Get rid of silly if (not ... exp. (#713)
* 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.
2018-12-20 10:22:08 -05:00
Brenden Matthews
2c816b1392
Build fix for older GCC versions. (#710)
Add some older OS versions to the build matrix to make sure we don't
inadvertantly break the build.

This resolves issue #708.
2018-12-19 11:11:24 -05:00
Brenden Matthews
616d3af655
Fix loading of Lua shared libs. (#707)
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.
2018-12-17 11:21:12 -05:00
lasers
7cec37e009 conky.cc: fix short_units = False 2018-12-16 11:16:51 -06:00
lasers
dfdd573043 Revert "conky.cc: Fix for https://github.com/brndnmtthws/conky/issues/352 (#540)"
This reverts commit fa5e56720f.
2018-12-16 11:16:51 -06:00
npyl
e71a2ff448
Update conky.cc (#701)
In favor of #699
2018-12-15 17:29:40 +02:00
Brenden Matthews
a0d4393826
Fix nvidia crash (resolves #520). (#698)
* 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.
2018-12-09 20:14:08 -05:00
lasers
8599c4b264 nvidia.cc: add nvidia patch (#697) 2018-12-09 16:16:46 +02:00
Brenden Matthews
4d098b0536
Fix for #691, nullptr deref & race condition. (#692)
* 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.
2018-12-08 17:45:17 -05:00
Brenden Matthews
3d9c022245
Update Travis OS images. (#694) 2018-12-08 16:50:00 -05:00
Brenden Matthews
bc0ec94c10
Fix execi scanning segfault due to bad free. (#693)
This should resolve #690.
2018-12-05 16:21:04 -05:00
Guido Falsi
71a60672a8 When compiling with gcc the file /usr/include/machine/md_var.h is included. This header defines a function "void cpu_setup(u_int)" which clashes with the "static short cpu_setup" variable in src/freebsd.cc. (#686)
The patch renames this variable.

Reported by: Piotr Kubaj <pkubaj at anongoth.pl>
Ref: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=233616
2018-12-02 11:29:56 -05:00
Dan McCombs
c1ef8c5cd4 Add config option to disable blending (#682)
* 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.
2018-12-02 11:29:33 -05:00
livanh
8d149471b5 Fix goto in ncurses mode when compiled without BUILD_X11 (#680)
* 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
2018-12-02 11:28:28 -05:00
lasers
f8ff46c2dc add memwithbuffersgraph variable (#671) 2018-10-21 15:52:15 +03:00
Amish Naidu
9b4fc81553 fontN - Predefine font configuration analgous to colorN (#667)
* 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
2018-10-12 20:43:48 +03:00
lasers
1e2a29654f Wifi (#660)
* 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
2018-10-11 08:45:43 -04:00
lasers
a845a403be doc/variables.xml: add undocumented lock keys 2018-09-04 11:08:26 -05:00
lasers
c0d5b6854e conky.cc: quit on SIGHUP 2018-09-04 10:56:03 -05:00
su8
07681e184b Add new variable sysctlbyname for FreeBSD 2018-09-04 10:44:30 -05:00
su8
a644600bc5
exec.cc: Cache the result to another variable and return it when we have a empty/invalid value. (#646) 2018-09-01 16:15:33 +02:00
lasers
887786d746 doc/variables.xml: add undocumented variables 2018-08-31 08:23:19 -05:00
void0
84f136f84a Add new ${github_notifications} variable to count all unread notifications (#637)
* 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
2018-08-25 12:07:03 -04:00
su8
5980fb4a52 misc.cc: Evaluate the result and then parse it to capitalize 2018-08-22 23:13:11 -05:00
su8
d963e0e418 Add ${battery_status} variable to display the battery status 2018-08-22 22:52:39 -05:00
su8
0bc7b80d78 fix missing variables when using multiple out_to_xxx (#628) 2018-08-20 08:32:42 -04:00
lasers
84e1eec2ed
add new options console_bar_{fill,unfill} (#624) 2018-08-17 12:46:40 -05:00
Mike Kazantsev
a4cb740508 conky.cc: add --xinerama-head command-line option (#613) 2018-08-16 18:40:34 -04:00
Mike Kazantsev
99e4407a45 conky.cc: fix window positioning on non-primary monitors (#615) 2018-08-15 09:06:52 -05:00
lasers
41f920671c
lua: remove useless conky_info 'uptime' table (#612) 2018-08-14 12:30:23 -05:00
su8
0edc80bf9b
Arguments to character-handling functions must be representable as an unsigned char 2018-08-14 12:07:16 +00:00
lasers
bbaa0e9ac8 exec.cc: Free malloced pointer after use in scan_exec_arg() (#607) 2018-08-13 14:55:31 -04:00
lasers
fcbc5c8ba2
linux.cc,net_stat.cc: use ${iface X} inside upspeed/f downspeed/f (#608)
* linux.cc,net_stat.cc: use ${iface X} inside upspeed/f downspeed/f

* net_stat.cc: Avoid dereferecing null pointer in parse_net_stat_arg()
2018-08-13 13:40:30 -05:00
lasers
eb31df1bef core.cc,linux.cc: add ${iface} (#603)
* core.cc,linux.cc: add ${iface}

* doc/variables.xml: add ${iface}

* Remove code smells

* linux.cc: Add for loop to iterate interfaces

* Index all NICs

* linux.cc: Allow+Remove NIC exclusion

* linux.cc: Remove code smells

* fix code smell

* switch skip by strcmpreturn
2018-08-13 08:09:24 -04:00
Nikolas Garofil
6c590590a3
Delete broken weathervars before rewrite (#595)
* Kill non-functioning XOAP

* Change weathercode to TODO
2018-08-12 03:51:21 +02:00
lasers
9f7493c81f linux.cc: Fix cpu usage bug (#600) 2018-08-11 18:18:51 -04:00
lasers
6a23cab853
diskio.cc: Allow 'partuuid' label usage (#598)
* diskio.cc: Allow 'partuuid' label usage

* diskio.cc: Merge the if block to strncmp()
2018-08-10 09:47:19 -05:00
su8
3d5e152a8b exec.cc: Calculate the command length once and compare it, check only the first char once 2018-08-09 11:17:23 -04:00
su8
e242fea685 exec.cc: Move the escaping code into standalone function 2018-08-09 11:17:23 -04:00
su8
08f7cd6732 exec.cc: Make sure to test the first char only 2018-08-09 11:17:23 -04:00
su8
260554883a exec.cc: Add some overflow checks 2018-08-09 11:17:23 -04:00
su8
e229f1a398 exec.cc: permit wrapping commands in quotes 2018-08-09 11:17:23 -04:00
lasers
faf9b6b9ed
apcupsd.cc: remove trailing whitespace (#594) 2018-08-09 08:09:34 -05:00
Brenden Matthews
3720e96ca5 Get rid of extra ;. 2018-08-08 15:54:47 -04:00
Brenden Matthews
7220ef4c80 More code smell fixes. 2018-08-08 15:54:47 -04:00
Brenden Matthews
8a4b707a7c Switch from macros to functions. 2018-08-08 15:54:47 -04:00
Brenden Matthews
693ad0bafc Unwrap audacious C macros. 2018-08-08 15:54:47 -04:00
Nikolas Garofil
37a85ad8b0 Workaround for 2 sonarcloud complaints 2018-08-08 15:54:47 -04:00
Nikolas Garofil
38959715e5 Fix all gcc -Wall warnings 2018-08-08 15:54:47 -04:00
Nikolas Garofil
31a4954679 Fix sonarcloud complaints about minus unsigned 2018-08-08 15:54:47 -04:00
Nikolas Garofil
95684a4fe4 Complete 'Use unsigned int for p_max_size in obj_cb.print' even more 2018-08-08 15:54:47 -04:00
Nikolas Garofil
34848ef0b1 Complete 'Use unsigned int for p_max_size in obj_cb.print' 2018-08-08 15:54:47 -04:00
Nikolas Garofil
fb5ce3e626 Fix Sonarcloud complaints 2018-08-08 15:54:47 -04:00
Nikolas Garofil
5dd23796a6 Use unsigned int for p_max_size in obj_cb.print 2018-08-08 15:54:47 -04:00
lasers
2eaba52e69
x11.cc: enable the error handlers by default (#588) 2018-08-08 04:28:35 -05:00
Nikolas Garofil
bd0f287794
Fix codeduplication to keep codefactor happy (#583)
* 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
2018-08-07 22:11:28 +02:00
Brenden Matthews
58e465692f
Fix for https://github.com/brndnmtthws/conky/issues/20#issuecomment-411164643 (#585) 2018-08-07 15:32:17 -04:00
Brenden Matthews
c9d03fbaa1
Su8 master (#581)
* 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
2018-08-07 12:09:34 -04:00
Brenden Matthews
8aa9c819f3
Conky for mac os master (#579)
* 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.
2018-08-07 11:54:01 -04:00
Nikolas Garofil
4d5db325d9 Fix problems found when fixing docker (#575)
* 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
2018-08-07 09:38:36 -04:00
Brenden Matthews
a78a750dad
Build fix for macOS. (#574) 2018-08-06 18:09:20 -04:00
su8
bd98860640 upspeed/f downspeed/f: Be able to use ${gw_iface} as argument (#571) 2018-08-06 17:48:07 -04:00
Brenden Matthews
fd4ab7fc07
journal.cc: Add more overflow checks (#570) 2018-08-06 11:32:04 -04:00
Brenden Matthews
2b3fb682aa
Merge branch 'master' into master 2018-08-06 09:03:05 -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
su8
e29ebfa29f Remove code smells 2018-08-06 09:41:02 +02:00
Brenden Matthews
c771698d5a Vallimar master (#566)
* Fixes compile issue with builtin config.

* Fix copy-paste mistake.
2018-08-05 07:40:22 -05:00
su8
2a24fe36db Remove code smells 2018-08-04 23:11:21 +02:00
su8
4a1cf45795 re-apply intra-aus batteries patch 2018-08-04 22:35:04 +02:00
su8
4155ac253b Add new text objects to retrieve the currently used keyboard layout and mouse speed in percentage and generate random password of chosen length and get the cpu clock speed from assembly 2018-08-04 22:26:40 +02:00
Brenden Matthews
1d5c5238b2
conky.cc: apply intra-au's batteries patch (#558)
* conky.cc: apply intra-au's batteries patch

* Build fix: explicitly include <vector>.
2018-08-04 15:11:22 -04:00
Brenden Matthews
a3b7905df6
Add new text objects to retrieve the currently used keyboard layout and mouse speed in percentage and generate random password of chosen length and get the cpu clock speed from assembly (#550)
* Add new text object to capitalize the first character of each word

* Fix for issue https://github.com/brndnmtthws/conky/issues/46

* Fix for issue https://github.com/brndnmtthws/conky/issues/35

* Fix for issue https://github.com/brndnmtthws/conky/issues/35

* Fix for https://github.com/brndnmtthws/conky/issues/206

* Fix for https://github.com/brndnmtthws/conky/issues/474

* Add new "temp2" variable to print the temperature in floating number

* Make the "temp2" variable static and add some explanation above it

* openbsd.cc: Add one more formal parameter to "temp_print()"

* extras/convert.lua: change url to wiki page (#554)
2018-08-04 15:01:28 -04:00
Brenden Matthews
fb70a9022d
Fix segfault with no update, debug logging. (#551)
* Fix segfault caused by initiliazed deref.

This fixes #117.

* Revert debug logging changes from a9e968956d.

* Replace not with !.
2018-08-03 12:22:11 -04:00
su8
7bca0ca881 Fix issues #439, #303 (#545)
* Fix issues https://github.com/brndnmtthws/conky/issues/439 , https://github.com/brndnmtthws/conky/issues/303

* core.cc: Add missing header file

* core.cc: Check if we build for x11 and add the locks functions

* read_tcpip.cc: Fix for https://github.com/brndnmtthws/conky/issues/306

* read_tcpip.cc: Missing string format specifier for "snprintf()"

* read_tcpip.cc: Wrong signed int format specifier for "snprintf()"

* Missing many string format specifiers to "snprintf()"
2018-08-02 11:15:16 -04:00
Brenden Matthews
71cfbff645
Fix sleep calculation for >1s sleeps. (#543)
The second portion of the time was being discarded, with only the nanos being
respected. This should fix #539.
2018-08-02 11:05:47 -04:00
su8
fa5e56720f conky.cc: Fix for https://github.com/brndnmtthws/conky/issues/352 (#540) 2018-07-30 08:57:42 -04:00
Brenden Matthews
10621e61b1
Conky for mac os master (#532)
* 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!
2018-07-04 15:32:54 -04:00
Brenden Matthews
623fb83379
Fix for $exec regression introduced by 4b92556f. (#514)
This resolves #510.
2018-05-24 20:24:09 -04:00
Evan
da47868d1e Add cat and catp variables. (#507) 2018-05-19 10:27:10 -04:00
Brenden Matthews
4e2dd6348e
Fix a couple more string functions. (#505) 2018-05-13 18:59:39 -04:00
Brenden Matthews
5b541b4609
Switch to safe versions of string functions. (#504) 2018-05-13 18:46:09 -04:00
Brenden Matthews
76f24cb626
More sonar fixes (#502)
* Replace a bunch of strcpy()s with strncpy().

* Fix uninitialized var.

* Replace more strcpy()s with strncpy().
2018-05-13 14:27:58 -04:00
Brenden Matthews
9aed9c016f
Code smell fixes. 2018-05-13 14:20:39 -04:00
Brenden Matthews
4e48624cdf
Sonar fixes for eve. (#501) 2018-05-13 13:56:52 -04:00
Brenden Matthews
87a0718ca0
More bug fixes from sonar. (#500) 2018-05-13 13:50:46 -04:00
Brenden Matthews
b9121daa89
Build improvements (external libs, enable more options). (#498)
- Enable build options by default if they don't require external libraries.
 - Add as many external libraries to Docker and Travis builds as possible.
2018-05-13 13:33:18 -04:00
su8
8dbb623255 Refactor mysql.cc (#493)
* Refactor mysql.cc

* Comparison of array temp not equal to a null pointer

* Switch and compare to C NULL instead std::nullptr_t to avoid compile error

* Use parentheses around addrs

* Remove parentheses around addrs

* Rebase
2018-05-13 12:25:21 -04:00
Brenden Matthews
e91b91d85a
Apply a bunch of code fixes from sonarcloud. (#492) 2018-05-13 09:58:03 -04:00
Brenden Matthews
42e43435f4
Break if MPD connection fails. (#491) 2018-05-12 22:57:11 -04:00
Brenden Matthews
a9e968956d
Minor code fixes. (#489)
* Minor code fixes.

* Switch logging macros to functions.
2018-05-12 21:09:24 -04: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
npyl
b20d83b747 Basic macOS support (#480)
* Initial patches for Darwin support

* cmake files ready for building on Sierra. Dont know about other OSX versions

* Added darwin.h which will contain darwin specific headers

* Patches for enablin asprintf support (needs _POSIX_C_SOURCE >= __DARWIN_C_FULL so remove -D_POSIX_C_SOURCE=200809L).  What is more, -D_LARGEFILE64_SOURCE is used by default so not needed on macOS

* Stubs for get_entropy_avail and get_entropy_poolsize

* More progress to getting to build

* More patches

* Now builds, remains fixing linking errors. Also implemented some functions

* Now links

* Now conky runs without sigabrt()'ing... An exception in semaphore.hh caused it to crash immediately upon initialisation

* README changes

* This was based on an old attempt I did with porting conky where I hadn't cloned the repo and thus it showed 3166 commits behind

* Patched a bit the semaphore.hh and now conky runs at 0.7% CPU usage and not in 100% or 200% as it did before! Yeah

* This update fixes swap-related miscalculations, though:

On macOS there can be used MANY swapfiles ( NOT swap partitions,,, the installation disk is the partition for storing swap memory data )
Thus conky code must be updated for Darwin to support multi-swapfile usage stats.

For now, we default to showing stats for swapfile0

* Fixed a bit the comments so they make sense

* Realised that the sysctl code can give us stats for the whole swap storage so removed the swapmode( int swapfd, unsigned long * retvail, unsigned long * retfree )

* I think the code is in good condition now

* semaphore.hh: Implemented ~semaphore() and added throwing exception
when sem initialisation fails just like in sem() for linux…

darwin.cc:  partially implemented update_cpu_usage() and
update_total_processes()

* Implements update_total_processes()

( Now it finds the correct number of tasks )

the changes in cmake file don’t change the functionality… It is only
comments.

In upcoming updates lua support may be enabled and the comments are
related to lua support.

* get_cpu_count() now conforms to newer sysctl code as suggested by Apple ( we use hw.logicalcpumax instead of hw.ncpus )   -->  The new implementation of get_cpu_count() finds the the max value of logical cores the mac could use on a boot.

update_total_processes() was patched to allow initialising only ONCE when conky runs the machHost and processorSet ( this could probably be implemented in a better way I guess though... )

* patch

* experimental support for get_top_info() and update_cpu_usage() :)

* going to patch stuff

* adds getting rss memory in get_top_info()

* fixes

* Couple things made more beautiful but too many things to fix ...

* Remove unneeded code from darwin_soundcard.h and keep only needed to
compile ( This way we are compatible to GPLv3, i think )

Include GPLv3 header in darwin.cc, darwin.h and darwin_soundcard.h

Add more beautiful and explanatory comments to ease the work of other
contributors… ( Mostly on things that don’t work! )

* Merged the macOS update_cpu_usage() implementation with the linux implementation but still it doesn't work as expected, plus, there are more memory related problems that will be fixed in newer release!

NOTE: It will be really good to see how functions are implemented on linux.cc for more complete implementation

* Now using a more linux-influenced implementation and dropping the old... ( only keeps mach stuff )
Needs some more work though to print accurate percentage! :)

* Add conky installer (.pkg) project

* Now gets thread count aswell! For now, we get this from update_total_processes... Also, removed the installer project because I need to learn more the software

* Properly get thread count!

- Patched core.cc to enable getting threads count on macOS!

- Cleanup in darwin.cc

* sort out some things in the code:

- running_threads_count is not the same as thread_count on macOS! There is actually a difference!
Correct a bit the code!

* Enable the if_mounted command and start implementing the check_mount function in darwin.cc

* Tighten things up

* This patch makes conky build easily and without patching on any supported macOS version!  The new flag introduced is a temporary solution for allowing conky to compile on other OS without tweaking the cmake files.  If you want to compile it with i18l support you will have to run the command: brew link gettext after you install gettext

* Update README to provide more complete info on building on macOS

* Fix

* patch check_mounted + SIP status

This commit:

- patches check_mounted function to match the implementation found in FreeBSD.cc! Now conky expects typing something like this:

conky -t '${if_mounted /Volumes/MacOS} ${endif}'

Please note that the correct way is "/Volumes/MacOS", not "/Volumes/MacOS/" ! You shouldnt put the backslash at the end... It will not work!

- Adds a new command called sip_status which you can use to make conky show System Integrity Protection related information such as if filesystem protection is enabled, if user approved kexts protection is enabled and more...

you can type conky -t '$sip_status' to  see what it does...

( I will most likely update some things later regarding sip_status and check_mounted )

* Further implement sip_status

sip_status now has different functionality!

If you give no arguments it shows whether SIP is enabled or disabled ( generally )
If you give argument ( takes only ONE ) you can specify which specific thing of SIP you want to show status for...

You need to pass 0, 1, ..., 9 to $sip_status as argument to print status for apple-internal, untrusted-kexts, and more...

Below you can see the list:

ARG:                   RESULT:
nothing --> print enabled / disabled
0   --> allow_apple_internal
1   --> allow_untrusted_kexts
2   --> allow_task_for_pid
3   --> allow_unrestricted_fs
4   --> allow_kernel_debugger
5   --> allow_unrestricted_dtrace
6   --> allow_unrestricted_nvram
7   --> allow_device_configuration
8   --> allow_any_recovery_os
9   --> allow_user_approved_kexts

* sip_status progress & if_up enabled

This commit adds the 'a' argument for $sip_status which checks if the SIP configuration is ok or it is likely to break in the future.

Also, enabled the $if_up command, but there are some problems with it...

* sip_status patches

- Updated code based on newest version of csrstat utility (v.1.8)
The 1.8 version fixes a problem in finding status of ALLOW_DEVICE_CONFIGURATION flag.

- Fixed a bug where we mistakenly printed 'disabled' even when SIP was enabled.

* Disable ncurses checks in a way that will allow compiling for other OSes! ( it was a really quick patch before )

* More changes in cmake file to make code prettier and more exact

* More cmake files cuteness

* work for supporting versions prior Sierra

This patch brings more compatibility with versions prior to Sierra.
The project as is nearly links on a 10.9.5 OSX installation.

- on versions prior Sierra clock_gettime() is not implemented thus we need to provide our own implementation for conky to work.  ( Currently we have minimal support, more studying needs to be done )

NOTE: In order to compile on versions as old as Mavericks you will need newer compilers because command line tools for 10.9.5 dont support some C++11 features... For this I donwloaded the commandline tools for Xcode 8.1 ( or 8 dont remember well ) and installed only the CommandLine Tools section with Pacifist!

( The OSX installer sees the OS as too old, so you need pacifist! )

* Oops

* $if_mounted ready

This patch removes the unneded print_mounted() function!
Also cleanup code.

* $if_up works

I think $if_up command works therefore remove the APPLE specific code in core.cc ( there wasnt anything different anyway ) and use the FreeBSD code.

Minor conky output changes in darwin.cc

* fix compatibility with Mavericks and before...

This update allows conky to be compiled on Mavericks and before by checking at compilation time what our build target is.

If it is Mavericks or lower, then cant use the csr_get_active_config func because it is not available.

On higher versions than Mavericks it works as before...

NOTE: For compiling on Mavericks or lower you will have to write 10.9 in CMAKE_OSX_DEPLOYMENT_TARGET when you run ccmake

* Added link for youtube video showing conky running on macOS

* Improvements

Minor improvements related to style
Removed unneeded free() calls

* Simplify Xcode configuration process! :)

* Removed update_cpu_usage() implementation

It was quite buggy so I removed it...

* Cleanup the source code

1. Bogus TODO comments have been deleted!
2. Started using DEBUG_MODE based printf
3. Explain some things better/cleanup

* Last small cleanup

The TODO in get_from_load_info() was unneeded.  Removed!

Also, DEBUG_MODE is enabled for now...

* update authors file

* Improve README

Make it more clean and easier to understand.

* Update README.md

small tweak

* Work for conforming with "Development" rules

1. Add to variables.xml documentation about the $sip_status variable.
2. Add sip_status variable to conkyrc.vim and nanorc to allow highlighting

3. the friends in darwin.cc is ambiguous,,, some are more than friends.

* First patch set that implements get_top_info()

:)

* Calculate cpu usage of all processes more efficiently.  (Now results match Activity Monitor's results a lot!!!)

More info about the get_top_info() implementation will come once I finish it! (soon)

* Cleanup patch!

o Move  a couple things to better places
o Rename get_sample() to get_cpu_sample() to allow to be used by different functions such as get_cpu_usage() ( this is a scene from the future... )
o Improve the way we get cpu usage for each process by passing the already created proc_taskinfo struct to the appropriate function instead of creating another one
	inside it!

* Correctly enable $running_processes variable

In our implementation update_top() doesn't calculate the count of running processes! We assign this functionality to the update_running_processes() function.

* Removed unneeded flag

This is not needed because we do not use update_top() for getting the number of running processes!

* Update README.md

* Update README.md

This adds support for TravisCL.

Though this will compile the project only on Linux it is a good sign to know if our port still can compile on Linux or we have broken things.  It seems like it can't but I suspect the problem existed before my patches.  I will investigate.

* First patch towards implementing #15

This patch a reworked get_top_info().  We now use the function get_top_info_for_kinfo_proc() to set the contents of each |process| struct.
Also, we calculate the total cpu usage and total process usage concurrently using GCD.

Aside from these we bring the function helper_get_proc_list() which makes the code simpler and cleaner.

* First fix for the algorithm that calculates % CPU usage of a process

The previous patch made the algorithm buggy.  It required more reentrant-safe functions.
Make calc_cpu_total_r() which is a more reentrant-safe reimplementation of the calc_cpu_total() function.
This is not the last commit, more are coming in the future.

* Previous commit wasn't pushed...

* Problems committing

* Make the code cleaner but break the algorithm again	#15

The algorithm doesn't work... It is a work in progress!
But this time we have merged the cpu_info and cpusample into one struct called cpusample
( I copied some variables from the linux implementation but they will probably be removed )

* Rework the code a bit / CPU usage % algorithm still doesn't work

Now get_from_load_info() is renamed to helper_update_threads_processes() and is called by both update_threads() and update_total_processes()
This makes the code nicer and removes the enum with the flags

* cleanup

remove unneeded functions, remove unneeded variables

* bugfix

* bugfix

* remove the whole get_top_info() code!

I will rework a lot this code so we can get rid of it.

* Work for #15

Now we use the ultimate solution for calculating % usage of CPU of a process!

Check the #15 Issue for information about this patch!

* Quick memory leak fix & some patches for the get_top_info algorithm

* quick patch for semaphore class

* Update the comments

* For consistency

* temp

* Revert "Merge branch 'master' into update_cpu_usage"

This reverts commit 7267a515c40d54b85107e51016703e6c10f3183e, reversing
changes made to 2190ff0b51463c12c61b3357cf846b8e705ebeb4.

* Revert "Revert "Merge branch 'master' into update_cpu_usage""

This reverts commit 692bd27a3adb2fe7027d65932467a140e42cc7bc.

* Partially implement the overall % CPU usage

* bug fix: I meant procs and threads!

* make the code better part1

* cleanup

* Stabilise the values of get_cpu_sample(). Affects get_top_info() and update_cpu_usage() ( fixes #13 and #15 )

For some reason the code that used host_statistics() function didn't produced bad values quite often.  Replaced the function with host_processor_info() and changed the algorithm
and now the values are correct!

This affects the get_top_info() and update_cpu_usage() functions which wouldn't work correctly until now.

* Finish the optimised version of get_top_info()

Fixes #15

* Quick fix for #16

Probably I will come up with a different location for get_cpu_count() because I want to conform to linux implementation.
Also, the memory leak I am mentioning in get_cpu_count() may not actually exist, as I suspected in the back of my head.

* Strictness

* Cleanup ConkyPlatformChecks.cmake

Cleanup the quick patch code for Lua.

* Add warning to README

If you are using old version of cmake, update it.  It will probably have problems when trying to locate lua.

* More cleanup

* Fix identation

This simplifies the diff.

Also, note that by merging the new code for checking for NCURSES we acheive better compatibility and easy build process

* Remove mixer related patches and files

With the newest patches from upstream, cmake checks if the header soundcard.h exists on the system.

If it doesn't exist (in the case of macOS for example) all mixer-related variables are disabled.

* Changes for using as submodule for ConkyX

* Fixes

* Implement get_freq

This implements #11
Though it doesn't support getting the **current** cpu frequency.

I haven't found a way to do it on macOS but i guess it can be done using a kernel extension. I may come back to this again in the future

* First work for correcting mem stats #6

Incorporate the update_pages_stolen() function and all of its dependencies.

I will see if I can patch the code in order to avoid license problems

* Work for #6

Now we follow the way apple's top works and not Activity Monitor.

For this reason we find different values.  But correct based on top.

* cleanup for #6

* bug fix 1

* cleanup

* hmm sorry

* More cleanup

- Move the libtop_tsamp_t object to darwin.cc.

- Remove unneeded member variables.

* A bit documentation

* Implement secondary memory stats #6

Implement memwithbuffers, memeasyfree and memfree (which isn't secondary)

* Quit update_meminfo if libtop_tsamp_update_vm_stats() failed

* Update README.md

Revert to original conky readme
Move all macOS related information to the Wiki: https://github.com/Conky-for-macOS/conky-for-macOS/wiki

* Alot junk slipped in too!

* Merge net_stats branch

For now, I have only tested up / down bytes count on en0, and it works.

This is for #14

* Corrections

- Fix License headers in darwin* files
- Remove ConkyX entry from .gitignore which slipped into from the "forConkyX" branch which was used for another project ... ConkyX.
- Cleanup top.h  (I will request the changes in a pull request finally)

* Fix identation and cleanup

* identation-fixes part1

* Try to fix problem compiling on linux

Improve checks for headers in ConkyPlatformChecks.cmake to amend the problem;
I mistakenly thought that statfs64 wasn't available in sys/statfs.h in macOS thus I tried to add platform specific code.  Though, I add the checks in the wrong place and also messed up linux-specific code by replacing checks_include sys/statfs with check_symbol_exists statfs64

* attemp to completely fix linux problem!
2018-05-07 07:27:32 -04:00
txpaper
e0990f3e7d Added detect_battery setting (multiple batteries) to fix #190 (#482)
* Fix #190:
 * Added function `is_on_battery()` to correct set update interval
 * Added setting `detect_battery` to correct select one or more batteries to check

* Added `detect_battery` to doc/config_settings.xml
2018-05-03 08:34:48 -04:00
Barben360
1410bac6aa Fixed crash caused by temporary virtual net interfaces (#479)
* Fixed crash caused by temporary virtual net interfaces

* Restored original identation
2018-04-26 07:27:21 -04:00
Adam Majer
128c8cce34 Add support for libical 3.x (#465)
In libical3, deprecated icaltime_from_timet is removed
Use icaltime_from_timet_with_zone instead. This function
exists in libical 2.x so no need to change requirements
2018-03-06 07:46:31 -05:00
Ashley
6a11147397 Allow up to 99 CPU/cores (#459) 2018-02-06 13:01:55 -05:00
Brenden Matthews
562c737588
Fix segfault when out_to_x = false. (#455)
This resolves #454.
2018-01-23 13:52:11 -05:00
François Revol
ac56f205fb Haiku port phase 1 (#433)
* cmake: Add Haiku as a supported platform

* move mixer.cc to platform-specific as Haiku doesn't use OSS

* Add haiku.h with some stubs

* Use haiku.h

* Add some Haiku stubs

* Some Haiku network workarounds

It does not define SUN_LEN, provide a default.

It doesn't name the union in struct ifreq, use ifr_addr directly.
It seems Linux also declares it so it should work without change.
We can always define it for other platforms lacking it (add a cmake test ?).

Haiku does not have IFF_RUNNING, IFF_LINK seems close in semantics, so use it.

* Haiku: Minimal implementation of update_meminfo & get_top_info

* Haiku: implement update_cpu_usage
2018-01-19 11:36:40 -05:00
Daniel Pielmeier
f93a56756b Fix SEGV in a CPU hotplug environment #127 (#453) 2018-01-19 11:36:11 -05:00
Alexey Korop
d97f4dfd8a Make mouse-through workable (#213) 2018-01-19 09:12:08 -05:00
sl33k
e219a0f2d4 add support for exteral refresh via SIGUSR2 (#268) 2018-01-19 09:08:55 -05:00
bzy-xyz
cb089b3231 eve: address apparently spurious libcurl recv errors (#372)
Some time after the last eve-related PR libcurl began returning
`CURLE_RECV_ERROR` from `curl_easy_perform()`, even when the request returns
good data that is otherwise usable.

Now, if the `struct xmlData` has been populated by write_data, we use whatever
came back (almost invariably a complete XML response). We don't depend on
libcurl returning CURLE_OK.
2018-01-19 09:08:03 -05:00
Daniel Pielmeier
0e82422132 Fix drawing text shades (#371) 2018-01-19 09:07:32 -05:00
Kevin Mooney
49daff2ced Fixed #373, segmentation fault when HOME is unset (#375) 2018-01-19 09:06:55 -05:00
deep-42-thought
e1f38f9b68 enable irc to use ipv6 if host can't be reached via ipv4 (#380) 2018-01-19 09:06:27 -05:00
Erinor2
c27b7ebff3 NVIDIA: Cleared TODO for the multi-GPU support (#382)
* Cleared TODO for the multi-GPU support

Added an optional parameter to the commands nvidia and nvidiabar.
If the parameter is omited default value is 0 for GPU0

The parameter is the GPU index starting at 0

Enhanced the cache system for multi-GPU support.

* Optimization and added modelname

* Update of documentation

* Update 2 of documentation
2018-01-19 09:04:23 -05:00
Arseny
e1a19b3093 Provide support to query the active port on PulseAudio's default sink (#405)
* Provide support to query the active port on PA's default sink

This commit exposes 2 objects:
- pa_sink_active_port_name
  (example value: "analog-output-headphones")
- pa_sink_active_port_description
  (example value: "Headphones")
that give respectively the name and description strings
for the active port on the default sink provided by PulseAudio.

* Reflect 9ed28f2a in the documentation
2018-01-19 09:03:06 -05:00
Brad Sawatzky
c712d67884 Fix segfault when kernel reports non-sequential SMP CPU indices (#416)
- For an AMD FX(tm)-6350 Six-Core Processor the file '/sys/.../present'
  reports "0,3-7".  I assume that chip is really an 8-core die with two
  cores disabled...  Presumably you could also get "0,3-4,6", and other
  combos too...
2018-01-19 09:02:32 -05:00
bunder2015
61c0dfaf60 Fix issue #307 - High bars in cpugraph (#429)
Authored-by: kira78 <kira78@users.noreply.github.com>
Signed-off-by: bunder2015 <omfgbunder@gmail.com>
2018-01-19 09:01:49 -05:00
Jan Senolt
b814aafc6e Solaris support (#445)
* Basic Solaris support

* Fixed indentation & minor improvements

* support for diskio
2018-01-19 09:00:42 -05:00
Alexey Bondarenko
cbe403bc51 Fix scrolling of UTF-8 text. (#384)
* Fix scrolling of UTF-8 text.

* Fix some out-of-bounds buffer access issues and code style issues.
2017-12-07 15:00:38 -05:00
albert2004
c93a007a13 Fix gcc-7 compilation error. (#402)
https://github.com/brndnmtthws/conky/issues/396
2017-12-07 14:59:41 -05:00
Darin McBride
a58a6d4e08 Clean up a few valgrind errors, add realloc-failure handling for graphs. (#367)
I think this fixes #360
2017-02-11 13:39:18 -08:00
deep-42-thought
e84ca1f966 enable persistent view of irc messages (#362)
* remove path from libirc-include

* feature: irc: possibly show last n lines persistently instead of all lines said since last time

* irc: add overflow-check, for case when no newmsg's ->next is NULL
2017-02-02 11:25:59 -08:00
Zak B. Elep
c6ef3ba5e7 fs.cc, linux.cc Use /proc/mounts for list of currently mounted fs (#357)
Per manpage of mount(1) in newer util-linux:

    The programs mount and umount traditionally maintained a list of
    currently mounted filesystems in the file /etc/mtab.  This real mtab
    file is still supported, but on current Linux systems it is better
    to make it a symlink to /proc/mounts instead, because a regular mtab
    file maintained in userspace cannot reliably work with namespaces,
    containers and other advanced Linux features.

In most new Linux (e.g. Debian) /etc/mtab is already symlinked to
/proc/mounts.

See
e778642a9e
for the gory details.
2017-01-30 17:31:35 -08:00
labath
2600d01373 Fix an out-of-range error in new_graph (#356)
The code was multiplying the index with the size of the element, and
then adding it to the typed pointer (resulting in a double
multiplication and an OOB access).

Replace the buggy code with a slightly safer c++ alternative.
2017-01-30 17:31:09 -08:00
bzy-xyz
641f4ecfdb eve: fix various issues (#359)
* eve: fix API, empty queue, conky reload, formatting issues

Since the EVE module was contributed, CCP has changed how the API works and
what the correct API URL is. So the module had to be updated to respect the
changes made on the EVE side.

Additionally, undefined behavior was occurring for characters without active
skill training queue, as is common for folks with multiple characters on a
single account, and was also occurring when Conky was reloaded following a
config file change. Now the `$eve` variable should just contain an empty
string if the character isn't training a skill (to make it detectable by
`$is_empty`), and the module should do The Right Thing (tm) when the
config file is changed while Conky is running.

The time remaining text has been adjusted to be slightly less verbose.

The module should do the right thing for up to 64 distinct characters.
Presently, though, every additional character requires a blocking CURL
request, meaning that querying many characters is presently not ideal. A
rewrite of the module to use asynchronous requests is probably in order, but
will be left for a future PR.

* eve: fix timezone handling; better handling of bad XML

* On Linux `gettimeofday()` doesn't return valid timezone data; we use
`localtime()` and the `tm_gmtoff` instead. Training times are no longer
incorrect as a result.

* Sometimes the EVE API will return spurious non-XML tags as part of the
response. This previously caused the XML parser to return a null document.
We tell libxml to `XML_PARSE_RECOVER` to try to recover from these errors
where they occur on real data.
2017-01-30 17:30:25 -08:00
Jörg Mechnich
5878974441 fix mpd_albumartist (#363) 2017-01-30 17:25:33 -08:00
The ultimate Renan
e94f04949c Cached versions of get_nvidia_value and get_nvidia_string_value. (#344)
* Implemented cached versions of get_nvidia_value and get_nvidia_string_balue. Unmutable values now only are queried once.

* Removed the TODO topic related to using static variable as cache + fixed a typo in the sample nvidia config

* Was using mtf variables to store the perf values. Fixed it

* Removed an useless else statement
2016-12-04 10:13:57 -05:00
deep-42-thought
0523929d4a top.cc: remove hard coded values of MAX_SP (#346) 2016-12-04 10:02:38 -05:00
Stephane Fontaine
ddf8a0f58f Possibly Fixes #319 (#333)
*tunneled* pulseaudio sinks do not have any card associated to them.
2016-10-18 14:41:04 -04:00