1
0
mirror of https://github.com/Llewellynvdm/conky.git synced 2024-11-19 11:35:12 +00:00
Commit Graph

2807 Commits

Author SHA1 Message Date
Brenden Matthews
7247a4c1e6 Fix some include ordering/build stuff. 2022-12-24 10:36:31 -05:00
Brenden Matthews
76b0f049bc
Apply clang-format. 2022-12-24 09:44:03 -05:00
bi4k8
a585e36d93
wayland: permit unused parameters
the Wayland callbacks have many params that we don't use; it isn't worthwhile to individually annotate these
2022-12-24 09:42:04 -05:00
bi4k8
a6c52ee73f
wayland: clamp text width 2022-12-24 09:42:03 -05:00
bi4k8
6b0c194515
x11: do not treat init failure as fatal with Wayland 2022-12-24 09:42:03 -05:00
bi4k8
b556f17648
x11: early-return from use_xdbe_setting::set_up if X11 not initialized 2022-12-24 09:42:03 -05:00
bi4k8
1eb88aeb43
x11, imlib2: early-exit in some X functions if X is not available at runtime 2022-12-24 09:42:03 -05:00
bi4k8
a30cc64a98
x11: update x11.cc for functionality moved into gui.cc 2022-12-24 09:42:03 -05:00
bi4k8
8973b58299
gui: remove background_color from gui.cc and window_type/window_hints from gui.h 2022-12-24 09:42:03 -05:00
bi4k8
2a4f5216c1
x11, gui: update display-x11.cc to account for some code moved into gui.h/gui.cc 2022-12-24 09:42:03 -05:00
bi4k8
5859d76741
core: fix misbehavior in specials handling that fails badly with Wayland backend 2022-12-24 09:42:03 -05:00
bi4k8
d183ad3f6f
core: fix segfault when no display outputs are enabled 2022-12-24 09:42:02 -05:00
bi4k8
d856e397d7
core: fix right-alignment with wayland
I'm not sure why this is necessary (or what it might break), but it seems to work
2022-12-24 09:42:02 -05:00
bi4k8
343f4545cd
wayland: rework window destruction/resizing 2022-12-24 09:42:02 -05:00
bi4k8
0b00ff487f
wayland: respond to xdg_wm_base.ping 2022-12-24 09:42:02 -05:00
bi4k8
03d9c25491
wayland: fix crash after 5 minutes 2022-12-24 09:42:02 -05:00
bi4k8
65f4d4f7eb
colours: define manually_get_x11_color for usage outside X11 2022-12-24 09:42:02 -05:00
bi4k8
e914128c32
colours: parse X11 colors under Wayland 2022-12-24 09:42:02 -05:00
bi4k8
35b874de65
wayland: switch to zwlr_layer_shell_v1 and implement proper window placement
this vendors the wlr-layer-shell-unstable-v1 protocol XML file
2022-12-24 09:42:02 -05:00
bi4k8
4c71e4527b
wayland: implement buffer scaling 2022-12-24 09:42:01 -05:00
bi4k8
9ce6ffbb87
wl: declare desktop/monitor info functions as weak symbols
these are implemented on both Wayland and X11, as stubs on the former. we need
to properly dispatch these based on the backend, but for now this resolves the
conflict
2022-12-24 09:42:01 -05:00
bi4k8
d11742ae18
build, colours, core, gui, wayland, wl, x11: implement wayland display backend 2022-12-24 09:42:01 -05:00
Brenden Matthews
4622c0e336 Change assert in set_font to check w/ debug.
This resolves #1292.
2022-12-24 09:35:30 -05:00
Gene Carlson
4e45224c9e src/common.cc: Fix accidental whitespace change 2022-12-24 08:55:20 -05:00
Gene Carlson
14bae13f81 FreeBSD: Additional memory reporting variables. 2022-12-24 08:55:20 -05:00
bi4k8
f3ffd17007 linux: remove nonsensical ip_addr loop break cond
This checks if a pointer offset from a heap-allocated buffer is NULL,
which is only true if the buffer is NULL and the offset is zero.

It appears to be attempting to check if an entry in an array of
pointers is zero before dereferencing that entry, but the SIOCGIFCONF
ioctl actually writes `struct ifreq` entries (not pointers to them)
into the `ifc_buf` buffer.

Furthermore, because `ifc_buf` is in a union with `struct ifreq
*ifc_req`, we can simply access `ifc_req` instead of casting `ifc_buf`
each time.
2022-12-12 14:39:49 -05:00
François Revol
990c8277a5 X11 cleanup: Some more obvious BUILD_X11 -> BUILD_GUI 2022-12-09 11:23:23 -05:00
François Revol
7bbf948fc3 X11 cleanup: out_to_x -> display_output()->graphical() 2022-12-09 11:23:23 -05:00
Johannes Halaoui
de298f0d80 Add an option to disable storing graph data explicitly
This option (store_graph_data_explicitly) can be disabled to use graphs
indirectly via execpi or lua_parse. Otherwise the graph stays empty. The
default value is true to keep avoiding resets while using conditional
colors.
2022-12-07 11:28:00 -05:00
Rafał Lalik
63f3f8a526 Fix releasing of nv displays 2022-10-14 09:03:57 -04:00
Rafał Lalik
268906b957 Fix ternary operator bug with implicit true value assignment 2022-10-14 09:03:57 -04:00
Rafał Lalik
fbedabba87 Detect that nvidia display exists in each refresh 2022-10-14 09:03:57 -04:00
Brenden Matthews
b06f658ebf
Run clang-format. 2022-10-13 14:44:26 -05:00
Guido Falsi
1f661d2432 Implement get_battery_power_draw() for FreeBSD.
I'm using the acpi_battery(4) interface, via sysctl.

It should report battery draw in mW (for milli Watts), so I'm
dividing by 1000 before printing in the buffer.
2022-10-13 15:41:43 -04:00
Caio Freitas de Oliveira
8a64e4134e add special case for X11 tests 2022-10-12 21:35:35 -04:00
Caio Freitas de Oliveira
48b7271c0d use shift for masks; fix tests for 16-bit color depth 2022-10-12 21:35:35 -04:00
Caio Freitas de Oliveira
ca56109dc9 fix undeclared identifier 2022-10-12 21:35:35 -04:00
Caio Freitas de Oliveira
7833cf519b fix unused parameter 2022-10-12 21:35:35 -04:00
Caio Freitas de Oliveira
2cd895e54d fix delete abstract with non-virtual dtor 2022-10-12 21:35:35 -04:00
Caio Freitas de Oliveira
e7ac782a3c PR changes; fix saturation calculation (scale before dividing) 2022-10-12 21:35:35 -04:00
Caio Freitas de Oliveira
21dcdb0e17 remove hsv_gradient 2022-10-12 21:35:35 -04:00
Caio Freitas de Oliveira
ac7887ad09 refactor gradients to use config value instead of hard-coded option 2022-10-12 21:35:35 -04:00
Caio Freitas de Oliveira
938526755c restore tests 2022-10-12 21:35:35 -04:00
Caio Freitas de Oliveira
250739a41c restore hsv_gradient 2022-10-12 21:35:35 -04:00
Caio Freitas de Oliveira
3400324fab fix decimal conversions 2022-10-12 21:35:35 -04:00
Caio Freitas de Oliveira
033508a93e use clang-format 2022-10-12 21:35:35 -04:00
Caio Freitas de Oliveira
02ec45dc03 explicit L 2022-10-12 21:35:35 -04:00
Caio Freitas de Oliveira
3261ec4a69 use LCh color space (Rec.2020 for luma) 2022-10-12 21:35:35 -04:00
missing-semi-colon
c834e91a77 Fix diskio graph scale being 3 orders of magnitude too small 2022-10-12 13:16:34 -04:00
Brenden Matthews
1954893eaf Need to enable curl for RSS. 2022-10-12 12:57:48 -04:00
Brenden Matthews
25e6598c90 Drop unimplemented weather code.
The weather code is just stubs at the moment, so I'm dropping it as it
adds no value.
2022-10-12 12:57:48 -04:00
brightkill
731f3b41db fix bug when conky displays zero values after time 2022-10-08 14:42:54 -04:00
brightkill
3bf4f74fdd added get_battery_power_draw() stub for darwin 2022-10-08 13:21:29 -04:00
brightkill
817b7acb64 added option battery_power_draw to get power draw in watts 2022-10-08 13:21:29 -04:00
François Revol
e992f83a1d Reset selected_font after drawing shades/outline
Fixes #828.

The font wasn't reset after drawing the shades, so the text was drawn
with the last selected font as default font.
2022-10-01 23:49:52 +02:00
Gene Carlson
fc8d778435 Replace atoi and atol with strtol (most files). 2022-09-25 18:24:03 -04:00
Gene Carlson
37c68318db core.cc: Remove a redundant condition for cpugovernor. 2022-09-24 12:05:09 -04:00
Gene Carlson
9eb075d8dc Use strtol in preference to atoi for cpugovernor. 2022-09-24 12:05:09 -04:00
Gene Carlson
bebf3f2bef Linux: show the scaling governor with $cpugovernor. 2022-09-24 12:05:09 -04:00
Gene Carlson
5467287613 Linux: add a variable free_bufcache for reporting buffers+cache as reported by free. 2022-09-23 09:32:02 -04:00
Gene Carlson
be82b6f14d Linux: enable displaying shmem and memavail as variables. 2022-09-23 09:32:02 -04:00
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