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

317 Commits

Author SHA1 Message Date
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
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
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
c0d5b6854e conky.cc: quit on SIGHUP 2018-09-04 10:56:03 -05:00
su8
0bc7b80d78 fix missing variables when using multiple out_to_xxx (#628) 2018-08-20 08:32:42 -04: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
su8
0edc80bf9b
Arguments to character-handling functions must be representable as an unsigned char 2018-08-14 12:07:16 +00: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
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
2b3fb682aa
Merge branch 'master' into master 2018-08-06 09:03:05 -04: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
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
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
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
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
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
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
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
Daniel Pielmeier
0e82422132 Fix drawing text shades (#371) 2018-01-19 09:07:32 -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
Guido Falsi
3a00680689 FreeBSD changes (#327)
* llabs() is included in FreeBSD since FreeBSD 5.0.

Oldest supported FreeBSD version is 9.3 now.

* stdio.h needs to be explicitly included here for FreeBSD.

I can wrap it in #ifdefs if needed, but I don't think it can hurt other OSes.

* addr config variable works fine on FreeBSD.

* FreeBSD 5.x is really an ancient version and long unsupported, so I think this check for it can be dropped.

* Fix and simplify code to get battery state and charge.

* Add required include on FreeBSD.

* Add needed include on FreeBSD.

* Also populate basename to avoid printing (null) process names.

Repored by fellow FreeBSD user Szabolcs Grof.
2016-10-04 09:47:57 +02:00
Guido Falsi
2e4839e601 cur_x definition is wrapped inside #ifdef BUILD_X11, but here it is used outside of such ifdef. (#326) 2016-10-04 09:47:27 +02:00
shizeeg
178015a949 Fix build without X11 (#317) 2016-09-08 08:24:29 -07:00
roy-mustang
3b4b9abd97 Implemented goto action for ncurses mode (#299) 2016-07-20 09:53:48 -07:00
Ovnuniarchos
e2bd14e7b7 Use coordinate offsets to draw shades/outlines. Corrects behavior when GOTO-ing. (#287) 2016-07-14 09:45:06 -07:00
Stephane Fontaine
587631a15b Add native support for pulseaudio. (#283)
* Add native support for pulseaudio.

This adds ability to get Pulseaudio current volume without calling an
external program. Also it provides a few other parameters like card's
current profile similarly to pavucontrol. Currently it only queries the
default sink (and associated card).

* Switch to pulse async API.

This us by far the most efficient as conky subscribe to a few pulseaudio
notifications. Whenever pulseaudio server changes (volume or default
sink or default card), conky's callback updates the results.
2016-06-24 07:17:20 -07:00
Maximilian K
5d50e9be67 don't get stat on path after it was removed from config file (#250) 2016-05-06 07:24:52 -04:00
Nelis Oostens
2a9e21e23b Added BUILD_XINERAMA to print_version (#252)
Added BUILD_XINERAMA to the print_version output.
2016-05-06 07:24:41 -04:00
luebking
06f87b9c26 Update immediately when the root pixmap changes (#230)
* use CLOCK_MONOTONIC if supported

get_time is used to control the update interval etc. so there's
no need to query the system time

* repaint immediately when the root pixmap changed

Original patch by pweisenburger,
In addition resets the next_update_time to ensure "now"

FIXES: #48
2016-04-13 10:33:33 -07:00
Guillaume Maudoux
7d7e9b6fd8 Fix race conditions in signal handling (#233)
SIGHUP, SIGUSR1, SIGKINT and SIGTERM are no longer lost to race
    conditions. In particular, a SIGHUP can no more cancel a SIGTERM.
2016-04-13 10:33:04 -07:00
Alexander Graf
505c4286b4 keep next_update_time modulo update_interval zero
This patch modifies logic for setting next_update_time such that the
update is done at full update_interval seconds. That is, for example
with update_interval 60.0, update is done at 00:00:00, 00:01:00,
00:02:00, etc.

This might be useful for using conky as a clock widget which only needs
to be updated once per minute, but is obliged to update exactly at
minute change.

It is implemented in a way that is (hopefully) immune to clockchanges
(as for example by NTP or DST).
2016-02-08 22:41:30 +01:00
Marc Payne
57d9fdd0e0 Comment some of the callback-related code
Some of the code dealing with callbacks and updates was a little
obscure. A few extra comments should help clarify the meaning.
2016-01-09 10:23:36 -07:00
Brenden Matthews
2fab2d3820 Merge pull request #185 from mxmlnkn/issue-128
Fix BUILD_MATH flag not working, partial #128
2015-12-11 12:56:58 -08:00
mxmlnkn
e7cdccd964 Border cases of scale < 1 would lead to negative lengths, crashing conky
e.g. in the beginning the scale is always 0, leading to NaN and a crash
fixes the "show_graph_scale" not working bug, not yet reported (even though I actually noticed that before, didn't seem to bother me)
also cpugauge works again because fo this BUILD_MATH MATH problem
2015-12-11 11:10:23 +01:00
mxmlnkn
a85ffd5d0d logscale not working was caused by using MATH instead of BUILD_MATH 2015-12-11 01:39:59 +01:00
mxmlnkn
d8f75860b2 Fix for initial spike on program start plus documentation as much as needed to implement that fix
Also some end of line white spaces were automatically removed by SciTE.
2015-12-10 21:46:44 +01:00
Nelis Oostens
8bf8859c73 Added missing build flags to the print_version function
Added:
BUILD_ICAL
BUILD_ICONV
BUILD_MYSQL
BUILD_LUA_RSVG
BUILD_XSHAPE
2015-07-24 16:42:47 +00:00
Łukasz Stelmach
00481ee9a9 Read configuration from ~/.config/conky/conky.conf
Try to load configuration from ~/.config/conky/conky.conf before
falling back to ~/.conkyrc and /etc/conky/conky.conf.
2014-11-17 22:06:27 +01:00
Andrew Deason
f670e70d7c Set uninitialized inotify_fd to -1, not 0
Currently we set inotify_fd to the value 0 when inotify_fd hasn't been
created yet, or after we close it. But 0 is a valid fd, and we check
for the value -1 to see if it's been initialized. So, if inotify
support is compiled in, but we disable_auto_reload, we can end up
closing fd 0. This can screw up various other things in weird ways,
including that exec'd processes appear to have an invalid stdin.

So, set inotify_fd to -1 to clear all of this up.
2013-08-18 13:50:17 -05:00
Brenden Matthews
318324fc63 Remove unused variable. 2013-01-29 10:59:23 -08:00
Maxime Villard
622bf0cd7e Assorted fixes found by valgrind
== common.cc ==
'result' can be uninitialized.

== conky.cc ==
strcpy()'s overlap: undefined behaviour. memmove()'s one is
defined.

== eve.cc ==
Some simplifications, and there are two leaks:
1. 'mySkill' could be leaked. So, let's make 'skill' point to it instead
   of strdup()'ing the buffer.
2. 'output' could be leaked at l.390.

== freebsd.cc ==
Leak of 'freq_sysctl'.

== net_stat.cc ==
free() already null-checks, so we don't need to do it again.

== proc.cc ==
Leak.

Signed-off-by: Pavel Labath <pavelo@centrum.sk>
2012-12-26 23:22:34 +01:00