Nikolas Garofil [Sun, 15 Mar 2009 16:39:53 +0000 (17:39 +0100)]
fix use_spacer in default config (sf.net id #2638653)
Nikolas Garofil [Sun, 15 Mar 2009 16:09:35 +0000 (17:09 +0100)]
fix problems with negative numbers (sf.net id #2644593) (thanks Zhoushen Huang)
Nikolas Garofil [Sun, 15 Mar 2009 00:17:32 +0000 (01:17 +0100)]
bugfix: segfault when nothing x11-related is mentioned before TEXT
Nikolas Garofil [Sat, 7 Mar 2009 14:12:09 +0000 (15:12 +0100)]
Added alias configfile setting
This patch is written by a anonymous author, see patch on sf.net
id #2663691 . I changed it a bit so that it can't overwrite
existing environment variables and updated the docs and syntaxfiles
Phil Sutter [Sun, 1 Mar 2009 20:12:46 +0000 (21:12 +0100)]
update README and manpage
Phil Sutter [Sun, 1 Mar 2009 20:06:23 +0000 (21:06 +0100)]
fix padding of $processes
Padding to 4 digits allows for max 9999 processes, which should really
be more than enough for systems running conky. ;)
Phil Sutter [Sun, 1 Mar 2009 20:03:49 +0000 (21:03 +0100)]
fix padding in temp_print
Phil Sutter [Sun, 1 Mar 2009 19:53:47 +0000 (20:53 +0100)]
introduce percent_print() for printing percentages
Phil Sutter [Sun, 1 Mar 2009 19:24:22 +0000 (20:24 +0100)]
rewrite human_readable() to minimise padding
Also fix spaced_print(): when given a width of e.g. 3, output at least 3
characters, not 2 as it was before.
Nikolas Garofil [Sun, 1 Mar 2009 14:10:01 +0000 (15:10 +0100)]
if_updatenr added
Phil Sutter [Tue, 24 Feb 2009 23:22:31 +0000 (00:22 +0100)]
move the custom defined memrchr to the right place
And make it static, as tailhead.c is the only user of it.
Phil Sutter [Mon, 23 Feb 2009 22:28:12 +0000 (23:28 +0100)]
Phil Sutter [Sun, 22 Feb 2009 17:55:39 +0000 (18:55 +0100)]
add help text for --print-config option
While here, fix also -C for builds with --disable-x11.
Phil Sutter [Sun, 22 Feb 2009 17:35:47 +0000 (18:35 +0100)]
whitespace cleanup
Phil Sutter [Sun, 22 Feb 2009 17:21:15 +0000 (18:21 +0100)]
remove x11 dependency of fonts
Instead, we just ignore them. Less errors in output, little less
ifdef's.
Phil Sutter [Sun, 22 Feb 2009 16:53:30 +0000 (17:53 +0100)]
split off specials from conky.c
As a side effect, font and colour specific stuff got outsourced, too.
This is because the apropriate functions are used by conky.c as well as
specials.c, so they should be kept on their own.
In the long term I hope for positive impact on the X11 integration mess.
(Take e.g. the mass of X11 ifdefs cluttering conky.c.) Though this
commit contains no optimisations in this direction, just plain
outsourcing, to ensure minimised (intended: none) changes to conky's
interface behaviour.
Phil Sutter [Sun, 22 Feb 2009 16:40:45 +0000 (17:40 +0100)]
add doxygen support
Since we have no doxygen compatible code comments (we hardly have
comments at all ;) there is not much documentation to be extracted. But
this is still useful, as doxy generates us nice callgraphs showing the
internal code flow chaos. :)
Usage is as follows: after having run ./autogen.sh, doxygen can be
triggered by simply issuing 'make doxy'. This will generate a doxy
config if none exists, and preset some stuff inside (especially
parsing of undocumented stuff). Before all consecutive invocations, the
doxy config (named 'Doxyfile') can be customised to one's personal
needs.
Phil Sutter [Sun, 22 Feb 2009 02:07:14 +0000 (03:07 +0100)]
fix for building with --disable-x11
Phil Sutter [Mon, 5 Jan 2009 12:11:13 +0000 (13:11 +0100)]
merge tail and head into a single source file
This allows having the same init-function for both objects. Code size
could be further reduced, as the print-functions share some code, too.
Phil Sutter [Mon, 5 Jan 2009 00:27:07 +0000 (01:27 +0100)]
put tail and head code into separate files
In fact these two objects share a lot of code, so the bigger plan is to
merge them into a single file to share equal code.
This should not change anything to the code flow, besides making conky
startup a bit more robust due to less use of CRIT_ERR.
Phil Sutter [Sat, 3 Jan 2009 23:25:15 +0000 (00:25 +0100)]
merge ibm-acpi and smapi together
Well, not really. I don't dare putting it all together into a single
source file, as that would just not make sense. Instead, this patch
eliminates the --enable-smapi configure option and all related checks,
replacing them with the equivalents from --enable-ibm.
Phil Sutter [Sat, 3 Jan 2009 23:00:52 +0000 (00:00 +0100)]
outsource ibm-acpi stuff into it's own source file
Despite this is actually not much code and could stay inside linux.c as
well, this makes sense as I want to combine smapi and ibm-acpi
functionality. Virtually every user of a notebook made by IBM/Lenovo
will want both, so this should be a feature not a bug.
Besides making the ibm-acpi objects being built optionally, this should
not change anything to the code flow.
Phil Sutter [Thu, 25 Dec 2008 15:36:29 +0000 (16:36 +0100)]
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.
Phil Sutter [Thu, 25 Dec 2008 14:06:38 +0000 (15:06 +0100)]
fix potential segfault
The segfault can be triggered by using any diskio object with a
non-existent device, as prepare_diskio_stat() then returns 0 and the
call to obj->data.diskio->current in conky.c:4050 pulls the trigger.
In fact, it's not a problem when the device doesn't exist, as
update_diskio() simply won't fill in any values. So skip the check and
upon device node appearance everything goes it's normal way.
While there, also eliminate double readout of the last line of
/proc/diskstats: after the last line has been read, FEOF is not yet set.
BUT fgets() will return NULL when trying to read the next line. So
better check for fgets()'s return value instead of using feof().
Also strncmp() is useless here, since we really want to compare the full
paths. Besides, text_buffer_size also should be big enough to not make a
difference here.
Phil Sutter [Sat, 21 Feb 2009 23:37:15 +0000 (00:37 +0100)]
fix coding style of the last few patches
Also, note that free() does not zero the passed pointer. So conditional
freeing always needs to look like this:
| if (var) {
| free(var);
| var = 0;
| }
Brenden Matthews [Wed, 18 Feb 2009 05:50:43 +0000 (22:50 -0700)]
No space between number and units please.
Sattvik [Wed, 18 Feb 2009 05:42:08 +0000 (22:42 -0700)]
Null mpd variables should have an empty string patch sf.net id #2564747.
Tamim Khan [Wed, 18 Feb 2009 05:29:42 +0000 (22:29 -0700)]
XMMS2 fix and refactoring patch sf.net id #2579357 (thanks Tamim).
Nicolas Sierro [Wed, 18 Feb 2009 05:26:15 +0000 (22:26 -0700)]
Extended support for local Maildir patch sf.net id #2561323 (thanks Nicolas).
Martin Tůma [Wed, 18 Feb 2009 05:19:25 +0000 (22:19 -0700)]
Fix shown battery status patch.
Fix shown battery status when the battery is not charging any more but is not full charged patch sf.net id #2556056 (thanks Martin).
Carpathia [Wed, 18 Feb 2009 05:14:59 +0000 (22:14 -0700)]
Patch to clarify things in conky.conf sf.net id #2548805 (thanks Carpathia).
Alexander Monakov [Wed, 18 Feb 2009 05:10:15 +0000 (22:10 -0700)]
Fix nvidia memory frequency reading patch sf.net id #2493134.
Alexander Monakov [Wed, 18 Feb 2009 05:04:38 +0000 (22:04 -0700)]
Fix diskio_read/write patch sf.net id #2493084 (thanks Alexander).
Kim Holviala [Wed, 18 Feb 2009 05:00:23 +0000 (22:00 -0700)]
Patch by Kim Holviala sf.net id #2484548.
* change the height of execbar and execibar to be the same as other
bars have by default (6 pixels)
* treat mixer values as percentages as they're usually 0-100 (switch
to spaced_print() with pad_percents)
* change temp_print() from snprintf() to spaced_print()
* remove decimals from temp_print() as none of the current sources can
supply values smaller than 1 degree (C or F, doesn't matter)
* add a space between number and the unit in human_readable()
* fix number printing in human_readable()
* network $upspeed and $downspeed now use human_readable()
Swoög [Wed, 18 Feb 2009 04:49:45 +0000 (21:49 -0700)]
Patch to add $battery_short variable.
Brenden Matthews [Wed, 18 Feb 2009 04:45:06 +0000 (21:45 -0700)]
Misc compilation fixes.
Nikolas Garofil [Sat, 14 Feb 2009 12:03:11 +0000 (13:03 +0100)]
out_to_x can now be turned off
Nikolas Garofil [Thu, 12 Feb 2009 22:04:39 +0000 (23:04 +0100)]
docs and syntax for overwrite_file and append_file
Nikolas Garofil [Thu, 12 Feb 2009 21:45:18 +0000 (22:45 +0100)]
append_file output method
Nikolas Garofil [Thu, 12 Feb 2009 21:35:00 +0000 (22:35 +0100)]
overwrite_file output method
Nikolas Garofil [Tue, 10 Feb 2009 08:43:20 +0000 (09:43 +0100)]
Added output_to_stderr
Brenden Matthews [Mon, 9 Feb 2009 19:36:10 +0000 (12:36 -0700)]
Fix my last 'fix'.
Brenden Matthews [Sun, 8 Feb 2009 17:29:49 +0000 (10:29 -0700)]
Fix warning on older versions of gcc.
Brenden Matthews [Sun, 8 Feb 2009 17:13:54 +0000 (10:13 -0700)]
Couple fixes for the top_time stuff.
Alexander Graf [Sun, 8 Feb 2009 16:19:10 +0000 (17:19 +0100)]
better combine top, top_mem and top_time handlers
Alexander Graf [Sun, 8 Feb 2009 15:16:12 +0000 (16:16 +0100)]
Also free process list when ${top_time} is used
Alexander Graf [Sun, 8 Feb 2009 15:13:45 +0000 (16:13 +0100)]
top.c: Allow heavier optimization
This makes it possible for the compiler to do better optimizations by
adding "static" to functions which do not need to be exported.
Since some of them (e.g. the compare_*() functions) are called very
often, this may decrease conky's need of resources a bit.
Alexander Graf [Sun, 8 Feb 2009 15:05:42 +0000 (16:05 +0100)]
Don't do unneeded sp_acopy() calls
Alexander Graf [Sat, 7 Feb 2009 16:44:19 +0000 (17:44 +0100)]
Update README and conky.1
With my last patch I did only update the XML documentation file without
updating the auto-generated manpage and README file.
This patch also updates README and conky.1.
Alexander Graf [Sat, 7 Feb 2009 14:01:50 +0000 (15:01 +0100)]
Add ${top_time} sorting processes by CPU time
mipas [Tue, 23 Dec 2008 03:59:42 +0000 (20:59 -0700)]
Build fix patch
This patch fixes build errors on some platforms due to missing includes.
Phil Sutter [Mon, 22 Dec 2008 18:43:12 +0000 (19:43 +0100)]
simplify declaration of ifblock objects
Like OBJ_THREAD, OBJ_IF automatically calls obj_be_ifblock_if() when the
object matches.
Phil Sutter [Mon, 22 Dec 2008 18:31:48 +0000 (19:31 +0100)]
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.
Phil Sutter [Mon, 22 Dec 2008 17:36:44 +0000 (18:36 +0100)]
separate parsing and interpreting text objects for certain objects
All objects parsing text into objects formerly parsed and evaluated
their arguments each update interval. This does only make sense when the
parsed text could change between updates, which is the case for execp
and execpi objects, but none of the others. So have them parse the text
when creating them, so each update interval only the output has to be
re-extracted.
In fact, this should give a performance boost when using any of the
affected objects, as parsing the input text is quite expensive since
we're evaluating templates.
Phil Sutter [Mon, 22 Dec 2008 16:55:21 +0000 (17:55 +0100)]
move and add function prototypes to src/conky.c
Phil Sutter [Mon, 22 Dec 2008 16:45:08 +0000 (17:45 +0100)]
do not use a global ifblock stack
Using a global ifblock stack for all parsed ifblock objects causes
problems when doing sub-parsing in objects taking other objects as
parameters, because the possibly non-empty stack at startup leads to
false alarm when checking for stack emptiness after parsing the objects.
Use a void ** as the object to pass around, so callers don't need to
know struct ifblock_stack_obj.
Phil Sutter [Sat, 20 Dec 2008 01:32:45 +0000 (02:32 +0100)]
treat mpd opjects as non-threaded
In fact, they are. But we don't want to treat them as those, because
the rewrite made the only situation when threaded objects matter
uncritical, i.e. when an object calls calling parse_conky_vars().
Phil Sutter [Sat, 20 Dec 2008 01:31:00 +0000 (02:31 +0100)]
add if_match object comparing strings, floats and ints
In general, argument types should match, but for combined long and
double usage the long is being converted to double before evaluation.
A few examples:
${if_match ${cpu} < 30}
${if_match "asdf" != "qwer"}
${if_match 0.5 < 0.50001}
${if_match 49.999 < 50}
Phil Sutter [Thu, 18 Dec 2008 14:03:02 +0000 (15:03 +0100)]
fix segfault for diskiograph
The crux is to split args between those for scan_graph() on one hand and
prepare_diskio_stat() on the other hand. To make the code working with
minimal changes, move the yet optional devicename to the end.
General note on graphs:
- for all graphs there exist the optional arguments for scan_graph()
which come first and are optional (intended duplicate)
- all other args are object specific, and may be optional as well
Phil Sutter [Thu, 18 Dec 2008 12:37:53 +0000 (13:37 +0100)]
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.
Brenden Matthews [Thu, 18 Dec 2008 00:03:33 +0000 (17:03 -0700)]
Merge branch 'master' of git://nwl.cc/~n0-1/conky
Phil Sutter [Wed, 17 Dec 2008 01:06:34 +0000 (02:06 +0100)]
Make gateway objects also detect routes with missing RTF_GATEWAY flag
This was a bug, not a feature. From the FreeBSD manpage rtentry(9):
| Vt struct sockaddr *rt_gateway;
|
| The "target" of the route, which can either represent a destination in
| its own right (some protocols will put a link-layer address here), or
| some intermediate stop on the way to that destination (if the
| RTF_GATEWAY flag is set).
So for a default route with "dest" and "mask" both zero, either
RTF_GATEWAY is present, or "gate" is zero.
Brenden Matthews [Tue, 16 Dec 2008 04:55:48 +0000 (21:55 -0700)]
Possible fix for minor IMAP idle bug.
Brenden Matthews [Tue, 16 Dec 2008 04:18:24 +0000 (21:18 -0700)]
Update docs.
Itai Zukerman [Tue, 16 Dec 2008 04:17:56 +0000 (21:17 -0700)]
Patch to allow escaping newlines in the config.
Brenden Matthews [Tue, 16 Dec 2008 04:01:58 +0000 (21:01 -0700)]
Merge branch 'master' of git://nwl.cc/~n0-1/conky
Phil Sutter [Tue, 16 Dec 2008 02:18:35 +0000 (03:18 +0100)]
simplify human_readable
The only change of behaviour occurs when adjusting the unit of positive
values. For some reason 1000LL was used, which has now been replaced by
1024LL. Usage of abs() and MAX() might be OS dependent, but it should
not be too hard to implement them by hand if they're missing somewhere.
Phil Sutter [Tue, 16 Dec 2008 01:56:26 +0000 (02:56 +0100)]
make use_spacer an enum
It was a static int before, holding the (already defined) enum's value,
which doesn't make sense. Also it's used only inside conky.c. Since
enums can't be assigned other values than what are defined, we can skip
checking for illegal spacer value at each invocation of spaced_print,
and then also drop the function name argument, which apparently didn't
make sense at all, because use_spacer is a global option.
Phil Sutter [Tue, 16 Dec 2008 01:32:30 +0000 (02:32 +0100)]
simplify diskio stats
Instead of splitting information, use diskio_stats[0] in diskio.c for
the totals. This saves a few branches, and frees some data from struct
information.
Brenden Matthews [Tue, 16 Dec 2008 01:00:05 +0000 (18:00 -0700)]
Merge branch 'master' of git://nwl.cc/~n0-1/conky
Phil Sutter [Mon, 15 Dec 2008 21:40:24 +0000 (22:40 +0100)]
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
Phil Sutter [Mon, 15 Dec 2008 18:09:57 +0000 (19:09 +0100)]
outsource ifblock and text_object helpers
Phil Sutter [Mon, 15 Dec 2008 17:31:23 +0000 (18:31 +0100)]
put text_object stuff into an own header
For now this is only the object type enum and struct text_object, but it
will do to prepare further outsourcing from both conky.c and conky.h.
Phil Sutter [Mon, 15 Dec 2008 01:44:21 +0000 (02:44 +0100)]
organise text objects in a linked list
In fact, this eases code a lot. Even the ifblock handling, which was the
biggest problem of the rewrite, could be cleaned up a lot.
Phil Sutter [Mon, 15 Dec 2008 15:59:07 +0000 (16:59 +0100)]
have a maximum width for all variable length mpd vars
Thanks to FreakGuard (IRC) preparing this one.
Phil Sutter [Mon, 15 Dec 2008 15:54:57 +0000 (16:54 +0100)]
simplify free_text_objects a bit
Phil Sutter [Mon, 15 Dec 2008 15:39:48 +0000 (16:39 +0100)]
simplify if_existing evaluation
Brenden Matthews [Mon, 15 Dec 2008 05:42:20 +0000 (22:42 -0700)]
Merge branch 'master' of git://nwl.cc/~n0-1/conky
Conflicts:
configure.ac.in
Phil Sutter [Sun, 14 Dec 2008 16:53:31 +0000 (17:53 +0100)]
enable DEV_NAME to handle symlinks
Using a macro is not possible anymore, so have a function dev_name() do
the job. Functionality is the same as the old DEV_NAME, unless the
specified path is a symlink in which case it's being dereferenced first.
To save callers from having to free the returned string, a static local
buffer is used (effectively rendering the function non-reentrant).
Phil Sutter [Sun, 14 Dec 2008 13:36:44 +0000 (14:36 +0100)]
use the builtin config also as a default one
This depends on fopencookie, which is linux-specific. For BSD, there is
a similar function called funopen, which can be used as a drop-in
replacement.
Brenden Matthews [Sun, 14 Dec 2008 03:55:45 +0000 (20:55 -0700)]
Improve behaviour of $pb_battery.
Phil Sutter [Sun, 14 Dec 2008 03:21:46 +0000 (04:21 +0100)]
print config output support in the final stats
Brenden Matthews [Sun, 14 Dec 2008 03:16:34 +0000 (20:16 -0700)]
Build fix for config output.
Brenden Matthews [Sun, 14 Dec 2008 02:53:05 +0000 (19:53 -0700)]
Move imap/pop3 stuff into mail.c
Brenden Matthews [Sun, 14 Dec 2008 03:18:54 +0000 (20:18 -0700)]
Add text2c.sh to EXTRA_DIST.
Brenden Matthews [Sun, 14 Dec 2008 03:16:34 +0000 (20:16 -0700)]
Build fix for config output.
Phil Sutter [Sun, 14 Dec 2008 03:04:31 +0000 (04:04 +0100)]
add missing text2c for config printing support
Brenden Matthews [Sun, 14 Dec 2008 03:04:22 +0000 (20:04 -0700)]
Merge branch 'master' of git://nwl.cc/~n0-1/conky
Brenden Matthews [Sun, 14 Dec 2008 02:53:05 +0000 (19:53 -0700)]
Move imap/pop3 stuff into mail.c
Brenden Matthews [Sun, 14 Dec 2008 02:39:29 +0000 (19:39 -0700)]
Add conky.1 back into repo.
Phil Sutter [Sun, 14 Dec 2008 01:51:50 +0000 (02:51 +0100)]
fix disk_protect for linux-2.6.27
The path for the sysfs attribute has changed. Also negative values show
disabled disk protect, so catch this when interpreting the file's
content.
Phil Sutter [Fri, 12 Dec 2008 14:33:25 +0000 (15:33 +0100)]
implement sample config printing support
This patch makes Conky print a sample config when being called with the
'-C' flag.
A short test showed an increase of ~10kbytes of the conky binary's size.
Phil Sutter [Fri, 12 Dec 2008 14:32:16 +0000 (15:32 +0100)]
update the default config along with the syntax files
Phil Sutter [Tue, 9 Dec 2008 13:44:14 +0000 (14:44 +0100)]
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.
Phil Sutter [Mon, 8 Dec 2008 23:12:23 +0000 (00:12 +0100)]
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.
Phil Sutter [Mon, 8 Dec 2008 23:07:32 +0000 (00:07 +0100)]
rewrite template engine completely
Two things that pissed me off about the old one:
* only limited support for nesting templates
* totally broken output when using conditionals inside a template
The later one was the hard one to fix. ;)
It requires to already have the full text substituted before the text
objects are being created from it. Generating only the contained objects
broke, because the conditionals got wrong offsets to jump to.
After that was fixed, full nesting support is realised by simply
repeating the replacement until no more template objects are found.
Brenden Matthews [Tue, 9 Dec 2008 23:37:24 +0000 (16:37 -0700)]
Fix call to timed_thread_test().
Brenden Matthews [Tue, 9 Dec 2008 23:35:49 +0000 (16:35 -0700)]
Removing old svn keywords.
Brenden Matthews [Tue, 9 Dec 2008 23:15:06 +0000 (16:15 -0700)]
Fix broken cpu usage stuff (due to a previous commit).
Brenden Matthews [Tue, 9 Dec 2008 08:37:59 +0000 (01:37 -0700)]
Add an option to timed_thread_test() to not wait for the interval period (so that IMAP IDLE works better)