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

297 Commits

Author SHA1 Message Date
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
Pavel Labath
6f62e113f1 Do not truncate non-human-readable numbers to 32bit (sf.net #3564560)
patch by hdastwb
2012-09-04 12:58:54 +02:00
Nikolas Garofil
a0052f6b19 Fix building without X11
Fix by Scott Moreau
2012-08-26 13:53:25 +02:00
Nikolas Garofil
3cca68ed3e Fix -i, -u, -x and -y option 2012-07-17 00:05:54 +02:00
Magliano Andrea
98196d0e6b Preliminary import from 2.8.1 git release
* don't use kvm_* calls, just sysctl (so no suid perm necessary)

* sysctls calls in general aren't thread safe, collapse callbacks
  using same sysctls (specifically total/running procs and proc list
  ones).

  Some sysctls need two calls (first to get size of obj returned,
  second to get object self); if different threads use this schema
  on same sysctl, weird values are returned (first/second calls
  sequence should be serialized).

  In general it makes not much sense too having more threads that use
  the same sysctl; just get info once and populate all data.

* add DragonFly specific extended uname string ($version in conky.conf)
  with git version and signature

Todo:

- top process list logic is old style, use top.cc funcs.
- find a solution for cpu freq

Signed-off-by: Pavel Labath <pavelo@centrum.sk>
2012-06-28 18:56:01 +02:00
Pavel Labath
4c1ec83174 Fix "Using log-scaled graph with show_graph_scale causes segfault" (sf.net #3538674)
bug reported by Nikslay
2012-06-28 18:26:49 +02:00
Pavel Labath
6b0d6a9f32 Fix a segfault in graph drawing code (sf.net #3537523)
PS: boy, is that code messy or what

bug reported by b3niup
2012-06-26 22:43:12 +02:00
Pavel Labath
b5dc59e9b2 Fix building with BUILD_HTTP
bug reported by arclance
2012-06-04 23:29:27 +02:00
Pavel Labath
11e32706d4 Fix `using "draw_shades yes" lua script runs twice per update' (sf.net #3524540)
bugreported by arclance
2012-06-03 16:24:37 +02:00
Brenden Matthews
ddef05d4eb Update version, copyright. 2012-05-03 16:34:44 -07:00
Jim Duchek
413ad89ecf Fixed version string
Signed-off-by: Brenden Matthews <brenden@diddyinc.com>
2012-05-03 14:06:50 -07:00
Jim Duchek
13a324a462 Remove comment
Signed-off-by: Brenden Matthews <brenden@diddyinc.com>
2012-05-03 14:06:50 -07:00
Jim Duchek
bf7248ecd6 Fixed GCC 4.7.0 issues, double buffering
Signed-off-by: Brenden Matthews <brenden@diddyinc.com>
2012-05-03 14:06:50 -07:00
Nikolas Garofil
6cce8e8e11 fix wrong alignments when font changes (sf.net #3461442) 2012-01-12 20:55:11 +01:00
Pavel Labath
3ed782c75c A slightly better fix for the double-free problem
one of those frees is completely unnecessary
2011-11-01 19:10:37 +01:00
Pavel Labath
749328456b Avoid double free on tempgrad graphs
bug reported by billie.
2011-11-01 19:06:41 +01:00
Brenden Matthews
e9a5b23711 Fix another regression from c1277d650b. 2011-10-31 15:16:54 +01:00
Brenden Matthews
e08ccb7512 Fix for regression introduced by 951cb1ac7e. 2011-10-31 13:41:30 +01:00
Pavel Labath
951cb1ac7e Fix graph updating for large (>512pix) graphs (sf.net #3253656)
apparently, this was actually a feature as someone made it deliberately act that way. However, I
agree with the bug reporter that it is strange so I remove it.
2011-10-23 22:34:51 +02:00
Christian Brabandt
354e577b15 Cmus support added to conky 2011-10-13 09:41:53 +02:00
Pavel Labath
f6b38df642 Remove SECRIT_MULTILINE_CHAR hack
Noone knows what it was supposed to do and removing it seems to fix sf.net #3411610 (and probably
a few others). If it turns out it was doing something useful, we will try to reintroduce it
without breaking other things.
2011-10-10 21:04:57 +02:00