1
0
mirror of https://github.com/Llewellynvdm/conky.git synced 2024-10-02 15:09:07 +00:00
Commit Graph

317 Commits

Author SHA1 Message Date
Pavel Labath
54630eb39e Header housekeeping: remove unneeded extern "C", add modelines, add inclusion guards
hopefully, this doesn't break anything
2010-02-25 21:50:50 +01:00
Nikolas Garofil
e7ed9a5060 Revert "Use "using namespace std;" and remove all std::'s"
This reverts commit 41e80b9833.
2010-02-24 20:10:26 +01:00
Nikolas Garofil
41e80b9833 Use "using namespace std;" and remove all std::'s
I'm doing this because otherwise i'll will forget to add all those
std::'s and will lose a LOT of time finding the problems.
If you don't agree, undo this patch...
...but i hope you won't :)
2010-02-24 19:39:45 +01:00
Pavel Labath
c9447ddb8e Put zero in free_and_zero 2010-02-23 19:36:47 +01:00
Nikolas Garofil
45dfe4994d Use template for free_and_zero 2010-02-23 16:31:17 +01:00
Nikolas Garofil
c51972b5e2 Use free_and_zero in ccurl_common.cc where appropriate 2010-02-23 15:48:18 +01:00
Caleb Spare
c7fa36a5f2 $memwithbuffers object and bar (sf.net #2954143)
I've added $memwithbuffers to complement $mem, $memeasyfree, etc. This
variable indicates the used system memory, regardless of buffers/caches. If
the "no_buffers" option is set to "no", it will be the same as $mem. The
reason I find this change useful is that I like to display both the total
used system memory and the memory being used by applications.

I've also included a memwithbuffersbar, which is the same as membar except
that it uses $memwithbuffers as the size instead of $mem.

Signed-off-by: Pavel Labath <pavelo@centrum.sk>
2010-02-18 18:32:25 +01:00
Brenden Matthews
3e3dd16367 Update modelines and stuff. 2010-01-06 19:45:19 -08:00
Brenden Matthews
7e78f036f0 Use consistent naming for build option macros.
Probably have broken some build features with this commit.
2010-01-06 18:39:44 -08:00
Brenden Matthews
620e9876a4 C++ conversions WIP.
Currently stuck on an issue with g++ and using '%lli' with printf/scanf.
2010-01-04 19:21:12 -08:00
Brenden Matthews
d3a8c4d22e timed_thread
Convert everything (everything? maybe missed some stuff) from old
timed_thread to new timed_thread.
2010-01-04 19:21:12 -08:00
Brenden Matthews
cf9e498b24 Update copyright notices. 2010-01-01 15:46:17 -08:00
Phil Sutter
7d92e46533 include llua.h where it's really needed 2009-12-28 21:31:49 +01:00
Phil Sutter
46bd87b05e move extract_object_args_to_sub() to a more convenient place 2009-12-28 03:02:06 +01:00
Phil Sutter
0522832350 cleanup apcupsd a bit, fix some whitespace errors 2009-12-17 23:07:15 +01:00
Phil Sutter
9b66a4715b hide smapi internal functions and cleanup header 2009-12-17 22:45:00 +01:00
Brenden Matthews
b6331b4eb6 Switch some more bits to C++, more CMake changes. 2009-12-09 20:05:32 -08:00
Phil Sutter
d3aafc4a75 reenable top for all target OS's
Occurs to work fine on FreeBSD, the other BSD's probably need more work,
anyway.
2009-12-01 00:45:17 +01:00
Phil Sutter
ede0838e17 drop struct information parameter from generate_text_internal() 2009-12-01 00:32:33 +01:00
Phil Sutter
841a3814c8 convert $updates to callbacks.print 2009-12-01 00:32:32 +01:00
Phil Sutter
82d6d349ba convert user objects to callbacks.{print,free} 2009-12-01 00:32:32 +01:00
Phil Sutter
b9f1dc7283 cleanup times_in_seconds enhancement
This also adds code to unset the variable before reloading the config.
2009-11-19 23:39:08 +01:00
Nikolas Garofil
4a1be880d3 Make $user_time, $mpd_elapsed and $mpd_length compatible with times_in_seconds 2009-11-18 21:25:05 +01:00
Phil Sutter
a1ddcc0786 fix potential buffer overflow in parse_conky_vars() 2009-11-16 19:52:48 +01:00
Pavel Labath
72412c463b Rename $running_processes to $running_threads, implement real $running_processes 2009-11-15 17:55:03 +01:00
Cesare Tirabassi
0ee5e9935a Refactoring of commit 363cf1ab73
The problem with the original commit was that some session-managers set
stdin to /dev/null for the processes they launch, therefore the variable
wasn't very effective.
This commit change the variable conky_user_time to user_time.
This variable has a mandatory argument, a console identifier
(eg. tty7, pts/0, etc.).
Once called, this will list how long the user for the given console has been
logged in for.
This commit also allows multiple user_time to be specified for different
consoles, as well as correctly handle a conky restart.
2009-11-14 15:57:45 +01:00
Cesare Tirabassi
363cf1ab73 Add $conky_user_time (sf.net #2830919)
The bug reporter asks if it is possible to add a variable giving the "current
user time" only, since the variable user_times reports the times for ALL
logged users.
AFAIK, the only info one can gather inside conky, is the login time for the
tty connected to conky's standard input.
This commit adds support for it (it should work on any posix compliant *nix).
Note that in coherence with the definition, the variable is called
conky_user_time (for a single user stand-alone machine used as a desktop
this would be the "current" user time).
2009-11-13 16:30:04 +01:00
Phil Sutter
8922603b91 entropy: outsource code
This patch ought to be small and simple ...

The reason why it's not is me wanting the entropy data out of struct
information. This means update_entropy() can not be used anymore, as it
uses this globally available object.

The solution I am presenting here is quite messy regarding header
includes. Hopefully this will go away soon as I plan on creating some
sort of "OS library" containing all OS specific routines and defining
macros for easier capability checking in the non-specific code. This on
the other hand means we'll need "wrappers" around OS specific objects,
but that's not as bad as it seems - having non-specific text objects
only will definitely clean up the code, and capabilities can be checked
where they should be.
2009-11-13 00:02:16 +01:00
Nikolas Garofil
aad43bea8d Added support for $threads and fixed $processes on Linux 2009-11-07 18:14:04 +01:00
Nikolas Garofil
1ed564fd0b Revert "Added support for and fixed on Linux"
This reverts commit 43c7c0373b.
2009-11-07 18:13:21 +01:00
Nikolas Garofil
43c7c0373b Added support for and fixed on Linux 2009-11-07 18:06:07 +01:00
Phil Sutter
35ecbb3330 mail: use a private common struct mail_s instead of info.mail 2009-11-03 23:23:22 +01:00
Phil Sutter
ac99833646 text_object: use field i instead of cpu_index 2009-11-03 23:23:22 +01:00
Phil Sutter
8d1640f30b fs_*: convert to generic object payload 2009-11-03 23:23:22 +01:00
Phil Sutter
8165a91f0a nvidia: convert to generic text object payload 2009-11-03 23:23:22 +01:00
Phil Sutter
8b76d8fb60 net_stats: outsource network-related objects 2009-11-03 01:50:28 +01:00
Phil Sutter
37658b540b scroll: outsource code 2009-11-03 01:50:28 +01:00
Phil Sutter
7a168c377b exec: put all exec-related stuff into it's own file
While here, also merge the execi and texeci fields of struct
text_object, so more common code can be shared in between.
2009-11-03 01:50:28 +01:00
Phil Sutter
7fc1c801aa gw_info: move code to where it belongs 2009-11-03 01:50:28 +01:00
Phil Sutter
d1ed9c8399 fix compiling in a messy way
A cleaner but more ugly solution would be to include text_object.h in
every header containing struct text_object definitions. But this
apparently triggers a big mess, since text_object.h itself includes
custom headers. Forward defining struct text_object is obviously the
mostly simple solution until there is a bigger header include review
cleaning it all up.
2009-10-12 23:00:06 +02:00
Pavel Labath
09c0bccf55 Move vi modelines closer to the beginning, so they're more likely to be actually used. 2009-09-12 12:50:51 +02:00
Phil Sutter
e83fb84c55 update machinery: clean up
* Remove leftover INFO_* values from object definitions which didn't
  trigger anything.
* Drop the whole INFO_* enum as it's values are not used anymore.
2009-09-07 01:12:11 +02:00
Phil Sutter
e044093735 update machinery: complete transition
* Drop all need_mask alterations (no idea why there were here at all,
  but surely not sane since they are missing in the non-linux
  functions).
* Drop the update delay for update_meminfo(), as parsing /proc should
  not lead to abnormal overhead.
* Check for x_initialised from inside update_x11info(), so we can call
  it unconditionally.
2009-09-07 01:05:33 +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
Phil Sutter
12ab00cd2e move the ncurses.h include from conky.h to core.c
Fixes some namespace error with libmpdclient.c.
2009-09-04 00:08:57 +02:00
Cesare Tirabassi
75ce3b259b Fix if_running not working on linux when a top flavour is not running 2009-09-03 23:13:14 +02:00
Nikolas Garofil
bfb065502d Add global ncurses headerfile and make sure timeout in mailcode doesn't clash with timeout from ncurses 2009-08-08 03:20:47 +02:00
Nikolas Garofil
834804c265 Fix: Add header needed for read_tcp 2009-08-08 02:49:28 +02:00
Brenden Matthews
043cf686c6 Revert "Uhh..ansohus"
This reverts commit 9827726ae5.

Or this.
2009-08-07 01:24:24 -06:00
Brenden Matthews
d7838b87bf Revert "Merge branch 'master' of git.omp.am:/home/omp/git/conky"
This reverts commit d710ea8b9d, reversing
changes made to 9827726ae5.

Also didn't meant to push this.
2009-08-07 01:23:27 -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
d710ea8b9d Merge branch 'master' of git.omp.am:/home/omp/git/conky
Conflicts:
	src/conky.h
2009-08-06 14:21:50 -06:00
Nikolas Garofil
157537fc30 Fix buildproblems introduced by 3f4127080e . inet.h is used by read_tcp and timeout is renamed to prevent clashes with timeout in ncurses 2009-08-06 15:28:07 +02:00
Brenden Matthews
9827726ae5 Uhh..ansohus 2009-08-06 00:54:40 -06:00
Brenden Matthews
3f4127080e Started on breaking up conky.c.
These changes will likely result in breakage, particularly with
different features enabled/disabled.
2009-08-05 16:46:51 -06:00
Brenden Matthews
aec2ac5448 Let's try __attribute__ this time for unused vars. 2009-08-03 13:48:18 -06:00
Brenden Matthews
3b13ae971e Do the UNUSED() thing another way. 2009-08-03 13:34:47 -06:00
Brenden Matthews
581f59528b Spell 'of' correctly. 2009-08-03 12:57:22 -06:00
Brenden Matthews
efa5a211b7 Better fix for unused var problem. 2009-08-03 12:56:41 -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
Brenden Matthews
be145bd55d Removed alias config option due to brokenness.
The alias option was broken by fb8ccd7a05,
and it seems like trying to make it work again will only result in
breakage for env var substitution anyway.
2009-07-31 00:33:06 -06: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
da4b542ae6 Added some Lua API stuff.
Added conky_set_update_interval() API call, which allows you to change
Conky's update interval from a Lua script.  Added the 'conky_info' table
to global Lua context, which still needs populating with stuff (right
now it only contains the current update interval and the system uptime).
2009-07-28 12:38:43 -06:00
Brenden Matthews
d97cd93a1c Add vim modelines. 2009-07-27 14:47:31 -06:00
Nikolas Garofil
ca0f8f8712 Fix: If there is no battery then we don't care about the status 2009-07-27 13:34:20 +02:00
Brenden Matthews
9cda78c023 Clarify weather opts, refactor some weather code. 2009-07-20 13:17:44 -06: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
Cesare Tirabassi
7bbde2be73 refactored desktop info code so that its only called on X property events; TO DO doesn't work with own_window 2009-07-14 16:57:51 +02:00
Cesare Tirabassi
88ae603cf5 Add support for $desktop, $desktop_number and $desktop_name
Should work with any window manager that supports the
freedesktop.org Window Manager Specification
(see http://www.freedesktop.org/wiki/Specifications/wm-spec).

I have tested succesfully with openbox but some more testing with other
wm would be needed!

Support is built-in; if it is not acceptable to loose cpu cycles for this
at every conky refresh step than it should be conditionally compiled.
2009-07-11 10:50:02 +02:00
Brenden Matthews
2fa5f97edb A whole bunch of changes, mostly Lua related.
Improved Lua API (lua_read_parse has been removed in favour of the
conky_parse() Lua API call).  The docs have been improved to reflect the
recent Lua API stuff as well.  Introduced new Lua Cairo and Imlib2
bindings, which require the tolua++ tool.  Fixed some other
miscellaneous doc related things.
2009-07-09 22:47:41 -06:00
Nikolas Garofil
9065d1f422 Added support for swapfree 2009-07-09 20:12:52 +02:00
Cesare Tirabassi
1171ab38a5 Added support for $weather (experimental).
Download, parse and display METAR data from the NWS.

icao must be a valid icao for the required location
(see for instance https://pilotweb.nas.faa.gov/qryhtml/icao/).

data_type must be one of the following:

last_update   : display the date (yyyy/mm/dd) and time (UTC)
	        of the last update.
temperature_C : display air temperature in degree Celsius.
temperature_F : display air temperature in degree Fahrenheit.
cloud_cover   : display the highest cloud cover status.
pressure      : display air pressure in millibar.
wind_speed    : display wind speed in km/hour.
wind_dir      : display wind direction.
wind_dir_DEG  : display compass wind direction.
humidity      : display relative humidity in %.
weather       : display any relevant weather event (rain, snow, etc.).

delay_in_minutes (optional, default 30) cannot be lower than 30 min.
Up to 3 stations can be simultaneously queried.

Use --enable-weather to compile this in.
2009-07-07 00:20:12 +02:00
Pavel Labath
c0d1c313e9 Support for per-task I/O statistics - $top_io
Basically, I just added three new process properties (io_read, io_write, io_perc - representing
the amount of I/O done by the process during the update interval) and $top_io, that sorts
processes based on io_perc.

Atm, it's completely #ifdef'd, since it requires kernel support. But that creates some wierd
looking syntax at some places, so it may be better to remove some ifdefs.  It even may be
possible to completely remove the ifdefs (ie. convert them to #ifdef linux) since the code will
compile just fine even if the kernel doesn't support I/O accounting. I'll leave that for someone
else to decide.
2009-06-12 19:39:45 +02:00
Phil Sutter
26ecdcf562 Revert "Bugfix: $addr and $addrs couldn't find ip's before the first update."
This reverts commit 8ffb8b238d.

Surely, there is a better solution for that.
2009-06-06 18:14:06 +02:00
Nikolas Garofil
8ffb8b238d Bugfix: $addr and $addrs couldn't find ip's before the first update.
When you started "$updates|${addr eth0}" displayed "0|No Address",
after the first update you got something normal like "1|192.168.0.1"
This patch should fix this.
2009-06-06 17:41:51 +02:00
Nikolas Garofil
c91e2ed38e Make sure that no X11 stuff is in the binary when not requested 2009-05-31 16:48:16 +02:00
Brenden Matthews
d03df4a367 Allow ~/... and $HOME/... paths for more stuff. 2009-05-24 22:33:47 -06:00
Brenden Matthews
011e52650b Added inotify support for reloading Lua scripts automagically. 2009-05-19 22:49:42 -06:00
Brenden Matthews
6abbbd50f0 Merge branch 'lua'
Conflicts:
	src/specials.c
2009-05-17 22:00:44 -06:00
Nikolas Garofil
914af765e4 execbar can now be used in the shell even when compiled with x11 support 2009-05-17 13:38:51 +02:00
Toni Spets
a64e9f8950 Lua scripting support, initial commit 2009-05-15 21:08:51 +03:00
Jaromir Smrcek
cf2c61b588 Added support for APC UPS daemon monitoring. 2009-05-10 12:58:06 -06:00
Brenden Matthews
fde096c435 Added some completely pointless OpenMP optimizations(?) 2009-05-05 17:36:12 -06:00
Brenden Matthews
f6fe653401 Revert "Combine can now use other chars to seperate vars (used to be only space)"
This reverts commit 3dd1738fb9.
2009-05-04 13:13:51 -06:00
Nikolas Garofil
3dd1738fb9 Combine can now use other chars to seperate vars (used to be only space)
Also undid the last change because sony.h was not included, feel free to submit
it again if you include this file and other sourcefiles needed (there is also
no definition of get_sony_fanspeed). If sony systems already have this file and
a definition of this function, please update the configure file so that support
for this is disabled by default and can be enabled by sony owners.
2009-05-04 12:58:52 +02:00
Yeon-Hyeong Yang
f8a6a4035c Added Sony VAIO fanspeed info (thanks Yeon-Hyeong).
Also removed the README and man page from the repo, as they don't really
need to be there and just cause conflicts.
2009-05-03 21:23:59 -06:00
Yeon-Hyeong Yang
68ea7a7859 Added diskio_avg_samples patch (thanks Yeon-Hyeong) 2009-05-01 17:03:59 -06:00
Lassi Selander
49aee8707a Various XMMS2 updates (thanks Lassi). 2009-04-28 10:02:24 -06:00
Brenden Matthews
f05829ad9a Update copyright stuff, fix conky.conf weirdness. 2009-03-29 22:55:51 -06:00
Phil Sutter
e28f79a133 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.
2009-02-22 19:04:33 +01:00
Phil Sutter
20809f3198 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.
2009-02-22 03:00:26 +01:00
Phil Sutter
77c59b260d 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.
2009-02-22 02:58:42 +01:00
Phil Sutter
d500f1005a 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.
2009-02-22 02:58:29 +01:00
Tamim Khan
d1180b4729 XMMS2 fix and refactoring patch sf.net id #2579357 (thanks Tamim). 2009-02-17 22:29:42 -07:00
Kim Holviala
27bb931e41 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()
2009-02-17 22:00:23 -07:00
Alexander Graf
9c679bf33f Add ${top_time} sorting processes by CPU time 2009-02-07 15:01:50 +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
d744f9bfbb 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.
2008-12-16 02:56:26 +01:00