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
3f00e817c5 free desktop information where it should be done 2009-12-01 00:32:33 +01:00
Phil Sutter
5ed38bfe0d convert top objects to callbacks.free 2009-12-01 00:32:33 +01:00
Phil Sutter
ba47b49d88 move free_all_processes() to where it really should be 2009-12-01 00:32:33 +01:00
Phil Sutter
8ef2f13e9d convert xmms2 objects to callbacks.free 2009-12-01 00:32:33 +01:00
Phil Sutter
6fb5302778 convert mpd objects to callbacks.free 2009-12-01 00:32:33 +01:00
Phil Sutter
4c4a7c4096 convert nameserver to callbacks.free 2009-12-01 00:32:33 +01:00
Phil Sutter
781bc7b024 convert gateway objects to callbacks.free 2009-12-01 00:32:33 +01:00
Phil Sutter
93c2079af0 generically free obj->sub if non-zero in free_text_objects() 2009-12-01 00:32:33 +01:00
Phil Sutter
87472a3daa convert cmdline_to_pid to callbacks.free 2009-12-01 00:32:33 +01:00
Phil Sutter
ede0838e17 drop struct information parameter from generate_text_internal() 2009-12-01 00:32:33 +01:00
Phil Sutter
0f8b7d1186 cleanup generate_text_internal() 2009-12-01 00:32:33 +01:00
Phil Sutter
92ae6fab8a replace substitute_newlines() object typecheck with object field
This is the more generic way, although I doubt this is really error
preventing. To me, it's not totally clear as to when
substitute_newlines() is forbidden and when not. Maybe someone (the
author?) can shed light on the internal algorithm of this feature.
2009-12-01 00:32:33 +01:00
Phil Sutter
c9f1c318aa convert OBJ_text to callbacks
This is tricky: there is no such thing as $text. In fact, everything
below TEXT in the conkyrc which is NOT a text object will become one of
type OBJ_text.

To make life easy, introduce a function obj_be_plain_text() converting a
given object to the given plain text.
2009-12-01 00:32:33 +01:00
Phil Sutter
e569803324 convert if_updatenr to callbacks.iftest 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
ffec9dd50c font: convert to callbacks.print 2009-12-01 00:32:32 +01:00
Phil Sutter
95b92d6cff new_font: convert to common signature 2009-12-01 00:32:32 +01:00
Phil Sutter
e5b25fd30a unconditionally call load_fonts()
Since load_fonts() iterates over font_count fonts which is initially -1,
it turns into a NOP when no fonts where added.
2009-12-01 00:32:32 +01:00
Phil Sutter
68a09f7a02 gid_name, uid_name: outsource sub object parsing and convert to callbacks.print 2009-12-01 00:32:32 +01:00
Phil Sutter
4ba0f9ff4f pid objects: convert to callbacks.print 2009-12-01 00:32:32 +01:00
Phil Sutter
5b686294f3 pid objects: outsource sub object evaluation 2009-12-01 00:32:32 +01:00
Phil Sutter
057855442c cleanup proc.c obj->data mess
Use a local variable named 'pathbuf' of sufficient size to hold the
generated path name.
2009-12-01 00:32:32 +01:00
Phil Sutter
d9dbd528c4 simplify iconv_convert() a bit (exit early on error) 2009-12-01 00:32:32 +01:00
Phil Sutter
938af98ff3 convert iconv objects to callbacks 2009-12-01 00:32:32 +01:00
Phil Sutter
b8e600b9a4 convert bsd apm objects to callbacks.print 2009-12-01 00:32:32 +01:00
Phil Sutter
d48c2f143c convert $include to callbacks.print 2009-12-01 00:32:32 +01:00
Phil Sutter
3ed82a34dd convert blink to callbacks.print 2009-12-01 00:32:32 +01:00
Phil Sutter
dc0af635d6 convert to_bytes to callbacks.print 2009-12-01 00:32:32 +01:00
Phil Sutter
8da8b26ddf use gen_print_nothing for $apcupsd 2009-12-01 00:32:32 +01:00
Phil Sutter
37cbdcf89b convert $endif to callbacks.print 2009-12-01 00:32:32 +01:00
Phil Sutter
718ed9d280 convert $else to callbacks.iftest 2009-12-01 00:32:32 +01:00
Phil Sutter
f1454767b2 convert image to callbacks.print 2009-12-01 00:32:32 +01:00
Phil Sutter
3fa5c55933 convert some non-openbsd objects to callbacks.{print,iftest} 2009-12-01 00:32:32 +01:00
Phil Sutter
c652427aed convert freq and freq_g to callbacks.print 2009-12-01 00:32:32 +01:00
Phil Sutter
31c3734cc8 convert acpitemp to callbacks.{print,free} 2009-12-01 00:32:32 +01:00
Phil Sutter
a67ab7a3c8 convert some ifblock objects to callbacks.iftest 2009-12-01 00:32:32 +01:00
Phil Sutter
721cdbdd30 convert eval to callbacks.print 2009-12-01 00:32:32 +01:00
Phil Sutter
f5596a6505 trivial conversion of cmdline_to_pid to callbacks.print 2009-12-01 00:32:32 +01:00
Phil Sutter
871c4b2d02 convert buffers and cached to callbacks.print 2009-12-01 00:32:32 +01:00
Phil Sutter
1f8bafbcfc convert processes and threads objects 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
b4aa2328d7 convert uptime objects to callbacks.print 2009-12-01 00:32:32 +01:00
Phil Sutter
cce12efda7 convert sysname to callbacks.print 2009-12-01 00:32:31 +01:00
Phil Sutter
e9dde6293b convert nodename to callbacks.print 2009-12-01 00:32:31 +01:00
Phil Sutter
d9e2f687b6 convert format_time to callbacks.print 2009-12-01 00:32:31 +01:00
Phil Sutter
f84b14904c convert kernel and machine to callbacks.print 2009-12-01 00:32:31 +01:00
Phil Sutter
177da5ffbb convert mem and swap objects to callbacks.print 2009-12-01 00:32:31 +01:00
Phil Sutter
ef60b7eb8a drop update_x11info()
instead:
- call XDefaultScreen() and XScreenCount() directly from the print
  callback
- have no update callback at all for the desktop objects (seems to work
  well without)
2009-12-01 00:32:31 +01:00
Phil Sutter
6004ab961a convert desktop and monitor objects to callbacks.print 2009-12-01 00:32:31 +01:00
Phil Sutter
2dca262c00 convert if_smapi_bat_installed to callbacks.iftest 2009-12-01 00:32:31 +01:00
Phil Sutter
9887bfdfdf convert smapi_bat_perc to callbacks.percentage 2009-12-01 00:32:31 +01:00
Phil Sutter
bc1b82771f convert mpd_percent to callbacks.percentage 2009-12-01 00:32:31 +01:00
Phil Sutter
61591def8e convert mixer values to callbacks.percentage 2009-12-01 00:32:31 +01:00
Phil Sutter
36a202091e convert fs_*_perc to callbacks.percentage 2009-12-01 00:32:31 +01:00
Phil Sutter
61c4efb305 convert entropy_perc to callbacks.percentage 2009-12-01 00:32:31 +01:00
Phil Sutter
0631b2ab2e convert swapperc to callbacks.percentage 2009-12-01 00:32:22 +01:00
Phil Sutter
feba298efa convert memperc to callbacks.percentage 2009-12-01 00:31:09 +01:00
Phil Sutter
07f82f5cb6 convert cpu to callbacks.percentage 2009-12-01 00:29:28 +01:00
Phil Sutter
79f5726832 merge loadgraph to callbacks.graphval 2009-12-01 00:29:28 +01:00
Phil Sutter
bd752e8506 merge {down,up}speedgraph to callbacks.graphval 2009-12-01 00:29:28 +01:00
Phil Sutter
fe05542318 merge diskiographs to callbacks.graphval 2009-12-01 00:29:28 +01:00
Phil Sutter
9581914f7d reuse barval callbacks where applicable 2009-12-01 00:28:53 +01:00
Phil Sutter
cba2460397 merge apcupsd_loadbar to callbacks.barval 2009-12-01 00:07:07 +01:00
Phil Sutter
4988947829 convert xmms2_bar to callbacks.barval 2009-12-01 00:06:23 +01:00
Phil Sutter
997805c46b convert smapi_bat_bar to callbacks.barval 2009-12-01 00:05:20 +01:00
Phil Sutter
fcd3d58960 convert mpd_bar to callbacks.barval 2009-12-01 00:04:35 +01:00
Phil Sutter
f79c58ef47 merge mixer bars to callbacks.barval 2009-12-01 00:02:48 +01:00
Phil Sutter
4d7f2e720d merge lua_bar to callbacks.barval 2009-12-01 00:02:04 +01:00
Phil Sutter
4f8e700d64 convert fs bars to callbacks.barval 2009-12-01 00:01:04 +01:00
Phil Sutter
a5ff5d39d0 merge execibar to callbacks.barval 2009-11-30 23:59:13 +01:00
Phil Sutter
95fbecc385 merge entropy_bar to callbacks.barval 2009-11-30 23:58:09 +01:00
Phil Sutter
b78664d8c5 merge audacious_bar to callbacks.barval 2009-11-30 23:57:04 +01:00
Phil Sutter
086829b017 convert swapbar to callbacks 2009-11-30 23:55:48 +01:00
Phil Sutter
d2f3ae7e15 convert mem{gauge,graph,bar} to callbacks 2009-11-30 23:54:52 +01:00
Phil Sutter
b2b9155514 fix execigauge conversion to callbacks 2009-11-30 23:49:58 +01:00
Phil Sutter
685d4ca4e8 fix execbar merge to callbacks 2009-11-30 23:48:54 +01:00
Phil Sutter
4e63422d10 battery_bar: convert to callbacks.barval 2009-11-30 23:48:04 +01:00
Phil Sutter
a11a1a1253 wireless_link_bar: convert to callbacks.barval 2009-11-30 23:35:49 +01:00
Phil Sutter
c85295202b convert cpubar to callbacks.barval 2009-11-30 23:34:20 +01:00
Phil Sutter
06a4650f60 if_xmms2_connected: convert to callbacks.iftest 2009-11-29 22:21:49 +01:00
Phil Sutter
cec0f3b8c6 cleanup mpd code 2009-11-29 22:21:49 +01:00
Phil Sutter
41f32f8766 if_mpd_playing: convert to callbacks.iftest 2009-11-29 22:21:49 +01:00
Phil Sutter
482f2d50b4 if_mixer_mute: convert to callbacks.iftest 2009-11-29 22:21:49 +01:00
Phil Sutter
5249c9da04 if_mounted: convert to callbacks.iftest 2009-11-29 22:21:49 +01:00
Phil Sutter
9af79a4907 if_up: convert to callbacks.iftest 2009-11-29 22:21:49 +01:00
Phil Sutter
27c1207cd1 if_gw: convert to callbacks.iftest 2009-11-29 22:21:49 +01:00
Phil Sutter
bb70c21c36 nvidia: convert to callbacks.print 2009-11-29 22:21:49 +01:00
Phil Sutter
0188eb0aaa top: convert to callbacks.print 2009-11-29 22:21:49 +01:00
Phil Sutter
1832cf79c9 ioscheduler: convert to callbacks.print 2009-11-29 22:21:49 +01:00
Phil Sutter
712caa8ab3 convert obsd_* to callbacks.print (completely untested) 2009-11-29 22:21:49 +01:00
Phil Sutter
a249b9bc44 convert disk_protect to callbacks.print 2009-11-29 22:21:49 +01:00
Phil Sutter
2660cb7590 convert execpi to callbacks.print 2009-11-29 22:21:49 +01:00
Phil Sutter
60ad080d1d convert pb_battery to callbacks.print 2009-11-29 22:21:49 +01:00
Phil Sutter
3f83bd34f4 convert laptop_mode to callbacks.print 2009-11-29 22:21:49 +01:00
Phil Sutter
f3cafc6a7c convert gw_* objects to callbacks.print 2009-11-29 22:21:49 +01:00
Phil Sutter
faa47450ad convert sony_fanspeed to callbacks.print 2009-11-29 22:21:49 +01:00
Phil Sutter
42b71217e3 loadgraph: convert to callbacks.print 2009-11-29 22:21:49 +01:00
Phil Sutter
ee40c63542 xmms2: outsource code and convert to callbacks.print 2009-11-29 22:21:48 +01:00
Phil Sutter
6bf79b7ebe combine: convert to callbacks.print 2009-11-29 22:21:48 +01:00
Phil Sutter
65effae144 scroll: convert to callbacks.print 2009-11-29 22:21:48 +01:00
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