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

1673 Commits

Author SHA1 Message Date
Phil Sutter
67559fdaca moc: convert to callbacks.print and callbacks.free 2009-11-29 22:21:48 +01:00
Phil Sutter
dd8ec48fcb bmpx: convert to callbacks.print
While here, also drop those calls to memset, as the whole info object is
being zeroed at the beginning of main(). (Probably this is useful upon
config reload, too.)
2009-11-29 22:21:48 +01:00
Phil Sutter
6371551153 audacious: convert to callbacks.print 2009-11-29 22:21:48 +01:00
Phil Sutter
974d28a667 apcupsd: convert to callbacks.print 2009-11-29 22:21:48 +01:00
Phil Sutter
ac80e6f55f hddtemp: convert to callbacks.print 2009-11-29 22:21:48 +01:00
Phil Sutter
49cacbbc91 offset, align, tailhead: convert to callbacks.print 2009-11-29 22:21:48 +01:00
Phil Sutter
e0a3a82932 fs objects: convert to callbacks.print 2009-11-29 22:21:48 +01:00
Phil Sutter
18d2319d73 tcp-portmon: convert to callbacks.print 2009-11-29 22:21:48 +01:00
Phil Sutter
d0a2c51f4b font: convert scan_font to match common signature 2009-11-29 22:21:48 +01:00
Phil Sutter
9247d838c3 hddtemp: convert to callbacks.free 2009-11-29 22:21:48 +01:00
Phil Sutter
eb612dfcb0 hr, stippled_hr: convert to callbacks.print 2009-11-29 22:21:48 +01:00
Phil Sutter
4927eb85a2 goto, tab: convert to callbacks.print 2009-11-29 22:21:48 +01:00
Phil Sutter
9c8805ee7b shadecolor: convert to callbacks.print 2009-11-29 22:21:48 +01:00
Phil Sutter
f9036f58a2 outlinecolor: convert to callbacks.print 2009-11-29 22:21:48 +01:00
Phil Sutter
1a6803454c color: convert to callbacks.print 2009-11-29 22:21:48 +01:00
Phil Sutter
08122354a9 convert some special printing functions to common signature
Also add a little hack to $scroll to omit the need to call new_fg() from
inside print_scroll(). Instead of inserting a new special after printing
the scrolled text, insert a new object after the scroll object when
parsing text objects to handle the color reset.
2009-11-29 22:21:48 +01:00
Phil Sutter
2e83ff05c5 text object list: allow appending a list of objects 2009-11-29 22:21:11 +01:00
Phil Sutter
02d104cc6a free_text_objects: drop empty switch cases 2009-11-29 21:40:48 +01:00
Phil Sutter
9cf2b88242 bunch of trivial conversions to gen_free_opaque() 2009-11-29 21:40:48 +01:00
Phil Sutter
697e64272e text_object: provide generic object free routine
This is a valid replacement to a custom routine for objects using data.s
or data.opaque to point to dynamically allocated data.
2009-11-29 21:40:48 +01:00
Phil Sutter
fa3118993e huge bunch of trivial conversions to obj->callbacks 2009-11-29 21:40:38 +01:00
Phil Sutter
7b05bdd665 text_object: introduce text_object_callbacks
The callback functions are:
print - to be called from generate_text_internal()
iftest - same as print for ifblock objects (triggers jumping)
barval - same as above for bar objects (returns current bar value)
gaugeval - same as above for gauge objects
graphval - same as above for graph objects
percentage - for percentage objects, returns actual percentage
free  - called in free_text_objects()

Until conversion is complete, if the function pointer is NULL the old
lookup by type is being done.

Note that it's possible to assign both 'print' and 'iftest' callbacks.
In this case, the code simply ignores the 'iftest' callback, though this
could easily be changed (always calling DO_JUMP at last, of course) in
order to allow ifblock objects to print something in addition to jumping
somewhere (or not).
2009-11-29 21:33:30 +01:00
Phil Sutter
d989f5b34a cleanup exec.c 2009-11-29 21:28:58 +01:00
Brenden Matthews
f36f747aca Add (broken) cmake build stuff. 2009-11-26 11:25:32 -08:00
Nikolas Garofil
4652e834b1 Add support for max_text_width configuration setting 2009-11-25 16:04:49 +01:00
Nikolas Garofil
4c4770eb77 Fix: $scroll,$if_running and $apcupsd_lastxfer can now have long arguments if text_buffer_size is increased 2009-11-24 13:23:58 +01:00
Nikolas Garofil
b2987b9354 Fix: Templates only work when they end with a space or a } 2009-11-23 12:58:20 +01:00
Nikolas Garofil
fb3c59baec Fix building with --disable-x11 2009-11-22 23:05:08 +01:00
Phil Sutter
970420106c fix new_graph parameters
One should never print into buffers without knowing their size. Although
new_graph consumes only a single char, this may already be too much.
2009-11-22 21:12:54 +01:00
Phil Sutter
346b4cfbc1 move get_x11_color() to colours.c 2009-11-22 21:07:42 +01:00
Nikolas Garofil
6ee76e5c55 Fix compiling with --disable-x11 2009-11-22 14:05:11 +01:00
Phil Sutter
66df73f74a implement ASCII gauge and enable all gauge objects for use with no X 2009-11-22 02:09:46 +01:00
Phil Sutter
c2eb77c3f0 realise seamless integration of new_bar_in_shell
The decision about whether to print ASCII or X11 bar is done from within
specials.c, so all those #ifdef + if () blocks can be dropped. This also
implicitly enables the ASCII bar for some bar printing objects which where
forgotten before.
2009-11-22 02:09:46 +01:00
Nikolas Garofil
c131c1d129 Bugfix: letting XmbSetWMProperties set the windowtitle causes a memleak with some versions of Xlib 2009-11-21 23:58:02 +01:00
Nikolas Garofil
20a7f5eb72 Merge branch 'master' of ssh://git.omp.am/home/omp/git/conky 2009-11-21 15:50:35 +01:00
Nikolas Garofil
567a86f99a Fix segfault in X11-related code
Conky sometimes tries to clears part of a window before it's created,
this breaks closing the displaying. For example with this config:
TEXT
$lua
2009-11-21 15:45:00 +01:00
Phil Sutter
d7f9e64824 allow AF_INET6 in libmpdclient since mpd supports it
Thanks to Kaleb Elwert (belak, IRC) who reported the problem and tested
the fix.
2009-11-20 23:00:47 +01:00
Nikolas Garofil
b85b0d5aab Bugfix: Sx in $format_time prints out wrong values when number of seconds ends with a zero and has no numbers behind the point 2009-11-20 15:23:54 +01:00
Phil Sutter
7291184783 simplify conky_version and co. a bit 2009-11-20 00:03:15 +01:00
Phil Sutter
c8bed3a28d voltage: outsource printing code 2009-11-20 00:02:42 +01:00
Phil Sutter
b25be92273 xmms2: do 'gg=G' in vim :) 2009-11-20 00:01:47 +01:00
Phil Sutter
c439c8e7b6 mpd: outsource printing code
In order to make life a bit easier, the struct mpd_s field "volume" has
been renamed to just "vol" to match the object's name (mpd_vol).

Although format_media_player_time() is probably meant to be used by all
supported media players, it's currently being used by mpd only. So for
now this function can reside statically in mpd.c
2009-11-20 00:01:33 +01:00
Phil Sutter
87873bceeb lines, words: outsource code 2009-11-19 23:59:50 +01:00
Phil Sutter
ea22f21252 smapi: outsource printing code 2009-11-19 23:57:38 +01:00
Phil Sutter
bb35c25284 ibm: convert to common signature 2009-11-19 23:57:16 +01:00
Phil Sutter
91b0c66617 mixer: convert to common signature 2009-11-19 23:56:01 +01:00
Phil Sutter
80e41032cd {down,up}speedgraph: convert to match common signature 2009-11-19 23:52:39 +01:00
Phil Sutter
80114f3b1e diskio: convert print functions to match common signature 2009-11-19 23:51:13 +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
Phil Sutter
45a183d840 xlib: do exit() on IOError instead of abort()
The IOError happens every time I close conky's normal own window, so I
guess the situation is not as abnormal as abort() indicates. Calling
exit() instead should really suffice and give the process a chance to
clean up (by calling destructor routines for instance).
2009-11-19 23:04:09 +01:00
Phil Sutter
6f9bfe970a fix potential buffer overflow when printing top values 2009-11-19 23:04:09 +01:00
Phil Sutter
9efa384bbc lua: outsource code 2009-11-19 23:04:09 +01:00
Phil Sutter
b6d1ff6c42 i8k: outsource code 2009-11-19 23:04:09 +01:00
Nikolas Garofil
fe1d7da3d5 Add support for $pid_read and $pid_write 2009-11-19 12:32:14 +01:00
Nikolas Garofil
f8bae62234 $format_time treats ( and ) as special chars 2009-11-19 00:21:49 +01:00
Nikolas Garofil
59594e70d2 Added support for \Sx to $format_time 2009-11-19 00:04:49 +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
Nikolas Garofil
d9ad73af65 Make sure $format_time only works when times_in_seconds is enabled 2009-11-18 20:27:53 +01:00
Nikolas Garofil
8f42831a62 Add support for time_in_seconds configuration setting 2009-11-18 20:07:47 +01:00
Nikolas Garofil
4cfb042df9 Fix bug in $pid_cmdline 2009-11-18 18:02:10 +01:00
Nikolas Garofil
6046198053 Fix bug in $pid_nice, $pid_priority, $pid_time, $pid_time_kernelmode and $pid_time_usermode 2009-11-18 17:13:20 +01:00
Nikolas Garofil
0215298c27 Added support for $format_time 2009-11-18 15:35:35 +01:00
Nikolas Garofil
90f5701f3e Bugfix: crash when apcupsd isnt running 2009-11-16 20:19:57 +01:00
Phil Sutter
a1ddcc0786 fix potential buffer overflow in parse_conky_vars() 2009-11-16 19:52:48 +01:00
Phil Sutter
70e5afe5ac ifblock: fix clash with specials when freeing objects
Murphy hit me again: in my naive attempt to fix the clash between
ifblocks and objects parsing text objects due to the double use of the
'sub' field, I overlooked this problem with reusing the 'special_data'
field. So here comes the real thing (TM), donating ifblocks their own
field for pointing to the jump target.
2009-11-16 19:52:12 +01:00
Phil Sutter
44f76f4876 drop leftover freq_dynamic code in freebsd.c and openbsd.c
As the comment states, those functions were originally copied from
linux.c; in fact just the code which has been removed due to licensing
issues.
2009-11-16 19:41:06 +01:00
Pavel Labath
e97b67aa20 IPv6 support for $tcp_portmon
In theory, this may fail to compile on ancient systems that don't have IPv6 types (struct
sockaddr_in6 et al.) available. If it turns out that such systems are still in use, the best way
to solve it would be to provide dummy declarations via configure tests.
2009-11-16 18:17:16 +01:00
Nikolas Garofil
84d6095c40 Use seconds instead of centiseconds as unit for $pid_time_kernelmode, $pid_time_usermode and $pid_time 2009-11-16 16:59:41 +01:00
Nikolas Garofil
7b05f78de8 Added support for $pid_time_usermode, $pid_time_kernelmode and $pid_time 2009-11-16 15:30:57 +01:00
Nikolas Garofil
015d275098 Add support for $pid_nice and $pid_priority 2009-11-16 15:01:43 +01:00
Nikolas Garofil
f93aa2a68d Added support for $pid_threads and $pid_thread_list 2009-11-16 09:54:17 +01:00
Nikolas Garofil
f3e250df55 Bugfix: make sure $else works correct and without memleaks 2009-11-16 08:39:05 +01:00
Nikolas Garofil
5eebf1c516 Fix invalid free for all $if_-vars 2009-11-16 00:21:49 +01:00
Nikolas Garofil
f0211cd43d fix invalid free in if_up 2009-11-15 23:45:33 +01:00
Pavel Labath
ec879680d2 Forgot to set top_running when $running_processes is used 2009-11-15 23:00:14 +01:00
Nikolas Garofil
2ed76a345f Added support for $pid_vmpeak, $pid_vmsize, $pid_vmlck, $pid_vmhwm, $pid_vmrss, $pid_vmdata, $pid_vmstk, $pid_vmexe, $pid_vmlib, $pid_vmpte 2009-11-15 19:44:37 +01:00
Pavel Labath
72412c463b Rename $running_processes to $running_threads, implement real $running_processes 2009-11-15 17:55:03 +01:00
Nikolas Garofil
2c2e87061b Added support for $gid_name 2009-11-15 17:46:41 +01:00
Nikolas Garofil
3fa868f35b Added support for $uid_name 2009-11-15 17:21:55 +01:00
Nikolas Garofil
d38049fb96 Added support for $pid_uid, $pid_euid, $pid_suid, $pid_fsuid, $pid_gid, $pid_egid, $pid_sgid and $pid_fsgid 2009-11-15 14:49:55 +01:00
Nikolas Garofil
b8e6b1a58d Add support for $pid_parent 2009-11-15 13:26:40 +01:00
Phil Sutter
68278e4a45 yet another fix for FreeBSD (somehow sneaked through last time) 2009-11-14 16:47:30 +01:00
Phil Sutter
40792b7d05 fix compiling for freebsd
Tested using default options, lua disabled as only lua50 available in
7.2-RELEASE.
2009-11-15 01:36:17 +01:00
Phil Sutter
8f1eae1b94 add generated files for profiling to clean list 2009-11-15 01:36:17 +01:00
Nikolas Garofil
038e182c38 argument of $cmdline_to_pid doesnt have to be the full commandline 2009-11-15 00:51:38 +01:00
Nikolas Garofil
7b6e01b869 fix last commit 2009-11-14 22:17:41 +01:00
Nikolas Garofil
fa459f0539 Make it possible to use other vars as arguments for the $pid-vars, add support for $pid_state_short, add support for $cmdline_to_pid 2009-11-14 22:07:54 +01:00
Cesare Tirabassi
e582acf1a0 Merge branch 'master' of git.omp.am:/home/omp/git/conky 2009-11-14 15:58:06 +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
Nikolas Garofil
1a4c2c61e8 Shrink proc.c 2009-11-14 15:08:41 +01:00
Nikolas Garofil
44de7fe6be Support for $pid_state 2009-11-14 13:58:07 +01:00
Pavel Labath
6db3b5809d Add middle_middle alignment, mostly for completeness 2009-11-13 21:35:49 +01:00
Nikolas Garofil
ab0b80e495 Added support for $pid_chroot 2009-11-13 16:54:40 +01:00
Cesare Tirabassi
f1272dbd31 Merge branch 'master' of git.omp.am:/home/omp/git/conky 2009-11-13 16:36:49 +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
Nikolas Garofil
e9d92ae717 Fix bug in $pid_openfiles 2009-11-13 16:29:44 +01:00
Phil Sutter
bde5845077 drop adt746x objects
This was really creepy stuff. Last updated in April, 2006 to work with
kernels > 2.6.12. I consider this "fobar" (fscking obsolete beyond all
recognition) and doubt anyone still uses this. If you do, blame me. :)
2009-11-13 00:47:23 +01:00
Nikolas Garofil
52df1d2bf2 Merge branch 'master' of ssh://git.omp.am/home/omp/git/conky 2009-11-13 00:38:13 +01:00
Nikolas Garofil
52629bef61 Added support for $pid_openfiles 2009-11-13 00:36:46 +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
Phil Sutter
e787870eb4 top: fix segfault for $if_running
The "name" field may be zero, which makes strcmp() freak out.
2009-11-13 00:02:16 +01:00
Nikolas Garofil
e26c9977f2 fix potential bugs in snprintf 2009-11-12 21:48:15 +01:00
Nikolas Garofil
1d0b68e60d Fix building without C99 2009-11-12 21:33:57 +01:00
Nikolas Garofil
6c4f069f00 Added support for $pid_exe and $pid_stdin, $pid_stdout and $pid_stderr 2009-11-12 20:34:43 +01:00
Nikolas Garofil
6b20156a1b Added support for $pid_environ_list 2009-11-12 15:42:18 +01:00
Nikolas Garofil
d595a65077 Add support for $pid_environ 2009-11-11 22:56:12 +01:00
Nikolas Garofil
cb96b3bcca Add cwd to $pid and split into $pid_cmdline and $pid_cwd 2009-11-11 16:27:19 +01:00
Nikolas Garofil
aa761584db fix previous commit 2009-11-11 13:44:50 +01:00
Nikolas Garofil
db99693091 fix tiny compile problem 2009-11-11 13:43:14 +01:00
Nikolas Garofil
65cf0439a0 Fix memleak and change literals to defines 2009-11-11 13:23:05 +01:00
Nikolas Garofil
8276da8777 Add proc.c and proc.h 2009-11-11 11:33:28 +01:00
Nikolas Garofil
46dd6ca513 Add support for ${pid cmdline} 2009-11-11 10:55:25 +01:00
Nikolas Garofil
827be3bde8 Fix $if_mpd_playing and $mpd_percent when you stop playing a song, thanks Sakari Matikka 2009-11-10 13:23:00 +01:00
Nikolas Garofil
ccbaf9ea89 Fix memleak 2009-11-10 00:15:30 +01:00
Nikolas Garofil
7025477402 Fix $scroll only scrolls once 2009-11-09 02:38:20 +01:00
Nikolas Garofil
e292dd5e28 Fix segfault and memleaks in curl 2009-11-08 21:49:28 +01:00
Phil Sutter
37071ccd8e ifblock objects: fix bug for sub-object parsing ifblocks
When dropping the ifblock field of struct text_object, I short-sightedly
reused the sub field for holding the pointer to the matching else/endif.
This however doesn't work for objects parsing their own object list, as
they need the sub field for themselfs.

Since we have it, simply reuse the special_data field instead and hope
there won't ever be an object which is both special and ifblock. ;)
2009-11-08 20:20:47 +01:00
Phil Sutter
581c86f070 fix conversion bug when freeing exec objects 2009-11-08 20:20:47 +01:00
Nikolas Garofil
a1e199c85a Fix building with metar but without xoap 2009-11-08 18:00:13 +01:00
Nikolas Garofil
ce99d1a782 Use a define for the maximum number of network devices 2009-11-07 23:46:46 +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
Nikolas Garofil
ff1fab20c2 Fix building with --disable-xft and add ncurses to the -v option 2009-11-07 15:32:03 +01:00
Nikolas Garofil
68ca9485da Fix building with --disable-iostats 2009-11-07 13:21:47 +01:00
Nikolas Garofil
74145a7fef Fix building with --disable-x11 --disable-lua --disable-ncurses 2009-11-07 12:21:48 +01:00
Phil Sutter
e909cdd4eb scan_graph: allow giving a "hint" about a good scale value
This is more or less a temporary fix to restore the former behaviour. In
the long term objects will define a max value, which will be of use for
all kinds of meters.
2009-11-06 00:10:00 +01:00
Phil Sutter
c88d01af95 weather: fix this embarrassing bug 2009-11-05 22:27:34 +01:00
Phil Sutter
556751c8c9 top: drop problematic field totalmem
The field totalmem was formerly used to hold the percentage of used mem
by a process. So at update time, the field info.memmax was being
addressed, which is potentially being updated at the same time, As all
updating routines potentially run in parallel. Though there is an
(quite) easy fix for this: calculate the percentage upon object
printing. This works because conky synchronises all update routines
right before printing the result. (To omit locking on it's own.)
2009-11-03 23:24:09 +01:00
Phil Sutter
e08bc8fad7 enum special_types: define nonspecial for completeness 2009-11-03 23:23:23 +01:00
Phil Sutter
4dd54b3df6 if_gw: no need to free unused obj->data.s 2009-11-03 23:23:23 +01:00
Phil Sutter
f61d8d108f text_object: completely remove the need for data.ifblock 2009-11-03 23:23:23 +01:00
Phil Sutter
9a770295d1 drop useless ifblock.str 2009-11-03 23:23:23 +01:00
Phil Sutter
66c187e7a1 no need to save the args passed to if_empty and if_match 2009-11-03 23:23:23 +01:00
Phil Sutter
7304378d73 drop a few unused fields from struct text_object 2009-11-03 23:23:23 +01:00
Phil Sutter
d9ec45b25d drop struct text_object field pair, since it got unused due to latest commits 2009-11-03 23:23:23 +01:00
Phil Sutter
76b433c809 drop struct text_object field f 2009-11-03 23:23:23 +01:00
Phil Sutter
f98a360089 drop now unused SIZE_DEFAULTS macro 2009-11-03 23:23:23 +01:00
Phil Sutter
041059f1c2 specials: convert stippled_hr object to new style 2009-11-03 23:23:23 +01:00
Phil Sutter
3458db80aa specials: convert tab object to new style 2009-11-03 23:23:23 +01:00
Phil Sutter
50e2b5961a specials: convert gauge objects to new style 2009-11-03 23:23:23 +01:00
Phil Sutter
bbec0db498 specials: convert graph objects to new style 2009-11-03 23:23:23 +01:00
Phil Sutter
a4777c7c55 misc smaller fixes 2009-11-03 23:23:23 +01:00
Phil Sutter
22251dca51 specials: introduce dedicated per-object data and merge graph objects 2009-11-03 23:23:23 +01:00
Phil Sutter
0bed05997b review load* code 2009-11-03 23:23:23 +01:00
Phil Sutter
42dfb7ac69 move loadavg and loadgraph code to common.c 2009-11-03 23:23:23 +01:00
Phil Sutter
63079a2075 local_mails: convert to generic object payload
This also includes a little header include cleanup.
2009-11-03 23:23:22 +01:00
Phil Sutter
90ed7d8a2c mail: convert to generic object payload 2009-11-03 23:23:22 +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
3a365bcd33 if_up: convert to generic object payload 2009-11-03 23:23:22 +01:00
Phil Sutter
2112b1f0ee drop now unused sensor field 2009-11-03 23:23:22 +01:00
Phil Sutter
0de0047bdc obsd_sensors: cleanup code (untested) 2009-11-03 23:23:22 +01:00
Phil Sutter
f2188a67a1 ibm: convert to generic object payload 2009-11-03 23:23:22 +01:00
Phil Sutter
c8f07daceb net_stats: convert to generic object payload 2009-11-03 23:23:22 +01:00
Phil Sutter
0740e91911 diskio: convert to generic object payload 2009-11-03 23:23:22 +01:00
Phil Sutter
aa4d61d3d7 combine: convert to generic object payload 2009-11-03 23:23:22 +01:00
Phil Sutter
64ec783475 scroll: convert to generic object payload 2009-11-03 23:23:22 +01:00
Phil Sutter
bf9263bc5e read_tcp: convert to generic object payload 2009-11-03 23:23:22 +01:00
Phil Sutter
b74e0494de exec: convert to generic object payload 2009-11-03 23:23:22 +01:00
Phil Sutter
0dc60481cf top: convert to generic object payload 2009-11-03 23:23:22 +01:00
Phil Sutter
4b0c1d3226 mboxscan: convert to generic object payload 2009-11-03 23:23:22 +01:00
Phil Sutter
dd36fc4caa mixer: convert to generic object payload 2009-11-03 23:23:22 +01:00
Phil Sutter
c45decda5e curl: convert to generic object payload 2009-11-03 23:23:22 +01:00
Phil Sutter
4716969cc6 weather objects: convert to generic object payload 2009-11-03 23:23:22 +01:00
Phil Sutter
046ae1dd61 rss: convert to generic object payload 2009-11-03 23:23:22 +01:00
Phil Sutter
9202a9da87 eve: convert to generic object payload 2009-11-03 23:23:22 +01:00
Phil Sutter
94ac89e091 sysfs objects: convert to generic object payload 2009-11-03 23:23:22 +01:00
Phil Sutter
d2be5980ca tcp_portmon: convert to generic object payload 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
f31e5cefe7 fs_bar, fs_bar_free: convert to generic object payload 2009-11-03 23:23:22 +01:00
Phil Sutter
f6942c8c98 tailhead: convert to generic object payload 2009-11-03 23:23:22 +01:00
Phil Sutter
1d73d82b87 convert tztime 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
eff3f75014 text_object: introduce a generic payload pointer 2009-11-03 23:23:22 +01:00
Phil Sutter
d1b2c7eac3 local_mails: put code to where it belongs
Note that the code does not only use a pre-processor generator for
defining the print functions, but also for their prototypes. Sadly, this
generated a conflict in mboxscan.c which this patch resolves, too.
2009-11-03 01:50:28 +01:00
Phil Sutter
fa9135f9df mail: put imap and pop3 code to where it belongs 2009-11-03 01:50:28 +01:00
Phil Sutter
8b76d8fb60 net_stats: outsource network-related objects 2009-11-03 01:50:28 +01:00
Phil Sutter
9efa29be28 combine: outsource code 2009-11-03 01:50:28 +01:00
Phil Sutter
37658b540b scroll: outsource code 2009-11-03 01:50:28 +01:00
Phil Sutter
24d9e8bf24 read_tcp: 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
2631f42820 ibm: put specific code to where it belongs 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
Cesare Tirabassi
27a2a253a8 Fix indenting of last commit 2009-11-01 18:42:29 +01:00
Cesare Tirabassi
4ea99e27f1 Fix hwmon location for kernel >= 2.6.31 (closes sf: #2865628)
In the linux kernel 2.6.31 and above, device data can either be in
/sys/class/hwmon/hwmonDEV or /sys/class/hwmon/hwmonDEV/device.
Just stat'ing for the latter doesn't work since it can exist but not contain
the required data (see https://bugs.launchpad.net/bugs/435571 for details).
The patch could be improved to keep in memory the right location of the data
on the user's system instead of trying each time, but, is it worth doing it?
2009-11-01 18:37:48 +01:00
Phil Sutter
f7f3b37807 rss.h: drop useless header include 2009-10-12 23:04:41 +02: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
Phil Sutter
a106b52698 curl: put init and print code to where it belongs
This also fixes a bug in arg parsing, effectively forcing an interval to
be specified.
2009-10-12 21:33:02 +02:00
Phil Sutter
ad8dd36cb7 weather objects: move init and print code to weather.c 2009-10-12 21:33:02 +02:00
Phil Sutter
6a2f58a25c rss: move init and print code into rss.c 2009-10-12 21:33:02 +02:00
Phil Sutter
ddca4aac68 spend some time with eve.{c,h}
* minimise core code hooks
* drop useless exporting of private functions (and make them static)
* reorder functions in eve.c so no prototypes are needed
* drop massive header include and add double include barrier in eve.h
2009-10-12 21:33:02 +02:00
Phil Sutter
700a32b2e7 sysfs objects: merge init and print routines 2009-10-12 21:33:02 +02:00
Phil Sutter
da7876468f tcp_portmon: drop useless function pointer cast, use OBJ_ARG 2009-10-12 21:33:02 +02:00
Phil Sutter
4d70cf07b8 fs_bar, fs_bar_free: merge init and print routines 2009-10-12 21:33:02 +02:00
Phil Sutter
b9a28c37a8 tail, head: use OBJ_ARG to simplify code 2009-10-12 21:33:02 +02:00
Phil Sutter
a529ac52de hddtemp: drop dead code (custom per-object data) 2009-10-12 21:33:02 +02:00
Cesare Tirabassi
066af067f0 Fix global info.desktop variables were incorrectly freed, sf #2876647 2009-10-12 13:38:48 +02:00
Phil Sutter
ea92e63a44 tztime: fix argument parsing bug, clarify docs 2009-10-04 04:03:21 +02:00
Phil Sutter
1e893ec6e3 iconv: outsource code into it's own file
While testing, I found two already existing bugs:
* the variable 'a' passed to iconv_convert() needs to be passed by
  reference in order to allow for the desired side effect.
* Somehow the trailing junk after an iconv_conversion to a shorter
  string messes things up (and gets printed!). I couldn't exactly find
  out why this happens, but setting (*p) = 0; solves this problem.
2009-10-04 03:41:45 +02:00
Phil Sutter
adf9d23927 outsource time, utime and tztime into a separate file 2009-10-04 03:24:04 +02:00
Phil Sutter
e3e77ce75e move the SIZE_DEFAULTS() macro to where it belongs to 2009-10-04 03:24:04 +02:00
Brenden Matthews
584d05d2ad Add the -p/--pause command line option. 2009-10-03 14:26:39 -07:00
Brenden Matthews
88a8799bf5 Improve IMAP/POP3 code, fix compiler error. 2009-09-30 18:06:18 -07:00
Brenden Matthews
7fc4d40eb2 Allow spaces in mail folder names for pop/imap.
For example, you can specify "-f '[Gmail]/All Mail'" in your mail args
to view all mails in your Google mail IMAP folder.
2009-09-27 10:40:06 -07:00
Brenden Matthews
4a0676d4d0 Fix IMAP IDLE with Google's IMAP service. 2009-09-26 18:38:55 -07:00
Pavel Labath
28978461a7 Put OBJ(image) in $ifdefs
so that conky produces more meaningful error message when compiled without imlib
2009-09-25 14:43:46 +02:00
Pavel Labath
bfda285567 Make -d switch work again
-d was broken because fork-to-background was done after the update thread creation, so the
threads ended up in the wrong process. This delays the thread creation until after the fork.
2009-09-22 18:19:08 +02:00
Phil Sutter
cfccea4079 do not block when reading inotify_fd
Originally, I was experiencing sporadic lockups when reading inotify_fd;
which is strange, since it is protected by select(). This should fix it
despite of the original problem.
2009-09-20 19:04:45 +02:00
Phil Sutter
d163293f66 index processes in a hash table for faster lookup 2009-09-20 16:10:05 +02:00
Pavel Labath
596449c902 It feels much better to let the thread exit voluntarily instead of violently killing it 2009-09-20 14:38:57 +02:00
Phil Sutter
d45aa362b0 fixup for ncurses output 2009-09-20 13:52:46 +02:00
Phil Sutter
4823b1f428 drop duplicate code 2009-09-20 13:18:10 +02:00
Phil Sutter
3569ece513 minor indentation fixup 2009-09-20 13:16:43 +02:00
Phil Sutter
e391fa40a9 this was looking wrong 2009-09-20 13:16:43 +02:00
Phil Sutter
15e262a3ca minor simplification of get_string_width_special() 2009-09-20 13:16:20 +02:00
Phil Sutter
4840de39cd update machinery: keep threads persistent
Create each thread upon registration of the callback function, then use
semaphores to signal when it's time to update and when updating is
finished.
Many thanks to pavelo who originally came up with the idea for this.
2009-09-20 13:14:08 +02:00
Phil Sutter
2cb45085e0 simplify get_string_width() a bit 2009-09-20 13:12:56 +02:00
Pavel Labath
7ad3e34e34 OBJ -> OBJ_ARG; apparently forgotten in 9f22ba 2009-09-15 23:54:31 +02:00
Phil Sutter
fea72bd8f8 top.c: fix for unsigned underflow
Yes, I also thought these are monotonic counters. But it seems like they
are not, at least sometimes the value decreases by 1 leading to a very
very high cpu usage percentage being printed.
2009-09-15 23:16:39 +02:00
Phil Sutter
7fa59c6c90 better zero out allocated memory 2009-09-15 23:16:39 +02:00
Phil Sutter
b7b9329e38 update machinery: run each update callback in it's own thread 2009-09-15 23:16:39 +02:00
Phil Sutter
925ac2b7ba read_tcp: get rid of heavy indenting 2009-09-15 23:16:35 +02:00
Phil Sutter
9f22bab657 core: add OBJ_ARG() and OBJ_IF_ARG() to force arguments
These macros can be used just like their OBJ() and OBJ_IF()
counterparts, just that they bail out hard when arg is unset. While
here, also cleanup the macro definition by using __* macros and fully
cleanup the macro namespace when the job is done.

Although this makes conky kind of less robust when it comes to
configuration errors, aborting is the right thing to do to avoid
ambiguity between unknown text objects.
2009-09-15 23:12:15 +02:00
Phil Sutter
77cc646080 imlib2: don't flood warnings on non-existing images 2009-09-15 23:12:15 +02:00
Phil Sutter
f33affdc03 do not unconditionally overwrite a variable after conditionally setting it 2009-09-15 23:12:15 +02:00
Phil Sutter
ed3d73c094 minor indenting fixup 2009-09-15 23:12:15 +02:00
Phil Sutter
fa896bec98 apcupsd: drop init_apcupsd() since it was called at the wrong place
Normally, this is not enough reason to remove code, but in this case it
means that either the tester always had $nvidia (if enabled) or $combine
also in her setup, or it was working without (which I guess, since there
is duplicate code in update_apcupsd()).
2009-09-15 23:12:15 +02:00
Phil Sutter
9dd360ecdb update machinery: add some documentation 2009-09-15 23:12:15 +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
a00bd4ad5e update machinery: fix accidential naming conflict 2009-09-09 22:56:10 +02:00
Phil Sutter
466a253a8c update machinery: fix for update_stat() on linux 2009-09-09 22:52:09 +02:00
Pavel Labath
3736b141aa Fix window width calculation when $lua returns newlines
I just hope it doesn't break anything.
2009-09-09 21:15:18 +02:00
Phil Sutter
f33bcb36ef update machinery: fix top objects
This is a bit messy, but since the top update stuff could use a rewrite
anyway, this should do.
2009-09-07 01:49:44 +02:00
Phil Sutter
d32879faaa update machinery: let CALLBACK() die again
There are no INFO_* variables any more, so the argument passed to OBJ()
is always a function pointer or zero. By checking the argument passed in
add_update_callback(), the branch in the OBJ() macro can be dropped,
too.
2009-09-07 01:22:16 +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
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
Phil Sutter
56142a7cd4 cleanup src/Makefile.am
Since the files mentioned in conky_SOURCES are already included in the
distfile, no need to specify them again in EXTRA_DIST.
2009-09-05 03:30:12 +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
Phil Sutter
ff199355f6 outsource the whole template object machinery 2009-09-04 00:08:17 +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
Cesare Tirabassi
08e40c1fe8 Don't abort diskio objects initialisation if the given device doesn't exist, we could have these objects iffed; closes LP: #405188 2009-08-14 18:32:39 +02:00
Cesare Tirabassi
bf1dea5e4e Precised last two weather_forecast xpaths 2009-08-11 16:10:35 +02:00
Cesare Tirabassi
141c229afc Add day and date data_type to 2009-08-10 22:46:21 +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
74b61f9730 Undo adding local ncurses.h header-file added by b4b0228d09 .
The headerfile used globally should be used instead of one in the local dir.
If conky can't find it, it should be fixed in configure.ac.in or Makefile.am,
and not in the code.
2009-08-08 02:54:07 +02:00
Nikolas Garofil
834804c265 Fix: Add header needed for read_tcp 2009-08-08 02:49:28 +02:00