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

2636 Commits

Author SHA1 Message Date
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