1
0
mirror of https://github.com/Llewellynvdm/conky.git synced 2024-11-16 01:57:09 +00:00
Commit Graph

3185 Commits

Author SHA1 Message Date
Natanael Copa
476f84cf59 Use portable version of strerror_r
There are 2 variants of strerror_r, GNU extension and a POSIX variant.
Use the more portable POSIX variant.

Also fix a potensial stack-use-after-return bug, instead of relying on
undefined behavoir in GNU libc implementation. The strerror_r manpage
says:

> This may be either a pointer to a string that the function stores in
> buf, or a pointer to some (immutable) static string (in which case buf
> is unused).

So it does not guarantee that it returns a pointer to some (immutable)
static string. It might return a pointer to "buf", in which case we get
a stack-use-after-return bug.

We fix this by declaring a thread local static buffer which we always
return.
2015-07-23 16:07:34 +02:00
Natanael Copa
98b063866f Remove use of sysctl.h
The sysctl.h is not specified in POSIX. This fixes building with musl
libc.
2015-07-23 16:06:42 +02:00
Natanael Copa
8711bdee8b Use posix awk instead of GNU awk
We don't use any fancy GNU awk extensions so chekc for a portable awk
instead of require GNU awk.
2015-07-23 16:05:31 +02:00
Marc Payne
11ec010561 Ensure getglobal pushes only one value onto stack
Currently, state::getglobal pushes two values onto the stack: the global
environment and the requested global. For example, if you call
getglobal("conky"), the stack ends up with the following:

| ... global, conky |

The function config_setting_base::lua_set in setting.cc does not take this
behavior into account, resulting in #97.

To correct this, call replace(-2) at the end of state::getglobal where
LUA_VERSION_NUM >= 502.
2015-07-22 17:16:26 -06:00
Marc Payne
06722e4a2a Add top_name_verbose option
Since commit 749083a, the output of ${top name <num>} contains the full
command line of each process, including arguments. While this feature can
be very useful, it changes the default behavior of Conky.

The present commit adds a new top_name_verbose option that allows the user
to toggle between basenames with no arguments (the old behavior) and full
command lines with arguments. To remain consistent with past versions of
Conky, the default value of top_name_verbose is false.

Fixes #113 (https://github.com/brndnmtthws/conky/issues/113).
2015-07-20 17:27:45 -06:00
rtoijala
f1a3542734 call get_cpu_count() when needed
get_cpu_count() is not called before trying to use cpus so conky exits with

conky: obj->data.i 1 info.cpu_count 0
conky: attempting to use more CPUs than you have!

Fixes issue #93.
2015-07-10 12:22:18 +03:00
Brenden Matthews
9ac60dcc15 Merge pull request #108 from marcpayne/noipv6-segfault-fix
Close file only if it was successfully opened
2015-07-07 15:59:10 -07:00
Brenden Matthews
2c0ef7f5e5 Merge pull request #104 from Stebalien/fix_battery
Fix battery
2015-07-07 15:58:50 -07:00
Brenden Matthews
a64a620ccf Merge pull request #96 from Vincent-C/master
Avoid clobbering CFLAGS/CXXFLAGS set by user
2015-07-07 15:58:14 -07:00
Vincent Cheng
b8082ca1fa Avoid clobbering CFLAGS/CXXFLAGS set by user 2015-07-07 01:38:12 -07:00
Marc Payne
ee08a9e1b0 Close file only if it was successfully opened
If BUILD_IPV6=ON (default), but the user has disabled ipv6 support
in the kernel using the parameter ipv6.disable=1, then conky fails
to open /proc/net/if_inet6. This leads to a segfault when conky
calls fclose(file) regardless. This fix simply moves the fclose call
into the preceding if statement.
2015-07-06 02:51:43 -06:00
Steven Allen
0aa790baac Correctly shorten unknown. 2015-07-02 11:09:50 -04:00
Steven Allen
54a5cb8cbb If we're on AC, there is no battery.
Again, no point in having two ways to say the same thing.
2015-07-02 11:09:24 -04:00
Steven Allen
8852c0083c No point in having two ways to say charged.
replace full with charged.
2015-07-02 11:02:30 -04:00
Brenden Matthews
58abe0e91d Prep for next release. 2015-06-21 17:53:16 -07:00
Brenden Matthews
8a4eb2655d Prep for 1.10.0 release. 2015-06-21 17:49:06 -07:00
Brenden Matthews
7733a6d6f3 Let's be real about the versioning. 2015-05-23 09:30:53 -07:00
Brenden Matthews
138c86449d Update README.md 2015-05-23 08:12:47 -07:00
Brenden Matthews
9c833665d8 Merge pull request #83 from troxor/disk-by-label
Fix segfault on invalid label
2015-03-09 10:41:48 -07:00
Brenden Matthews
85aca29932 Merge pull request #82 from troxor/freetype-include-path
Freetype include path
2015-03-06 16:52:37 -08:00
Troy C
9fd4090a07 Fix segfault on invalid label 2015-02-28 23:03:37 -06:00
Troy C
237fe4864b Adding nested check, due to comments in ft2build.h 2015-02-27 16:22:33 -06:00
Troy C
ac224149de Add freetype path for Ubuntu 12.04 2015-02-27 15:17:15 -06:00
Brenden Matthews
348e5e7390 Merge pull request #81 from troxor/disk-by-label
Specify diskio by device label
2015-02-25 13:23:26 -08:00
Troy C
80470556b9 Fix freetype include path 2015-02-20 19:53:03 -06:00
Troy C
34903b493f Update docs for diskio label 2015-02-19 14:23:37 -06:00
Troy C
345d62a555 Search device labels for diskio 2015-02-19 13:42:50 -06:00
Brenden Matthews
c35c8520ba Merge pull request #72 from steelman/xdg-config-path
Read configuration from ~/.config/conky/conky.conf
2014-11-21 15:08:14 -08: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
Brenden Matthews
b03d88dcf9 Merge pull request #71 from adeason/x11-bstore
Enable X11 backing store
2014-10-28 15:47:57 -07:00
Andrew Deason
b9dba46fb3 Enable X11 backing store
In our XCreateWindow call, we always set the backing_store attribute
to 'Always'. But since we never add the CWBackingStore to our value
mask, the backing_store setting always gets set to the default
NotUseful. This means that the backing store is never turned on, and
so when unobscuring the conky window, portions of the display will not
be drawn immediately if conky is blocked doing something else (e.g.
network, disk, the process is stopped), which is really annoying.

To fix this, specify the CWBackingStore flag in our value mask, so the
conky data is always visible, even if conky is blocking on some other
operation.
2014-10-25 19:34:25 -05:00
Andrew Deason
cd95b659c7 Consolidate common X11 XSetWindowAttributes flags
We always specify CWOverrideRedirect. So just assign that to flags
once, instead of assigning it to flags in four different cases.
2014-10-25 19:33:19 -05:00
Brenden Matthews
a2b5c3f3cf Merge pull request #64 from dnk/xshape
add support for x11 shape extension
2014-09-09 07:36:39 -07:00
Denis Gorodnichev
442f78119c add support for x11 shape extension
x11 shape extension (version >= 1.1) provide ability to set up input region
set up empty input region for undecorated window to create transparent window for mouse events
2014-09-09 11:12:44 +04:00
Brenden Matthews
689b404606 Merge pull request #54 from calimeroteknik/realfree
Fix size of the reported "buffers/cache" memory.
2014-07-24 08:35:50 -07:00
CTK
3e85698458 Fix size of the reported "buffers/cache" memory.
It now reports only reclaimable memory, by excluding shared memory,
and including the reclaimable part of the SLAB cache.

So '$mem' with 'no_buffers yes' is now the "really used" (unreclaimable) memory.
And when reaching OOM conditions, conky will always report high memory usage.

Related post:
http://calimeroteknik.free.fr/blag/?article20/really-used-memory-on-gnu-linux
2014-06-19 23:24:19 +02:00
Brenden Matthews
eef323eafd Merge pull request #48 from paulegan/graph-in-shell
Support for graph output on console/shell
2014-06-17 17:23:17 -07:00
Brenden Matthews
4ea42d3190 Update README.md 2014-06-17 17:22:30 -07:00
Brenden Matthews
ce605fc0b3 Update README.md 2014-06-17 17:21:56 -07:00
Nikolas Garofil
70f27ccfab Fix invalid read 2014-05-30 12:24:55 +02:00
Paul Egan
9809f7cd91 Support for graph output on console/shell 2014-05-05 21:07:55 +01:00
Brenden Matthews
3696f0ea51 Merge pull request #44 from ldx/allbattperct
Compute mean percentage for multiple batteries.
2014-03-09 13:58:10 -07:00
Vilmos Nebehaj
cda5afda69 Address PR comments.
In particular:
- Don't call get_battery_perct() recursively.
- Use define for length of string holding battery name.
- We can use strcpy() since bat is zero-terminated.
2014-03-09 21:32:15 +01:00
Vilmos Nebehaj
f39de709e3 Update docs for battery_bar and battery_percent. 2014-03-09 18:54:41 +01:00
Vilmos Nebehaj
3fb201bbc8 Use strncmp() when checking battery name. 2014-03-09 18:53:26 +01:00
Vilmos Nebehaj
ad92c60d6b Compute mean percentage for multiple batteries.
If a laptop has multiple batteries, compute the mean percentage if the
user asks for 'all' instead of a specific battery.
2014-03-09 14:03:36 +01:00
Brenden Matthews
120d6e1f94 Merge pull request #33 from eskerda/eskerda-thinklight
add support for $ibm_thinklight
2013-12-17 12:27:52 -08:00
eskerda
68263d4556 add support for $ibm_thinklight
Some IBM/Lenovo models come with a light on the top edge of the
display to illuminate the keyboard. This either reports 'on', 'off'
or 'unknown'.
2013-12-06 16:44:37 +01:00
Brenden Matthews
b5e17a4c50 Merge pull request #30 from oliverseal/master
Added cairo blending modes to support libcairo-1.10.0
2013-11-10 20:02:11 -08:00
Oliver Wilkerson
935280e36c Added cairo blending modes to support libcairo-1.10.0 2013-10-31 18:12:57 -05:00