1
0
mirror of https://github.com/Llewellynvdm/conky.git synced 2024-11-17 02:25:09 +00:00
Commit Graph

2470 Commits

Author SHA1 Message Date
Ł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
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
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
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
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
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
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
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
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
Pavel Labath
02dfacd694 Add support for lua 5.2
luamm is now able to be compiled with both lua 5.1 and 5.2 (assuming 5.2 has backward
compatibility features compiled in). It is my intention to always support at least two versions
of lua.
2013-07-13 23:55:28 +02:00
Pavel Labath
0f94f409a1 Fix an some strange code found by a clang warning 2013-07-13 19:42:20 +02:00
Pavel Labath
fc84f0f6a0 Fix compilation with clang 2013-07-13 19:42:04 +02:00
Nikolas Garofil
9d36db7138 Fix warning about unused result in strerror_r() redefinition
On systems, the buildprocess will complain:
  [  7%] Building CXX object src/CMakeFiles/conky.dir/c++wrap.cc.o
  conky/src/c++wrap.cc: In function ‘std::string strerror_r(int)’:
  conky/src/c++wrap.cc:66:37: warning: ignoring return value of ‘char* strerror_r(int, char*, size_t)’, declared with attribute warn_unused_result [-Wunused-result]

According to "man 3 strerror_r" the buffer used as 2nd arg is not always used, this patch also fixes that problem.
2013-06-20 22:07:40 +02:00
Nikolas Garofil
36189de425 Fix warning about unused result of write() in priv::callback_base::stop()
On systems with a strict compiler, the buildprocess will complain:
  [ 70%] Building CXX object src/CMakeFiles/conky.dir/update-cb.cc.o
  conky/src/update-cb.cc: In member function ‘void conky::priv::callback_base::stop()’:
  conky/src/update-cb.cc:49:34: warning: ignoring return value of ‘ssize_t write(int, const void*, size_t)’, declared with attribute warn_unused_result [-Wunused-result

This patch fixes this warning (and by doing this also checks if the write worked)
2013-06-20 19:43:46 +02:00
Brenden Matthews
7a1f20847f Merge pull request #11 from rephorm/patch-1
Fix unknown short battery status
2013-05-23 17:19:59 -07:00
Brian Mattern
b08410dab4 Fix unknown short battery status
Before, in the case of an unknown battery status (which often happens on my Sony VAIO laptop after waking from sleep), the buffer would be unterminated.

(Although, this memmove trick is a bit odd. It would probably be better to remove the memmove's and put a single buffer[1] = '\0'; at the end of the function).
2013-04-30 10:33:42 -07:00
troxor
38f05de4ca Quick fix for crashes when mpd stops 2013-04-27 23:29:20 -05:00
alcazoid
749083a450 Fixed short process names in top
Conky takes process names from /proc/<pid>/stat and it's limited to 16
chars in kernel. That obviously makes top_name_width option to work only
for decreasing name length. To obtain longer names we parse
/proc/<pid>/cmdline.

Not every process has cmdline, so we take both process names and choose
one we want to use. Like this:

- Get process name from /proc/<pid>/stat

- Get process cmdline from /proc/<pid>/cmdline

- Transform cmdline to a bit simpler form(i.e. "/usr/bin/python
 /usr/bin/terminator" to "python /usr/bin/terminator"), keeping
the arguments(might be changed easily)

- Choose the one that is longer and use it
2013-04-09 16:58:15 +02:00
Brenden Matthews
318324fc63 Remove unused variable. 2013-01-29 10:59:23 -08:00
Pavel Labath
8c19f0f520 Minor fix in linux.cc 2013-01-13 13:33:32 +01:00
Stefan Huber
0e1f4526b4 diskio: Fix byte counting on dmcrypt block devices
Byte counting failes if disk is a dmcrypt block device, i.e, if
major==DM_MAJOR. Fix this.
2013-01-05 19:58:25 +01: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
5ded90e22a Fix wlan stats segfault (sf.net #3581218)
Sometimes wlan related TEXT causes segment fault, and backtrace shows it's strtok in
iw_get_stats.

I read the code of wireless_tools, which says 'strtok not thread safe, not used in WE-12 and
later' for iw_get_stats. But it need to first check if has_range and then we_version_compiled.

In conky/src/linux.cc, iw_get_stats is called before iw_get_range_info, hence has_range is always
0 in iw_get_stats and strtok is used. I simply move iw_get_range_info before iw_get_stats and no
segfault up to now.

patch by ruikai
2012-11-01 15:04:08 +01:00
Pavel Labath
cbc131ea6c Fix curl-related crashes (sf.net #3386728)
curl implements some of the timeouts using alarm(), where the alarm handler longjmp()s back into the
curl code. This is a bad idea in multi-threaded applications, since it is not guaranteed that
SIGALARM will be recieved by the correct thread. Therefore, we instruct curl to avoid using
signals.

Conflicts:

	src/ccurl_thread.c
2012-10-24 23:25:10 +02:00
Pavel Labath
5177c8d282 MPD: add mpd_albumartist (sf.net #3532376)
Adds mpd_albumartist support as an object since mpd_artist lists all participating artists of the
current song and not the main album artist.

patch by Sébastien Lavoie-Courchesne
2012-10-07 12:07:38 +02:00
Kevin Lyles
09467931d4 Fix graph auto-scaling when the width is 0 2012-10-03 22:45:13 +02: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
79636ef8dd Merge branch 'master' of git://git.omp.am/conky 2012-07-25 21:34:32 +02:00
Nikolas Garofil
19b9441704 fix if_existing bugs
- it was returning reverse results when searching strings in file
- if didn't detect that files didn't exist when searching for strings
2012-07-20 13:44:53 +02:00
Pavel Labath
8bae807f68 Add a missing include 2012-07-19 18:42:34 +02:00
Nikolas Garofil
3cca68ed3e Fix -i, -u, -x and -y option 2012-07-17 00:05:54 +02:00
Pavel Labath
b34a1a21e7 Use lround instead of std::lround
for unknown reasons DragonFly's gcc does not have lround in the std namespace
cf. sf.net #3289079
2012-07-13 20:17:54 +02:00
Magliano Andrea
abdb5582bd Proper handle missing statfs64
statfs64 ist atm linux specific; wrap statfs around it.

Also cleanup param.h and mount.h including: the assumption in fs.cc
that their presence is a sign of *BSDs is wrong, as they exist in
linux too with different meaning.

Besides presence of mount.h isn't detected in Conky.cmake, so
conditional including mount.h in fs.cc is useless. Is just works
because mount.h and param.h are included in freebsd.h and dragonfly.h
later on. They are unneded in linux.

Just remove conditional including of mount.h and param.h in fs.cc,
conditional wrap statfs64 in proper *BSD header files.
2012-07-06 15:13:59 +02:00
Pavel Labath
31c2f82842 Fall back to statfs if statfs64 not present
mostly needed for the dragonfly port (sf.net #3289079)
2012-07-05 16:41:58 +02:00
Pavel Labath
fa575171c4 Remove -D_GNU_SOURCE and do not use GNU extensions
we hope to compile on non-GNU systems as well
2012-07-01 15:05:27 +02:00
Magliano Andrea
78b1daf848 Update docs + minor changes
* document DragonFly specific $version variable
* add sample conky config file
* some dragonfly.cc code cleanup
2012-06-28 19:05:28 +02:00
Magliano Andrea
d5af1be997 Forgot the very new stuff (dragonfly.cc dragonfly.h)
this actually pertains to 24aaeb2b15e317211af7c94ffddf7b1da1493372
2012-06-28 19:05:07 +02:00
Magliano Andrea
9268165d71 Usable state reached (use top.cc + minor changes)
* process* management left to top.cc
* compile with -Wall -Werror (lots of wasted time for stupid errors)
* unify find_process() and new_process(), as used always together

Signed-off-by: Pavel Labath <pavelo@centrum.sk>
2012-06-28 19:04:31 +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
dea2c56582 Fix building on Debian GNU/kFreeBSD (sf.net #3525356) 2012-06-04 16:27:36 +02:00
Pavel Labath
1e5eba211d Fix `lua hooks are not being called' (sf.net #3501425) 2012-06-03 16:52:16 +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
Kevin Lyles
810535a386 Fix overflow in comparisons.
Fix other comparison issues (integer truncation, overflow in cpu time)

Signed-off-by: Brenden Matthews <brenden@diddyinc.com>
2012-05-03 14:08:04 -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
Brenden Matthews
cf7610cf42 Build fix for defconfig.h. 2012-03-07 13:43:26 -08:00
Brenden Matthews
19fc6e1a75 Build fix for Lua >=5.2.
See Gentoo bug at https://bugs.gentoo.org/show_bug.cgi?id=407089.
2012-03-07 13:37:41 -08:00
Pavel Labath
be4854c6bb add mpd_date function that shows date for current track (sf.net #3440445)
patch submitted by Andrey Tikhonov
2012-01-29 21:14:19 +01:00
Nikolas Garofil
6cce8e8e11 fix wrong alignments when font changes (sf.net #3461442) 2012-01-12 20:55:11 +01:00
Nikolas Garofil
59f79105bd Show "No Address" instead of "::" when there is no address 2012-01-09 11:20:53 +01:00
Nikolas Garofil
2039d6232e bugfix: $v6addr shows addresses double 2012-01-09 00:23:09 +01:00
Nikolas Garofil
7702c525a7 remove removed network devices (sf.net #3468653) 2012-01-08 15:45:08 +01:00
Pavel Labath
9df83969e7 Fix "rhost undeclared" (sf.net #3466456)
patch by Jaromír Cápík
2012-01-03 10:39:12 +01:00
Pavel Labath
09dd497314 Second part of the statfs64 patch
this also fixes the $fs_type variable.
2011-11-02 19:18:02 +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
Pavel Labath
dccf796b42 Use statfs64 for $fs_* to support very large volumes
bug reported by puppetm.
2011-11-01 16:17:15 +01:00
Brenden Matthews
b3e706aefd RFC 3501 only requires + for IMAP continuation. 2011-10-31 15:17:47 +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
4463a100ba Increase MAX_NET_INTERFACES to 64
also change a magic constant in net_stat.h to reflect the fact that it depends on
MAX_NET_INTERFACES. For more info, see sf.net #2872682 and gentoo bug #384505

ps: this should really be solved in a more need way, without the need for static arrays
2011-10-25 19:00:39 +02: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
Pavel Labath
6482283c03 Revert default value of alignment to BOTTOM_LEFT
previous default value NONE behaved strangely in combination with other default settings.
2011-10-23 22:26:15 +02:00
Pavel Labath
04a9a7f137 Fix xmms2 stream updating (sf.net #3150884)
Currently the variables related to xmms2 in conky do not update if the currently playing track
has any of its information updated (ie: the title changes). This results in incorrect behaviour
for streams where the same track is continually played but the title and artist change as new
songs are played. The attached patch corrects this issue by changing conky to respond to a
callback that fires when xmms2 media library entries are updated. After the callback fires, the
patch checks to see if the media library entry that changed corresponds to the currently playing
song and if it does updates the conky xmms2 related variables accordingly.

A different version of the patch was previously submitted and accepted into conky. Unfortunately,
this patch contained a bug that caused conky xmms2 variables to be updated when any media library
information was updated. However, the previous patch was reverted as a result of a commit the
made conky compatible with a new version of the xmms2 client api.

Patch submitted by Tamim Khan.

Signed-off-by: Pavel Labath <pavelo@centrum.sk>
2011-10-19 16:38:26 +02:00
Pavel Labath
cd9cd2151b Support IMAP responses which arrive fragmented (sf.net #3182411)
bug reported by Richard De Boer
2011-10-16 12:24:26 +02:00
Pavel Labath
8e3df58eea Ignore whitespace in parameters of $pid_* (sf.net #3423766)
This enables one to pass the output of $top to these variables. It was not possible before,
because $top pads the pids with spaces.
2011-10-15 14:27:09 +02:00
Pavel Labath
ee8a9e6b0f Don't abort when config references a non-existant hwmon file
this sort of fixes sf.net #3306538. The person there correctly tested for the existance of the
file with $if_existing, but the problem is we run the callbacks regardless of the conditional
tests.
2011-10-13 10:28:12 +02:00
Christian Brabandt
354e577b15 Cmus support added to conky 2011-10-13 09:41:53 +02:00
Pavel Labath
b1f6ac1688 Remove 'top_field' enum since it is unused 2011-10-10 22:12:05 +02:00
Pavel Labath
6c04ba542b Add uid to "top" output (sf.net #3178916)
original patch submitted by Thomas Wiegner, I added support for printing of raw uids.
2011-10-10 22:11:34 +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
Pavel Labath
ddaa48a29e Use %llu instead of %Lu in the previous commit 2011-10-02 19:29:07 +02:00
Peter Hercek
4345050a6a mem_vsize and mem_res need to be 64 bit (sf.net #3366272)
if process allocated 4GiB or more of ram then {top mem_vsize} did not report correct number

Signed-off-by: Pavel Labath <pavelo@centrum.sk>
2011-10-02 19:26:10 +02:00
Pavel Labath
3be2b41fbf fix compilation of freebsd.cc 2011-10-02 14:44:52 +02:00
Pavel Labath
ec2398ff18 c++ify linux.cc:is_disk() 2011-10-02 14:43:44 +02:00
Pavel Labath
0493ba853c Emulate O_CLOEXEC on systems that don't support it 2011-10-01 22:18:25 +02:00
Pavel Labath
b2331969d5 Fix a crash on exit when using curl
The problem was that the callback thread is destroyed only in the destructor of the callback_base
class (which is called after the destructor of the derived classes). This means that the thread
is running even when it's object is partly destroyed, which can cause segfaults, race conditions
and other nasty problems.

I've fixed it so that the thread is destroyed before the underlying object's destructor is
called.
2011-09-28 18:31:05 +02:00
Pavel Labath
6480df48f3 Revert "Fix short_units for below kilo values."
I revert this, because it breaks padding for numbers < 1000, which causes ugly text shifts when
numbers change from <1000 to >1000. If someone disagrees with this, we can talk about it in
 #conky. I asked before doing this, but noone seemed to care.

This "fixes" bug #3389641 on sf.net, reported by sakalisc.

This reverts commit c9cf08d9e9.

Conflicts:

	src/conky.cc
2011-09-18 19:16:14 +02:00
Pavel Labath
c9a306defd Use monotonic time when calculating the update interval (fixes sf.net #2970255)
when the system clock is moved backwards, the update interval would be calculated incorrectly. If
it was moved back far enough, conky would use 100% cpu. Conky now uses monotonic clock to prevent
this. If it turns out to be unsupported on some platform, an appropriate fallback can be added.

problem reported by norsetto
2011-09-17 13:12:30 +02:00
Pavel Labath
542e0c085e Support imap passwords with strange characters (sf.net #3402448)
conky now sends the password using the length + string format, which should not need any quoting
of special characters. Hopefully, we won't find a server which does not support this encoding.

This also fixes a bug which prevented the password from being entered from the console.

bug reported by Brent
2011-09-16 22:16:05 +02:00
Pavel Labath
1321a41015 Fix 'conky-1.8.1 does not build with curl-7.21.7' (sf.net #3383906)
In the new version of curl, types.h no longer exists. I just removed the offending include as
is seems to be unnecessary.

bug reported by billie80.
2011-08-01 22:40:23 +02:00
Nikolas Garofil
d59751e19f Fix a few warnings with gcc 4.4.5 2011-03-27 20:42:18 +02:00
Pavel Labath
b1eab2be0e gcc-4.5 compatibility fixes 2011-03-27 14:45:38 +02:00
Pavel Labath
17cf8517c3 Merge remote branch 'origin/master' into lua-config 2011-03-26 21:09:00 +01:00
Pavel Labath
75e147fa25 Remove timed_thread code as it is no longer used. 2011-03-26 21:04:07 +01:00
Pavel Labath
f3dfb21859 Make mpd vars use the new update system 2011-03-26 19:35:11 +01:00
Pavel Labath
ba9be3fa18 Make moc vars use the new callback system 2011-03-26 19:35:11 +01:00
Pavel Labath
ad8dfc0853 Make audacious vars use the new update system 2011-03-26 19:35:03 +01:00
Pavel Labath
06304030a2 update system: clear multiple posts in case of slow updates 2011-03-25 12:33:13 +01:00
Pavel Labath
b99c7291bc Make mail variables use the new callback system 2011-03-25 12:26:49 +01:00
Pavel Labath
367bb58dae Improvements in the update callback system
- a function for easier access to the members of the tuple
- the is_done() function
2011-03-20 16:53:15 +01:00
Pavel Labath
0eaf5edbb8 Outsource merging of two callbacks into a separate function 2011-03-15 15:13:13 +01:00
Pavel Labath
70da1c8b37 Allow xmms2_smart to display only the title (sf.net #3140371)
In the current implementation of xmms2_smart, when a song being played does not have an artist
name (as is the case with many streams) conky displays an empty space a dash followed by the
title (ex: " - Song Title"). The following patch improves this by only displaying the song title
in xmms2_smart when the song artist is empty. Moreover, the patch also fixes an issue that
existed with the previous xmms2_smart which seemed to be checking the string length of the song
title twice before outputing the url of the song. This seems like a typo and what this line
likely meant to do was check that both the song artist and song title were empty before
displaying the song url.

Patch contributed by Tamim Khan.

Signed-off-by: Pavel Labath <pavelo@centrum.sk>
2011-03-04 19:29:52 +01:00
Pavel Labath
82d563e18a gcc-4.5 compatibility fix (kinda)
(kinda = I don't know why it compiled in 4.4 in the first place)
2011-03-03 23:58:26 +01:00
Pavel Labath
3c7f2192b2 update callback objects can now signal termination with a write to a pipe as well 2011-02-27 22:43:40 +01:00
Pavel Labath
bcfc90accb C++ wrapper of pipe2(2) 2011-02-27 22:43:40 +01:00
Pavel Labath
536f719c65 exception class for c functions which set errno 2011-02-27 22:43:40 +01:00
Pavel Labath
9d6d26154a added a convenient c++ wrapper for strerror_r
as a bonus, it can be used to insulate us from the GNU vs. XSI strerror_r interface differences
2011-02-27 22:43:40 +01:00
Pavel Labath
b96f112106 Make $exec et al. use the new callback system
I removed the code for automatic killing of stuck children, because (by admission of the person
who wrote it) it wasn't working. I also removed the $pre_exec variable, because one can use lua
to generate the config on the startup, if one wants to.
2011-02-27 22:43:32 +01:00
Pavel Labath
7cf37f7de0 Make $rss use the new callback system 2011-02-16 00:33:22 +01:00
Nikolas Garofil
cb544bd1f7 Check that there is no writing outside the string 2011-02-13 00:10:20 +01:00
Nikolas Garofil
5aaac61f4e make cast unnecessary 2011-02-12 19:11:01 +01:00
Nikolas Garofil
678d79e6fe use sscanf() instead of hextobyte() 2011-02-12 18:01:41 +01:00
Nikolas Garofil
723255f142 Use inet_ntop(), thanks to pavelo for telling me about this 2011-02-12 17:18:33 +01:00
Nikolas Garofil
70b6f35a84 fix racecondition in eve, based on a patch from Vasiliy Kulikov, based on a patch from Brandon 2011-02-11 18:30:04 +01:00
Nikolas Garofil
18ce365d16 change reading args of $v6addrs and add docs 2011-02-11 15:43:01 +01:00
Nikolas Garofil
2754fab78d Support for scope in $v6addrs 2011-02-11 13:05:00 +01:00
Nikolas Garofil
997dcc87d9 fix build without ipv6 support 2011-02-11 00:27:12 +01:00
Nikolas Garofil
b548f476cc Support for -n in $v6addrs 2011-02-10 23:27:14 +01:00
Nikolas Garofil
ac4a3682ae Fix security bug in 's getSkillname 2011-02-10 16:20:06 +01:00
Nikolas Garofil
5a5e8f80b1 Support for short-version ipv6-addresses 2011-02-10 16:01:16 +01:00
Nikolas Garofil
2aafb591ee Add fscanf_no_i18n() to fix sf.net #3154556 2011-02-10 01:08:34 +01:00
Nikolas Garofil
6287b22a3d Add $v6addrs to increase IPv6 support
This is only the beginning of the ipv6 support,
This var isn't documented and only works on Linux.
It should also be patched to show the addresses in compressed format
Some other vars should also be added to see things like netmask, scope, routes, ...
2011-02-09 18:49:52 +01:00
Pavel Labath
fb81e3a9b3 Make $weather use the new callback system 2011-01-06 16:26:53 +01:00
Pavel Labath
10d7605a51 use get_result_copy() instead of get_result()
i don't seem to follow my own advice :/
2011-01-06 15:32:10 +01:00
Pavel Labath
b0deb283ec make $curl use the new callback system instead of timed_thread
ps: this breaks $rss and $weather, they need to be ported as well
2011-01-06 15:29:51 +01:00
Pavel Labath
41dc5db094 Initialize special_t when allocating it (this should fix sf.net #3138243) 2011-01-05 13:54:04 +01:00
Pavel Labath
87591f502e add a $memdirty variable
patch contributed by Piotr Karbowski (sf.net #3138195)
2011-01-04 14:48:33 +01:00
Pavel Labath
5237fe9d23 Revert "$mixer: report more reasonable values for mono devices"
the user reports this didn't fix the problem (see sf.net #3131452)

This reverts commit 540f78f0bd.
2011-01-02 14:24:10 +01:00
Pavel Labath
f0d48190ff $mixer: report more reasonable values for mono devices 2011-01-01 11:37:31 +01:00
Pavel Labath
9d0932d711 Use the new callback system instead of add_update_callback() & co. 2010-12-31 13:39:54 +01:00
Tiago Vale
c5d065d119 Added support for POWER_SUPPLY_POWER_NOW In Linux, apparently POWER_SUPPLY_CURRENT_NOW was deprecated and replaced by POWER_SUPPLY_POWER_NOW. In my system, ever since kernel 2.6.36.1 battery lifetime showed "unknown" in conky. Check http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=532000.
Signed-off-by: Pavel Labath <pavelo@centrum.sk>
2010-12-30 14:42:16 +01:00
Pavel Labath
c5fe259ae0 a new update callback system
it should replace both timed_thread and run_update_callback() systems
it features:
- automatic removal of callbacks which are not used
- ability to run callback less frequent than the update_interval
- avoidance of running the same callback multiple times
2010-12-24 15:09:40 +01:00
Pavel Labath
29ef75083a Fix 'comparison between signed and unsigned expressions' warning 2010-12-23 18:25:31 +01:00
Pavel Labath
44a30fac3d kvm_proc needs synchronized access
Signed-off-by: Nikos Ntarmos <ntarmos@cs.uoi.gr>
Signed-off-by: Pavel Labath <pavelo@centrum.sk>

Conflicts:

	src/conky.c
	src/freebsd.cc
	src/freebsd.h
2010-12-09 19:22:34 +01:00
Nikos Ntarmos
3b5d5f33b3 Build fixes for bmpx
Signed-off-by: Nikos Ntarmos <ntarmos@cs.uoi.gr>
Signed-off-by: Pavel Labath <pavelo@centrum.sk>
2010-12-09 18:46:51 +01:00
Pavel Labath
f1bc24f199 fclose(3) instead of pclose(3) as the latter seems to leak file descriptors
Signed-off-by: Nikos Ntarmos <ntarmos@cs.uoi.gr>
Signed-off-by: Pavel Labath <pavelo@centrum.sk>

Conflicts:

	src/exec.c - had to merge manually
2010-12-05 21:16:01 +01:00
Pavel Labath
43d81169f6 Use initializer list for member initialization 2010-11-26 18:03:41 +01:00
Nikolas Garofil
99c359b212 Fix displaying UTF-8 without XFT 2010-11-26 17:59:07 +01:00
Nikolas Garofil
f6a4588b3c Include default values set by cmake in print_version(), Don't set HTTPPORT when BUILD_HTTP is unset 2010-11-24 18:17:53 +01:00
Nikolas Garofil
d48e83e0d4 Bugfix: Shades weren't placed correct after a $goto 2010-11-24 16:47:29 +01:00
Nikolas Garofil
b43e130180 small rewrite print_version() 2010-11-24 00:46:29 +01:00
Pavel Labath
981ed0b609 fix own_window_colour setting name 2010-11-23 23:18:50 +01:00
Nikolas Garofil
7b128a9f16 Merge branch 'lua-config' 2010-11-23 18:56:58 +01:00
Nikolas Garofil
c93f9817cb Merge branch 'master' into lua-config 2010-11-23 18:50:48 +01:00
Nikolas Garofil
687407479f Make sure template_ in calc_cpu_total() can also be TMPL_LONGPROC 2010-11-23 18:50:40 +01:00
Pavel Labath
5aa59f55fa Make xmms2 work again (not tested yet) 2010-11-23 18:42:48 +01:00
Nikolas Garofil
1b791ed1c8 Merge branch 'master' into lua-config 2010-11-23 17:42:00 +01:00
Nikolas Garofil
23a193fe89 Complete previous commit 2010-11-23 17:40:53 +01:00
Nikolas Garofil
c1933dc186 Make sure char-arrays filled with read() are null-terminated 2010-11-23 17:33:26 +01:00
Pavel Labath
cc98b26119 Fix small error in old config handling 2010-11-23 16:45:42 +01:00
Pavel Labath
4ab7f6d0d1 Replace the if(&l) unused hack with unused attribute 2010-11-23 16:43:14 +01:00
Nikolas Garofil
5781e4f1e7 Fix build with BUILD_X11 but without OWN_WINDOW 2010-11-23 13:58:53 +01:00
Nikolas Garofil
529392aef0 Fix building without BUILD_OLD_CONFIG 2010-11-22 23:45:38 +01:00
Nikolas Garofil
c119410c78 A bit i18n 2010-11-21 23:39:35 +01:00
Pavel Labath
5a7ec7fb0b Simplify exception handling and get rid of conky::critical_error
As i said in my rant somewhere, it's up to the person catching the exception to decide if the
error is critical or not. The person throwing the exception should specify the type of error and
that's where his job ends.
2010-11-21 22:44:04 +01:00
Pavel Labath
5c49c52a0b make convert.lua "bimodal"
it does The Right Thing(tm) both when called from conky and as standalone
2010-11-21 22:26:35 +01:00
Nikolas Garofil
b5216499c2 Don't quit when configfiles are deleted 2010-11-21 16:56:50 +01:00
Nikolas Garofil
5a85fc9053 Don't quit when configfiles are deleted 2010-11-21 16:46:58 +01:00
Nikolas Garofil
b0e1c3d8a5 Remove useless try-catch 2010-11-21 15:46:42 +01:00
Nikolas Garofil
bce7064cdb Bugfix: segfault at config reload 2010-11-21 14:32:59 +01:00
Nikolas Garofil
a87c3ee205 Shrink code 2010-11-21 00:23:27 +01:00
Nikolas Garofil
199f8876fb Fix leaks that happen when there is no config available (these are only tiny leaks because conky will shutdown anyway when there is no config available) 2010-11-21 00:05:20 +01:00
Nikolas Garofil
cad18ce2e0 Fix leaks that happen when there is no config available (these are only tiny leaks because conky will shutdown anyway when there is no config available) 2010-11-20 23:35:02 +01:00
Nikolas Garofil
c63f42a693 fix manual merge 2010-11-20 17:25:06 +01:00
Nikolas Garofil
fcf318c6dd Fix bug with SF ID 3101185 (manual merge) 2010-11-20 17:18:34 +01:00
Nikolas Garofil
0ee557a4ee Fix bug with SF ID 3101185 2010-11-20 16:59:32 +01:00
Nikolas Garofil
559d4ebb53 clean up code a bit 2010-11-19 15:52:21 +01:00
Nikolas Garofil
5d28bed7db Support for old config syntax (Optional) 2010-11-19 14:27:18 +01:00
Pavel Labath
3db3e6045f Fix segfault when out_to_x is set to false 2010-11-18 16:09:36 +01:00
Nikolas Garofil
e19f1c76a9 Some errormessages 2010-11-18 00:36:36 +01:00
Pavel Labath
b7a80fa449 Fix segfault when own_window is set to false 2010-11-17 14:43:49 +01:00
Pavel Labath
8d37f8b498 Woops.. forgot to actually declare the nvidia_display setting 2010-11-17 14:36:48 +01:00
Pavel Labath
ad79c87376 Merge remote branch 'origin/master' into lua-config
Conflicts:
	src/conky.cc
2010-11-16 22:55:33 +01:00
Nikolas Garofil
8123e447e2 Replace a CRIT_ERR in combine by trying,throwing and catching
PS: I want to replace all similar CRIT_ERR's like this, opinions ?
2010-11-16 13:41:44 +01:00
Nikolas Garofil
fd9dd921a4 Extra constructor for own msg 2010-11-15 17:59:53 +01:00
Nikolas Garofil
5a41152dbb Make stuff to throw childs of runtime_error 2010-11-15 17:52:42 +01:00
Nikolas Garofil
c671226a83 print_version() usable without quiting and replace all exit()-s in conky.cc 2010-11-15 17:07:38 +01:00
Nikolas Garofil
90eda7edbf own_window and own_window_transparent should default to yes without option 2010-11-15 14:00:31 +01:00
Pavel Labath
97ac409903 Use real types instead of enums to distinguish exceptions 2010-11-15 00:24:49 +01:00
Nikolas Garofil
c2c06d0956 Fix memleak 2010-11-14 22:13:56 +01:00
Nikolas Garofil
5dd486d345 conky_error class replacing runtime_error 2010-11-14 18:19:46 +01:00
Nikolas Garofil
fbec1252a1 Merge branch 'master' into lua-config 2010-11-14 15:25:17 +01:00
Pavel Labath
17d4658242 Fix "Conky usually segfaults on config file changes" (sf.net #3100221)
Someone needs to learn the difference between passing by value and passing by reference.

Bug reported by Kevin Lyles.
2010-11-14 14:34:39 +01:00
Nikolas Garofil
b5ff3eb411 Make lua required by cmake 2010-11-14 01:41:07 +01:00
Nikolas Garofil
4ac40e6054 Fix compiling without builtin config 2010-11-14 01:25:11 +01:00
Nikolas Garofil
e73da6b72e Fix compiling without X11 support 2010-11-13 23:59:31 +01:00
Pavel Labath
c9df66f487 Merge remote branch 'origin/master' into lua-config
Conflicts:
	src/conky.cc
	src/logging.h
2010-11-13 20:17:46 +01:00
Pavel Labath
f33c65aed2 This was overkill 2010-11-13 20:11:29 +01:00
Pavel Labath
0852aa4fcd Merge remote branch 'origin/master' into lua-config
Conflicts:
	src/ccurl_thread.cc
	src/conky.cc
	src/llua.cc
	src/logging.h
	src/nvidia.cc
2010-11-13 20:05:59 +01:00
Nikolas Garofil
9d7a914515 Make I18N optional 2010-11-13 19:45:04 +01:00
Pavel Labath
375e21af07 Fix a small leak + some cleanup 2010-11-13 19:40:43 +01:00
Pavel Labath
a1f4984a4e Make conky not crash on exit when using weather objects 2010-11-13 16:36:43 +01:00
Pavel Labath
758c2ed674 Use std::min instead of the MIN macro 2010-11-12 20:08:34 +01:00
Pavel Labath
d899f603d3 Fix some obvious errors in ccurl_thread.cc
However, the whole thing still doesn't quite work for me.... It crashes on exit.
2010-11-12 20:00:24 +01:00
Pavel Labath
9a08141389 Fix the "ISO C does not permit named variadic macros" in maintainer mode
and a few other that have cropped up in the process
2010-11-12 19:48:06 +01:00
Nikolas Garofil
561e1ea75d Fix missing SCNu16 (Thanks pavelo) 2010-11-12 18:21:58 +01:00
Nikolas Garofil
e918ea4655 Let cmake check whether to build for old or new audacious 2010-11-12 16:49:34 +01:00
Nikolas Garofil
47965eedbc Fix memleak in is_disk() 2010-11-11 00:31:06 +01:00
Nikolas Garofil
1b90218c33 Let $acpitemp use /sys instead of /proc
From the 2.6.36 changelog (http://www.kernel.org/pub/linux/kernel/v2.6/ChangeLog-2.6.36):
Mark the ACPI thermal procfs I/F deprecated, because /sys/class/thermal/ is already available and has been working for years w/o any problem.
The ACPI thermal procfs I/F will be removed in 2.6.37
2010-11-10 18:22:22 +01:00
Nikolas Garofil
b902b70e96 i18n-ize conky.cc 2010-10-31 20:01:20 +01:00
Pavel Labath
c9334eb071 Make conky (more-or-less) functional again 2010-10-31 18:17:22 +01:00
Pavel Labath
104ae7454c Make setting getters/setters atomic. 2010-10-31 00:22:35 +02:00
Nikolas Garofil
b98ebc90ee Internationalization support
This patch adds i18n-support with gettext, all translatable strings in the
code should be placed inside _() to make sure users see them in their own
language (I only did this for print_version() for now)
2010-10-31 00:02:02 +02:00
Pavel Labath
214ed0ac87 Add lock/unlock functions to lua::state 2010-10-30 23:54:13 +02:00
Nikolas Garofil
be9b62f0aa Show error when creating a empty udp package fails, this also fixes a g++ warning 2010-10-30 22:53:13 +02:00
Nikolas Garofil
33db46cef1 Fix building without Imlib2 2010-10-30 17:44:33 +02:00
Nikolas Garofil
89a8456495 Fix x11 check in cmake 2010-10-27 07:37:11 +02:00
Nikolas Garofil
11e5db2132 Fix memleak when there is no config available
The 'buf' string in current_config() got allocated but not deleted when
CRIT_ERR stops the program.
2010-10-24 17:57:58 +02:00
Kevin Lyles
56ddea77a8 Fixed foreground colors being semi-transparent
Signed-off-by: Brenden Matthews <brenden@diddyinc.com>
2010-10-15 11:23:14 -07:00
Kevin Lyles
a251357f1d Fixed gradients to actually use both end colors
Signed-off-by: Brenden Matthews <brenden@diddyinc.com>
2010-10-15 11:23:08 -07:00
Brenden Matthews
ca9acc13c0 C++ify some curl stuff. 2010-10-14 17:28:57 -07:00
Dan McGee
93c6baebb6 Enable use of HTTP cache headers in curl plugin
This will allow us to get 304 responses back from remote URLs that we are
grabbing using the curl, weather, and rss plugins. The first time we fetch a
resource, we will always get the full content, but from there on out we will
store any provided 'Etag' or 'Last-Modified' header, and submit these on the
next request. If we get a 304 response back, we won't have to do any work at
all.

This benefits both us (bandwidth and parsing savings) and remote URLs (we
actually make an attempt to not retrieve the same resource over and over
again).
2010-10-14 17:04:32 -07:00
Brenden Matthews
b06af986a8 Bulid fix for nvidia support.
See http://bugs.gentoo.org/show_bug.cgi?id=339971 for details.
2010-10-06 11:53:06 -07:00
Brenden Matthews
15006a1a41 Fix warning. 2010-10-05 13:22:27 -07:00
Brenden Matthews
d64b05b648 Build fix. 2010-10-05 13:21:36 -07:00
Brenden Matthews
6437804959 Allow method to pass execgraph arguments containing spaces. 2010-10-05 12:27:03 -07:00
Ben Kibbey
5a898d373e Abort curl transfers if they drop below 1000B/s for more than 60s.
Signed-off-by: Brenden Matthews <brenden@diddyinc.com>
2010-10-05 12:09:55 -07:00
Brenden Matthews
5b0dee741c Improve curl code. 2010-10-05 11:56:08 -07:00
Markus
c9cf08d9e9 Fix short_units for below kilo values.
Signed-off-by: Brenden Matthews <brenden@diddyinc.com>
2010-10-05 11:31:31 -07:00
Pavel Labath
1c785f2ab9 Remove obsolete config-file stuff, move slowly toward making conky functional again 2010-09-15 23:37:13 +02:00
Pavel Labath
9f7e696a85 Remove the $include variable
the way it is implemented now just wont work with the new config file. And i don't think that
many people used it anyway. Maybe add a replacement later?
2010-09-15 23:34:47 +02:00
Pavel Labath
d9d8506e0b Add a luaL_gsub wrapper to lua::state 2010-09-13 13:16:16 +02:00
Pavel Labath
22de36271d Build fix in smapi.cc 2010-09-13 11:49:44 +02:00
Pavel Labath
bad23c7b77 Remove the --for-scripts hack. Maybe add it later? 2010-09-12 16:43:43 +02:00
Pavel Labath
0fd23a6f7e Set CLOEXEC flag on the inotify file descriptor 2010-09-12 16:36:21 +02:00
Pavel Labath
eeb1a6a0d7 Properly load config file and print the default one
ps: the new implementation no longer requires fopencookie() and co.
2010-09-12 16:23:06 +02:00
Pavel Labath
e935a3d107 Call curl_global_cleanup() even in case of errors 2010-09-12 15:42:20 +02:00
Pavel Labath
bee7b9b99c Bugfix in own_window setting handler 2010-09-12 15:32:05 +02:00
Pavel Labath
8cb63b0c8b Update the default config file to match new syntax 2010-09-12 15:31:18 +02:00
Pavel Labath
c5e45008df Add a luaL_loadfile wrapper to lua::state 2010-09-12 14:53:06 +02:00
Pavel Labath
55282b64d8 Config file handling changes
- changed default config filenames, to avoid conflict with conky-1.x
- specifying "-" as config file reads from stdin
- if a user config file exists but is not readable, report an error instead of falling back to
  the system-wide config.
2010-09-12 14:01:34 +02:00
Pavel Labath
4426a8fa5b The --stdin-config param is kinda pointless, just use -c /dev/stdin 2010-09-12 13:50:47 +02:00
Pavel Labath
0a655c1ff6 Merge remote branch 'origin/master' into lua-config 2010-09-11 14:52:25 +02:00
Pavel Labath
eb06bb874c curl_global_init() is not needed here (anymore) 2010-09-11 14:51:08 +02:00
Pavel Labath
ef24f62412 Merge remote branch 'origin/master' into lua-config
Conflicts:
	src/conky.cc
2010-09-11 14:50:37 +02:00
Pavel Labath
a111356ea4 Make music_player_interval a lua setting 2010-09-11 14:45:19 +02:00
Pavel Labath
47d9a63dff Make update_interval{,_on_battery} lua settings 2010-09-11 14:25:19 +02:00
Brenden Matthews
2f9195bd56 When we have a failure in mail thread, sleep for a bit. 2010-09-09 10:55:34 -07:00
Brenden Matthews
d0a20850c8 Improve failure handling in mail threads.
When we have a failure in the mail thread, lookup the hostname again in
case the failure is due odd to DNS changes, or some other madness.
2010-09-09 10:55:24 -07:00
Pavel Labath
cd5e3f8fa0 Make font and xftalpha lua settings 2010-09-08 17:30:04 +02:00
Pavel Labath
9fc5b84a32 Make pop3 and imap lua settings 2010-09-07 17:39:36 +02:00
Pavel Labath
2978965368 Make total_run_times a lua setting 2010-08-31 11:49:37 +02:00
Pavel Labath
5e6a5fdb3c htons() is not needed when using getaddrinfo (sf.net #3055612)
patch sumbitted by Ben Kibbey
2010-08-30 12:06:50 +02:00
Pavel Labath
ef2b39a97f Make text_buffer_size a lua setting 2010-08-29 23:50:32 +02:00
Pavel Labath
a9893684ac Make max_user_text a lua setting 2010-08-29 20:01:05 +02:00
Pavel Labath
6364bbd380 Make lua_{draw_hook_{pre,post},{shutdown,startup}_hook} lua settings 2010-08-29 15:56:15 +02:00
Pavel Labath
26cb39f67c Make lua_load a lua setting 2010-08-29 15:45:38 +02:00
Pavel Labath
b1891474e7 Make max_port_monitor_connections a lua setting 2010-08-29 15:19:46 +02:00
Pavel Labath
eedb5241f8 Make imlib_cache_{size,flush_interval} lua settings 2010-08-29 14:31:22 +02:00