1
0
mirror of https://github.com/Llewellynvdm/conky.git synced 2024-09-30 14:09:13 +00:00
Commit Graph

90 Commits

Author SHA1 Message Date
Phil Sutter
d7c7f06aca rework the update machinery to use callbacks
Besides improving performance when updating stuff, we ideally have no
text object specific code in update_stuff() anymore (aside some
leftovers).

The macros in construct_text_object() have gotten a bit crazier than
they were before:
* using CALLBACK(&func) instead of an INFO_* parameter to OBJ() will
  make it add the given callback to the list of callbacks to be iterated
  over at each update interval.
* BEWARE: the above assumes function pointer values to be > 0!
* This implicitly fixes a bug in the code: passing 0 as INFO_* value
  led to selecting INFO_MAIL (1 << 0 == 1).
* Now it would select INFO_CPU (== 0), which got unused and therefore is
  not a problem at all (the 0 value should be unused in enums anyway).

This needs some more work, then we should be able to drop the whole
INFO_* enum. Then CALLBACK() can die again and with it goes the ugly
casting stuff done to distinguish callbacks from INFO_* values.
2009-09-07 00:36:02 +02:00
Phil Sutter
8cf8c4dac3 move the static last_*_update variables into the function 2009-09-06 21:57:19 +02:00
Phil Sutter
5a3b7c074b Rewrite hddtemp support for better scaling
Instead of connecting once for each object, have a central update
routine (limiting support to only a single hddtemp daemon to connect
to).
2009-09-06 21:53:53 +02:00
Brenden Matthews
043cf686c6 Revert "Uhh..ansohus"
This reverts commit 9827726ae5.

Or this.
2009-08-07 01:24:24 -06:00
Brenden Matthews
098e28598f Revert "auesnthaeou"
This reverts commit 70adc04fc2.

Oops, didn't mean to push this.  I'll start a new branch now (so I don't
do this again...).
2009-08-07 01:21:56 -06:00
Brenden Matthews
70adc04fc2 auesnthaeou 2009-08-06 21:56:40 -06:00
Brenden Matthews
9827726ae5 Uhh..ansohus 2009-08-06 00:54:40 -06:00
Nikolas Garofil
44b82311b9 Added support for out_to_ncurses
All ERR()'s are renamed to NORM_ERR() and box to mbox so that they don't
clash with things in ncurses.h .
Ncurses is enabled by default when building conky but can be disabled with
--disable-ncurses .
At the moment configure doesn't check if ncurses is actually available.
I'm adding support for ncurses so that we can make as much things as possible
that are only available in X11 also available in console in the future.
2009-08-01 20:45:43 +02:00
Cesare Tirabassi
81c691d15a add emacs indentation variables to source files in line with current vim settings 2009-07-28 23:44:22 +02:00
Brenden Matthews
d97cd93a1c Add vim modelines. 2009-07-27 14:47:31 -06:00
Nikolas Garofil
ccd51857c1 Let $tail and $head work with FIFOs again (was disabled by commit 41a7cffbe7 ), and fix memory bug when to_real_path is used in init_tailhead 2009-07-22 22:08:31 +02:00
Nikolas Garofil
41a7cffbe7 Fix bug with SF id 2808272 (tail and head)
To fix this bug the tail and head code was rewritten, everything should still
work except tailing a FIFO instead of a normal head.
2009-07-21 23:41:47 +02:00
Brenden Matthews
c05c157ead Overhauled RSS and weather, added $curl.
I've taken the curl stuff out of weather and RSS and moved it into it's
own entity.  It should be easier to create curl-based objects if needed
now.
2009-07-19 23:43:36 -06:00
Brenden Matthews
670e9a0eb1 Multiline alignment support, some other misc stuff.
Added support for X alignment across multi-lined objects (i.e., using
$alignr with $exec).  This may be a bit buggy.  Disabled OpenMP code
until GCC's implementation stabilizes (it's causing too many problems).
A couple Lua API changes.
2009-07-18 13:46:36 -06:00
Nikolas Garofil
06de5573e8 Fix a lot of unimportant memleaks caused by a CRIT_ERR 2009-07-16 20:28:23 +02:00
Nikolas Garofil
63a8c677b3 Show warnings when not running in X and vars like desktop or monitor are used 2009-07-16 00:31:22 +02:00
Brenden Matthews
e1011c0d13 Refactor some of the new weather code, fix docs.
I moved the weather stuff into its own thread, and also fixed up some
abuse of <simplelist> formatting throughout the docs.  Hopefully we can
keep things a little more uniform from now on.
2009-07-12 23:31:57 -06:00
Nikolas Garofil
c84d9f8b26 Fix segfault in to_real_path 2009-06-29 16:04:00 +02:00
Brenden Matthews
650c39b602 Compilation fixes, fix a segfault on shutdown.
There was a missing 'break' in a switch/case statement which caused a
segfault on shutdown when using $if_up.
2009-05-28 21:27:56 -06:00
Nikos Ntarmos
ff72a55691 No need to check for loop variable value
If the first for-loop succedds in finding the desired interface, it will return to its caller. The only way we drop to the second for-loop is if nothing is found thus far, so no need to check for (i == 16).

Signed-off-by: Nikos Ntarmos <ntarmos@cs.uoi.gr>
Signed-off-by: Brenden Matthews <brenden@rty.ca>
2009-05-28 21:27:55 -06:00
Nikos Ntarmos
a8300acbc5 free(3) previously strndup(3)'ed netstats.dev
Signed-off-by: Nikos Ntarmos <ntarmos@cs.uoi.gr>
Signed-off-by: Brenden Matthews <brenden@rty.ca>
2009-05-28 21:27:55 -06:00
Brenden Matthews
d03df4a367 Allow ~/... and $HOME/... paths for more stuff. 2009-05-24 22:33:47 -06:00
Brenden Matthews
ee9364522a Some OpenMP related fixes.
Fixes for commit 9c331dce49.
2009-05-24 14:02:33 -06:00
Joe Myre
9c331dce49 omped it up 2009-05-24 10:41:35 -05:00
Filipe Ferreira
5552f4135e Patch to fix rounding error with CPU values. 2009-05-17 23:30:10 -06:00
Jaromir Smrcek
cf2c61b588 Added support for APC UPS daemon monitoring. 2009-05-10 12:58:06 -06:00
Brenden Matthews
a301b24a8e Fix compile error. 2009-03-29 23:35:42 -06:00
Brenden Matthews
f05829ad9a Update copyright stuff, fix conky.conf weirdness. 2009-03-29 22:55:51 -06:00
Nikos Ntarmos
99a496b3ea Adding if_up support for FreeBSD.
Moved interface_up(...) from linux.{c.h} to common.{c,h} and taught it
to check for ENXIO as well to make it work on FreeBSD.

Signed-off-by: Nikos Ntarmos <ntarmos@cs.uoi.gr>
2009-03-29 01:25:57 +01:00
Phil Sutter
4161f90c6f rewrite linux diskio code
Instead of using a hardcoded maximum number of slots for
stats of different disks, use a linked list. Also since the algorithm to
update each device's counters is the same for updating the totals, share
equal code, which in my eyes not only saves a bunch of LoC, but also
drastically increases readability.
2009-02-22 02:57:11 +01:00
Phil Sutter
dd31cc77eb use a global struct moc_s
Since there is no choice of which moc player to get information from,
all moc objects' data source can be identical. Also hide some internal
data (the thread e.g.). Since from now on there can only be one moc
thread (not highlander ;), we don't need to treat the thread object
specially.

While here, fix indenting.
2008-12-22 19:36:24 +01:00
Phil Sutter
757983ab56 internal rewrite of mpd support
Handle mpd internal information inside mpd.c. Use a refcounter to check
if the mpd-information can be freed (maybe useless). Remove the now
useless "full" flag of free_text_objects.
2008-12-18 13:40:21 +01:00
Phil Sutter
9a85812e06 here comes the big header include rewrite
Some statics are now defined by configure.ac.in, conky.h got a lot
smaller, which I see as a positive sign.

This patch should not change any functionality, just change what's
defined where. Some features I did/could not test are probably broken,
also compiling for any other OS surely won't complete now. Though I
think fixing these problems is as easy as including some missing
headers.

I've done compile checks with the following configure options:
./configure --enable-eve --enable-rss --enable-smapi
	--enable-wlan --enable-debug --enable-testing

So what needs to be tested is:
- audacious
- BMPx
- xmms2
- nvidia
2008-12-15 23:12:33 +01:00
Phil Sutter
19a6e7c925 rewrite tcp-portmon hooks
Global variables belonging to tcp-portmon are now separated from
conky.c, cleaning up struct information and struct text_object a bit.
2008-12-11 15:28:21 +01:00
Phil Sutter
4b89c3b17d make semantics of custom strndup() comply with glibc
From strdup(3):
| If s is longer than n, only n characters are copied, and a
| terminating null byte ('\0') is added.

So allocate at most n+1 bytes and make sure the last one is zero, as
strncpy() doesn't add it itself.

So in fact to allow a maximum space for string dup of 23, strndup() has
to be called like this:
| dup = strndup(src, 23 - 1);

FIXME: Find the critical points in code this change touches and make
sure the invocation there is correct.
2008-12-11 15:28:21 +01:00
Brenden Matthews
dc3ed8df13 Removing old svn keywords. 2008-12-09 16:35:49 -07:00
Brenden Matthews
7de6c1d061 * Introduced (buggy) support for IMAP IDLE
* Added support for MOC (the console audio player) (thanks henux)
* Added scroll step patch (thanks asto)


git-svn-id: https://conky.svn.sourceforge.net/svnroot/conky/trunk/conky1@1252 7f574dfc-610e-0410-a909-a81674777703
2008-09-24 06:59:45 +00:00
Nikolas Garofil
312d3d6de8 Merge with conky1-extra, Changelog contains the changes
git-svn-id: https://conky.svn.sourceforge.net/svnroot/conky/trunk/conky1@1193 7f574dfc-610e-0410-a909-a81674777703
2008-06-21 20:37:58 +00:00
Kevin Lyles
bb80900ca6 Refactored format_seconds and format_seconds_short
git-svn-id: https://conky.svn.sourceforge.net/svnroot/conky/trunk/conky1@1165 7f574dfc-610e-0410-a909-a81674777703
2008-06-19 07:04:11 +00:00
Roman Bogorodskiy
00b26c0834 More or less working on FreeBSD now.
git-svn-id: https://conky.svn.sourceforge.net/svnroot/conky/trunk/conky1@1155 7f574dfc-610e-0410-a909-a81674777703
2008-06-15 07:08:52 +00:00
Kevin Lyles
610b0b628d Split conky.h into several smaller header files
In order to do this correctly:
	Removed duplicate includes
	Fixed mpd functions to accept mpd_s instead of information
	Freed mpd.h of any need to include conky.h (mpd.c still includes it for the constants)



git-svn-id: https://conky.svn.sourceforge.net/svnroot/conky/trunk/conky1@1154 7f574dfc-610e-0410-a909-a81674777703
2008-06-14 18:41:12 +00:00
Brenden Matthews
4d7ecc7951 * Getting rid of goto usage throughout code.
* Fix bug due to usage of gethostbyname() in threads (which is not
	reentrant) by using gethostbyname_r() when available.
	* Added patch for battery_time problem on 2.6.24 (thanks wedge).
	* Added patch to fix broken xmms2 stuff (thanks sleipner).
	* Added patch to fix SIGHUP/SIGUSR1 segfault (thanks norsetto).
	* Added patch to improve $if_up (thanks Aseem).


git-svn-id: https://conky.svn.sourceforge.net/svnroot/conky/trunk/conky1@1103 7f574dfc-610e-0410-a909-a81674777703
2008-04-10 22:45:45 +00:00
Brenden Matthews
77f8e9bba7 define our own strndup() when its not available (thanks to Pippijn for the idea)
git-svn-id: https://conky.svn.sourceforge.net/svnroot/conky/trunk/conky1@1101 7f574dfc-610e-0410-a909-a81674777703
2008-04-02 19:46:09 +00:00
Brenden Matthews
a6a4a4c548 * Replacing strdup() with strndup() throughout
(this is probably going to break a few things)

git-svn-id: https://conky.svn.sourceforge.net/svnroot/conky/trunk/conky1@1100 7f574dfc-610e-0410-a909-a81674777703
2008-04-02 18:44:49 +00:00
Brenden Matthews
be2cd44e6d doc cleanup
git-svn-id: https://conky.svn.sourceforge.net/svnroot/conky/trunk/conky1@1090 7f574dfc-610e-0410-a909-a81674777703
2008-03-31 04:56:39 +00:00
Phil
963bb6211c fix thread definitions
* we code against interfaces (void *f(void *))
* casting function pointers to object pointers
  is a no-no says gcc


git-svn-id: https://conky.svn.sourceforge.net/svnroot/conky/trunk/conky1@1065 7f574dfc-610e-0410-a909-a81674777703
2008-03-29 05:14:35 +00:00
Phil
fea715f038 declaring info in common.c is redundant
git-svn-id: https://conky.svn.sourceforge.net/svnroot/conky/trunk/conky1@1064 7f574dfc-610e-0410-a909-a81674777703
2008-03-29 04:55:41 +00:00
Phil
e306a2c2e8 some linting on function definitions
* instead of empty args "void" should always be specified.
  Using this, the compiler can detect incorrect function calls,
  like with update_stuff().
* No args seems to be interpreted as "unspecified args" by the
  compiler, as with update_mail_count(). So no checking for
  correctness of arguments when calling was done at all.
* This is not complete yet, as I still don't have any BSD for
  testing.


git-svn-id: https://conky.svn.sourceforge.net/svnroot/conky/trunk/conky1@1055 7f574dfc-610e-0410-a909-a81674777703
2008-03-29 02:01:03 +00:00
Phil
6a528f4e17 support displaying current nameservers
* gathers information from /etc/resolv.conf
* included (still commented) code to prevent reading too often,
  as I'm not sure whether reading from a real FS (not /proc or /sys)
  could generate higher load in some cases -> comments please!


git-svn-id: https://conky.svn.sourceforge.net/svnroot/conky/trunk/conky1@1035 7f574dfc-610e-0410-a909-a81674777703
2008-03-22 22:58:26 +00:00
Phil
8fd27c0026 make default gateway information accessible
* gw_iface prints the interface having a default gateway
* gw_ip prints the gatway's ip
* if_gw jumps if no default gateway exists
* when there are multiple gateways, gw_iface and gw_ip
  only print "multiple" when they are different (allows
  basic debugging of ones networking setup)


git-svn-id: https://conky.svn.sourceforge.net/svnroot/conky/trunk/conky1@1031 7f574dfc-610e-0410-a909-a81674777703
2008-03-22 19:06:09 +00:00