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>
Moving sysfs-related functions and defs out of common.h and into
linux.h, as sysfs exists only on Linux, and updating openbsd.c,
netbsd.c, and freebsd.c accordingly.
Signed-off-by: Nikos Ntarmos <ntarmos@cs.uoi.gr>
Typo: __LINUX__ was used in a conditional code block, while the rest of
the code uses __linux__
data: free_text_objects(...) #define's 'data' to be 'obj->data' to make
the code more compact. The linux-specific parts of the code still
used obj->data, which should expand to obj->obj->data, which is
wrong.
Signed-off-by: Nikos Ntarmos <ntarmos@cs.uoi.gr>
This object makes use of the possibility to escape dollar signs in TEXT.
Take the following example in the conkyrc:
| $${downspeed ${gw_iface}}
will be evaluated to (assuming the gw_iface is eth0):
| ${downspeed eth0}
and finally interpreted to print the gateway interface's downspeed rate.
The idea found in the code is any double dollar ($$) is being treated as
explicit dollar sign ($) instead of the start of a text object
reference. Due to missing update of the 's' variable, when creating a
text object for the text following the second dollar sign, the later was
prepended, leading to a double dollar in the output.
Use dynamic allocated memory for skey and svalue,
allocate the length of value so that there are no limits,
but don't use the %a gnu extension to maintain compatibility
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
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.
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.
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.
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.
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;
| }
* 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()