diff --git a/ChangeLog b/ChangeLog index c5100aae..937e4337 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,6 +3,7 @@ 2005-08-20 * Applied patch from zimba-tm, closes patch 1260225 * Fixed ugly gradient bug. closes bug 1255608 + * Added $voffset 2005-08-12 * Multiple unit additions and modifications diff --git a/conky.c b/conky.c index e9578530..e53e9a12 100644 --- a/conky.c +++ b/conky.c @@ -356,6 +356,7 @@ enum { ALIGNC, GRAPH, OFFSET, + VOFFSET, FONT, }; @@ -575,7 +576,12 @@ static inline void new_outline(char *buf, long c) static inline void new_offset(char *buf, long c) { - new_special(buf, OFFSET)->arg = c; + new_special(buf, OFFSET)->arg = c; +} + +static inline void new_voffset(char *buf, long c) +{ + new_special(buf, VOFFSET)->arg = c; } static inline void new_alignr(char *buf, long c) @@ -685,6 +691,7 @@ enum text_object_type { OBJ_fs_used_perc, OBJ_hr, OBJ_offset, + OBJ_voffset, OBJ_alignr, OBJ_alignc, OBJ_i2c, @@ -1067,6 +1074,7 @@ if (s[0] == '#') { obj->data.fs = prepare_fs_stat(arg); END OBJ(hr, 0) obj->data.i = arg ? atoi(arg) : 1; END OBJ(offset, 0) obj->data.i = arg ? atoi(arg) : 1; + END OBJ(voffset, 0) obj->data.i = arg ? atoi(arg) : 1; END OBJ(i2c, INFO_I2C) char buf1[64], buf2[64]; int n; @@ -1908,10 +1916,13 @@ static void generate_text() OBJ(hr) { new_hr(p, obj->data.i); } - OBJ(offset) { + OBJ(offset) { new_offset(p, obj->data.i); } - OBJ(i2c) { + OBJ(voffset) { + new_voffset(p, obj->data.i); + } + OBJ(i2c) { double r; r = get_i2c_info(&obj->data.i2c.fd, @@ -2679,6 +2690,9 @@ static void text_size_updater(char *s) else if (specials[special_index].type == OFFSET) { w += specials[special_index].arg + get_string_width("a"); /* filthy, but works */ } + else if (specials[special_index].type == VOFFSET) { + h += specials[special_index].arg; + } else if (specials[special_index].type == FONT) { fontchange = specials[special_index].font_added; selected_font = specials[special_index].font_added; @@ -3203,11 +3217,16 @@ static void draw_line(char *s) arg); break; - case OFFSET: + case OFFSET: { w += specials[special_index].arg; } - break; + break; + case VOFFSET: + { + cur_y += specials[special_index].arg; + } + break; case ALIGNR: { diff --git a/conkyrc.sample b/conkyrc.sample index 1294a7f0..f45ce3e3 100644 --- a/conkyrc.sample +++ b/conkyrc.sample @@ -1,4 +1,8 @@ -# conky configuration +# Conky sample configuration +# +# the list of variables has been removed from this file in favour +# of keeping the documentation more maintainable. +# Check http://conky.sf.net for an up-to-date-list. # set to yes if you want Conky to be forked in the background background no @@ -129,187 +133,6 @@ metar_station CYBW # boinc (seti) dir # seti_dir /opt/seti -# Possible variables to be used: -# -# Variable Arguments Description - -# addr (interface) IP address for an interface -# acpiacadapter ACPI ac adapter state. -# acpifan ACPI fan state -# acpitemp ACPI temperature. -# adt746xcpu CPU temperature from therm_adt746x -# adt746xfan Fan speed from therm_adt746x -# alignr (num) Right-justify text, with space of N -# alignc Align text to centre -# battery (num) Remaining capasity in ACPI or APM -# battery. ACPI battery number can be -# given as argument (default is BAT0). -# buffers Amount of memory buffered -# cached Amount of memory cached -# color (color) Change drawing color to color -# cpu CPU usage in percents -# cpubar (height) Bar that shows CPU usage, height is -# bar's height in pixels -# cpugraph (height),(width) (gradient colour 1) (gradient colour 2) -# CPU usage graph, with optional colours in hex, -# minus the #. -# downspeed net Download speed in kilobytes -# downspeedf net Download speed in kilobytes with one -# decimal -# downspeedgraph net (height),(width) (gradient colour 1) (gradient colour 2) -# Download speed graph, colours defined in -# hex, minus the #. -# exec shell command Executes a shell command and displays -# the output in conky. warning: this -# takes a lot more resources than other -# variables. I'd recommend coding wanted -# behaviour in C and posting a patch :-). -# execbar shell command Same as exec, except if the first value -# return is a value between 0-100, it -# will use that number for a bar. -# The size for the bar is currently fixed, -# but that may change in the future. -# execgraph shell command Same as execbar, but graphs values -# execi interval, shell command -# Same as exec but with specific interval. -# Interval can't be less than -# update_interval in configuration. -# font font Specify a different font. Only applies -# to one line. -# fs_bar (height), (fs)Bar that shows how much space is used on -# a file system. height is the height in -# pixels. fs is any file on that file -# system. -# fs_free (fs) Free space on a file system available -# for users. -# fs_free_perc (fs) Free percentage of space on a file -# system available for users. -# fs_size (fs) File system size -# fs_used (fs) File system used space -# hr (height) Horizontal line, height is the height in -# pixels -# i2c (dev), type, n I2C sensor from sysfs (Linux 2.6). dev -# may be omitted if you have only one I2C -# device. type is either in (or vol) -# meaning voltage, fan meaning fan or -# temp/tempf (first in C, second in F) -# meaning temperature. n is number of the -# sensor. See /sys/bus/i2c/devices/ on -# your local computer. -# if_running (process) if PROCESS is running, display -# everything if_running and the matching $endif -# if_existing (file) if FILE exists, display everything between -# if_existing and the matching $endif -# if_mounted (mountpoint) if MOUNTPOINT is mounted, display everything between -# if_mounted and the matching $endif -# else Text to show if any of the above are not true -# kernel Kernel version -# linkstatus (interface) Get the link status for wireless connections -# loadavg (1), (2), (3) System load average, 1 is for past 1 -# minute, 2 for past 5 minutes and 3 for -# past 15 minutes. -# machine Machine, i686 for example -# mails Mail count in mail spool. You can use -# program like fetchmail to get mails from -# some server using your favourite -# protocol. See also new_mails. -# mem Amount of memory in use -# membar (height) Bar that shows amount of memory in use -# memmax Total amount of memory -# memperc Percentage of memory in use -# -# metar_ob_time -# metar_temp -# metar_tempf Temp in F -# metar_windchill -# metar_dew_point There are a bunch of these -# metar_rh and they are self-explanatory -# metar_windspeed -# metar_winddir -# metar_swinddir -# metar_cloud -# metar_u2d_time -# -# ml_upload_counter total session upload in mb -# ml_download_counter total session download in mb -# ml_nshared_files number of shared files -# ml_shared_counter total session shared in mb, buggy -# in some mldonkey versions -# ml_tcp_upload_rate tcp upload rate in kb/s -# ml_tcp_download_rate tcp download rate in kb/s -# ml_udp_upload_rate udp upload rate in kb/s -# ml_udp_download_rate udp download rate in kb/s -# ml_ndownloaded_files number of completed files -# ml_ndownloading_files number of downloading files -# -# mpd_artist Artist in current MPD song -# (must be enabled at compile) -# mpd_album Album in current MPD song -# mpd_bar (height) Bar of mpd's progress -# mpd_bitrate Bitrate of current song -# mpd_status Playing, stopped, et cetera. -# mpd_title Title of current MPD song -# mpd_vol MPD's volume -# mpd_elapsed Song's elapsed time -# mpd_length Song's length -# mpd_percent Percent of song's progress -# new_mails Unread mail count in mail spool. -# nodename Hostname -# outlinecolor (color) Change outline color -# pre_exec shell command Executes a shell command one time before -# conky displays anything and puts output -# as text. -# processes Total processes (sleeping and running) -# running_processes Running processes (not sleeping), -# requires Linux 2.6 -# shadecolor (color) Change shading color -# stippled_hr (space), Stippled (dashed) horizontal line -# (height) -# swapbar (height) Bar that shows amount of swap in use -# swap Amount of swap in use -# swapmax Total amount of swap -# swapperc Percentage of swap in use -# sysname System name, Linux for example -# offset pixels Move text over by N pixels -# tail logfile, lines (interval) -# Displays last N lines of supplied text -# text file. If interval is not supplied, -# Conky assumes 2x Conky's interval. -# Max of 30 lines. -# Max of 30 lines can be displayed. -# time (format) Local time, see man strftime to get more -# information about format -# totaldown net Total download, overflows at 4 GB on -# Linux with 32-bit arch and there doesn't -# seem to be a way to know how many times -# it has already done that before conky -# has started. -# top type, num This takes arguments in the form: -# top -# Basically, processes are ranked from -# highest to lowest in terms of cpu -# usage, which is what represents. -# The types are: "name", "pid", "cpu", and -# "mem". -# There can be a max of 10 processes listed. -# top_mem type, num Same as top, except sorted by mem usage -# instead of cpu -# totalup net Total upload, this one too, may overflow -# updates Number of updates (for debugging) -# upspeed net Upload speed in kilobytes -# upspeedf net Upload speed in kilobytes with one -# decimal -# upspeedgraph net (height),(width) (gradient colour 1) (gradient colour 2) -# Upload speed graph, colours defined in -# hex, minus the #. -# uptime Uptime -# uptime_short Uptime in a shorter format -# -# seti_prog Seti@home current progress -# seti_progbar (height) Seti@home current progress bar -# seti_credit Seti@hoome total user credit - - # variable is given either in format $variable or in ${variable}. Latter # allows characters right after the variable and must be used in network # stuff because of an argument diff --git a/doc/command_options.xml b/doc/command_options.xml index 71fc84fa..3cc0b063 100644 --- a/doc/command_options.xml +++ b/doc/command_options.xml @@ -9,7 +9,7 @@ - Text alignment on screen, {top,bottom}_{left,right} + Text alignment on screen, {top,bottom}_{left,right} or none diff --git a/doc/config_settings.xml b/doc/config_settings.xml index 77e8b4c3..aed6fce1 100644 --- a/doc/config_settings.xml +++ b/doc/config_settings.xml @@ -2,7 +2,7 @@ - Aligned position on screen, may be top_left, top_right, bottom_left, bottom_right + Aligned position on screen, may be top_left, top_right, bottom_left, bottom_right, or none diff --git a/doc/variables.xml b/doc/variables.xml index a73905ba..54f639d0 100644 --- a/doc/variables.xml +++ b/doc/variables.xml @@ -124,7 +124,7 @@ - + Bar that shows CPU usage, height is bar's height in pixels @@ -134,7 +134,7 @@ - + CPU usage graph, with optional colours in hex, minus the #. @@ -164,7 +164,7 @@ - + Download speed graph, colours defined in hex, minus the #. @@ -230,10 +230,28 @@ - + + + + + + + Returns CPU frequency in MHz + + + + + + + + Returns CPU frequency in GHz + + + + - + Bar that shows how much space is used on a file system. height is the height in pixels. fs is any file on that file system. @@ -388,7 +406,7 @@ - + Bar that shows amount of memory in use @@ -472,8 +490,24 @@ - self-explanatory - + Windspeed in knots + + + + + + + + Windspeed in kph + + + + + + + + Windspeed in mph + @@ -623,7 +657,7 @@ - + Bar of mpd's progress @@ -772,7 +806,7 @@ - + Bar that shows amount of swap in use @@ -817,12 +851,12 @@ - - + + - Move text over by N pixels - + Move text over by N pixels. See also $voffset. + @@ -917,7 +951,7 @@ - + Upload speed graph, colours defined in hex, minus the #. @@ -954,7 +988,7 @@ - + Seti@home current progress bar @@ -969,5 +1003,15 @@ Seti@home total user credit + + + + + + + Change verticle offset by N pixels. Negative values will cause text to overlap. See also $offset. + + + \ No newline at end of file