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
Guido Falsi
65890ea21d Avoid referencing underfined symbol
When building without ncurses out_to_ncurses is not defined. It is also not needed to check for ncurses if it is not compiled in.
2022-09-20 09:44:31 -04:00
Brenden Matthews
21dc2ca0b8
This should be max, not min. 2022-09-20 00:25:09 -05:00
Brenden Matthews
3083f1a383
This does nothing. 2022-09-19 10:57:10 -05:00
Brenden Matthews
0af9a609be
Some fonts might treat spaces as 0 width.
Fixes #1173.
2022-09-19 10:45:33 -05:00
Brenden Matthews
52033d13f4
Check display before free.
Should fix #1203.
2022-09-19 09:47:02 -05:00
kistlin
5a2a1470b2 possible fix for brndnmtthws/conky#1165 2022-09-13 17:05:49 -04:00
François Revol
475b859e3f Add an http_port config setting
This should help with #1061.

Also added a warning about the default port being blocked by browsers.
2022-09-11 12:18:36 +02:00
François Revol
80e063ef80 Fix crash when no display output is enabled 2022-09-10 20:39:11 +02:00
François Revol
7cf80d5948 Work around linker missing objects when building tests
Since we rely on a global object ctor to add a display output to the
list, it is not referenced from anywhere else, so does not get linked in
when building tests since most objects are pulled from a static library.

Another option would be to use --whole-archive to link to it.
2022-09-10 20:39:11 +02:00
François Revol
5b22723a3b Fix warnings
unused paramaters and (un)signed comparison mostly.
2022-09-10 20:39:11 +02:00
François Revol
e721119f04 Update copyright, authors.
Backported from 308f2cb8ea
2022-09-10 20:39:11 +02:00
François Revol
9a710fe17f display: fix logging 2022-09-10 20:39:11 +02:00
François Revol
568de329ef Move X11 font stuff to display-x11 2022-09-10 20:39:11 +02:00
François Revol
281097a2a5 move X11 stuff from conky.cc to display-x11
Still some things to sort out, but seems to work.

A lot of variables and calls had to be made non-static.
2022-09-10 20:39:11 +02:00
François Revol
e97be17f7f move file output to a separate display-file 2022-09-10 20:39:11 +02:00
François Revol
5c389ecdb5 add display accessors
we want to be able to access either all outputs, or the currently
selected one (if any, else return the top one, which ought to be the GUI
one if we have one).
2022-09-10 20:39:11 +02:00
François Revol
1c5198bccd proper console display (move code out of conky.cc) 2022-09-10 20:39:11 +02:00
François Revol
e4b05557fa display-*: return void for most calls as return-value is useless 2022-09-10 20:39:11 +02:00
François Revol
fd683ee8ce display-*: Fix copyright 2022-09-10 20:39:11 +02:00
François Revol
4ffd09be1e Replace BUILD_X11 ifdef by BUILD_GUI when it makes sense 2022-09-10 20:39:11 +02:00
François Revol
c965ea7d00 http display: use lower priority than graphical displays 2022-09-10 20:39:11 +02:00
François Revol
f30263c2fc Initial ncurses display-output
Some leftovers still, but it still works.
2022-09-10 20:39:11 +02:00
François Revol
a4f9474de1 Add a display-output flag to tell if it's graphical-based
or text-only.
2022-09-10 20:39:11 +02:00
François Revol
2074dabdaf Make sure the console output isn't enabled along with ncurses 2022-09-10 20:39:11 +02:00
François Revol
ef957bfb91 Actually allow more than one display-output at once
We already do this like with HTTP+stdout.
2022-09-10 20:39:11 +02:00
François Revol
7c8d486b9f Move HTTP output code from conky.cc to display-http 2022-09-10 20:39:11 +02:00
François Revol
17ceb82079 Initial stubbing of display backends
Hopefully this will lead the way to adding support for things like
Wayland and Haiku graphics, cf. #56.

We define a display_output_base class that display backends
can derive from to implement display-specific calls.
2022-09-10 20:39:11 +02:00
François Revol
bc0b79f032 Make out_to_stderr setting non-static 2022-09-10 20:39:11 +02:00
Petr Vaněk
b357b370c6 Correct dependencies on generated header files
This change corrects dependencies on generated defconfig.h and/or
convertconf.h header files because they must be generated before
compilation of conky.cc and main.cc if BUILD_BUILTIN_CONFIG and/or
BUILD_OLD_CONFIG are set.

Fixes: https://github.com/brndnmtthws/conky/issues/1118
2022-09-10 13:14:13 -04:00
Miroslav Lichvar
a6f955cbf4 Include hsv_gradient.h even if BUILTIN_CONFIG is disabled. 2022-08-26 10:34:28 -04:00
Steven Xu
54e40520ae feat: make gw_iface work with downspeed & upspeed, e.g. ${downspeed ${gw_iface}}
The previous code was buggy as it didn't call `update_gateway_info()`, so it displayed 0 bytes for the speeds.
2022-08-26 10:22:37 -04:00
Steven Xu
0498e6a433 feat: make gw_iface work with downspeedgraph & upspeedgraph, e.g. ${downspeedgraph ${gw_iface}} 2022-08-26 10:22:37 -04:00
Petr Vaněk
f90f6325b9 Avoid out-of-bounds write in graph_append function
Retrieve graph only when s->graph is already allocated, which also mens
that the s->graph_width is bigger than 0, and thus avoid out-of-bounds
write in graph_append function.

Prior to 594d0c85ba ("Fix bug of "Graph reset when using conditional
color"") s->graph was not (re)allocated when s->graph_width and
s->graph_allocated were equal to zero, therefore, s->graph stayed equal
to nullptr. This effectively meant that graph_append function returned
immediately after call and did nothing.

This behavior changed with introduction of std::map<int, double *> graphs,
because its retrieve_graph support function allocates s->graph even for
s->graph_width equal to 0. Then, subsequent call of graph_append can
continue and the first element of the graph is set later in this
function in line:

  graph->graph[0] = f; /* add new data */

causing out-of-bounds write, as there is not enough space in array of
zero length. This write messes up internal data of memory allocator (at
least in musl libc case) and the application later segfaults in attempt
to free this memory in store_graph function.

Fixes: 594d0c85ba ("Fix bug of "Graph reset when using conditional color"")
2022-08-26 10:21:13 -04:00
Petr Vaněk
18d5aebc46 Access graph id through g->id
struct graph * is already available through g variable, let's use it
directly.
2022-08-26 10:21:13 -04:00
Marius Feraru
5a674449b4 add units_spacer option for tuning string between values and units 2021-04-26 09:48:46 -05:00
Brenden Matthews
7fb40fb5f2 Revert "fix: update update last_update_time earlier, so the network speed is correctly displayed, otherwise the speed shown is much lower than the actual speed (resolves #863)"
This reverts commit 415c730133.
2021-04-25 09:00:29 -05:00
Brenden Matthews
da2ddb00ed Partially revert change from c352069b31.
It's not quite clear to me what the intent was here, but I don't believe
this change was correct. We shouldn't block on callbacks within the main
loop.

This fixes #901.
2021-04-25 09:00:29 -05:00
Rogier Reerink
df11925db3 Added support for Intel backlight. 2021-04-22 10:06:36 -05:00
Brenden Matthews
23a4936835 Add a legacymem variable for free compat.
It seems there is some confusion between the way Conky reports free
memory, versus other programs. I'm adding a new variable, `legacymem`,
to provide the same value that is reported on older programs that don't
report memory the way recommended by newer kernels.

For more details, see:
 * https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=34e431b0ae398fc54ea69ff85ec700722c9da773
 * https://github.com/brndnmtthws/conky/pull/859
 * https://github.com/brndnmtthws/conky/pull/1028
 * https://github.com/brndnmtthws/conky/issues/1090

This resolves #1090.
2021-04-22 10:03:43 -05:00
Brenden Matthews
a971046819
Roll back change from 91a3f2ed87.
While made in earnest, I think this change was incorrect and actually
caused a regression.

Thanks to ChrisCheney for communicating this in a way that my small ape
brain could understand.

This resolves issue #1090.
2021-04-22 08:37:34 -05:00
Brenden Matthews
9970c07aeb
Fix XGetDefault DPI handling.
XGetDefault doesn't always return a value, check that it returns
something before assuming it's valid.

This fixes #1088.
2021-04-20 08:13:24 -05:00
Brenden Matthews
d966e8522a
Run clang-format. 2021-04-18 11:45:29 -05:00
Zhaf
78f46d5e6b Add ClassName hint to own window even when the Override_redirect is true 2021-04-18 11:10:37 -05:00
Brenden Matthews
8860053985
Save this file before committing. 2021-04-18 11:07:22 -05:00
Brenden Matthews
eeca044d09
Relocate this var. 2021-04-18 11:05:28 -05:00
Brenden Matthews
ca3574436b
Minor build fix, but do it right. 2021-04-18 11:02:19 -05:00
Brenden Matthews
cc092014a3
Minor build fix. 2021-04-18 10:57:20 -05:00
Livanh
3be1320e6c Use xft_dpi_scale function instead of DPI_SCALE macro 2021-04-10 11:32:24 -05:00
Livanh
1c6c4bcf6a Scale UI elements according to Xft.dpi 2021-04-10 11:32:24 -05:00
Steven Xu
415c730133 fix: update update last_update_time earlier, so the network speed is correctly displayed, otherwise the speed shown is much lower than the actual speed (resolves #863) 2021-03-24 10:10:17 -05:00
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