1
0
mirror of https://github.com/Llewellynvdm/conky.git synced 2025-01-11 18:38:45 +00:00

Changed $font behavior so that the font persists past the next newline. It can be set back to the default with $font with no args. (closes bug 1478676 on sf.net)

git-svn-id: https://conky.svn.sourceforge.net/svnroot/conky/trunk/conky1@628 7f574dfc-610e-0410-a909-a81674777703
This commit is contained in:
Brenden Matthews 2006-05-09 23:08:23 +00:00
parent 8365978b5e
commit adbacc9f25
6 changed files with 130 additions and 121 deletions

View File

@ -1,5 +1,10 @@
# $Id$ # $Id$
2006-05-09
* Changed $font behavior so that the font persists past the next
newline. It can be set back to the default with $font with no args.
(closes bug 1478676 on sf.net)
2006-05-08 2006-05-08
* Added simple POP3/IMAP mail clients * Added simple POP3/IMAP mail clients

193
README
View File

@ -544,8 +544,11 @@ VARIABLES
Same as execigraph, but takes an interval arg graphs values Same as execigraph, but takes an interval arg graphs values
font font font (font)
Specify a different font. Only applies to one line. Specify a different font. This new font will apply to the cur-
rent line and everything following. You can use a $font with no
arguments to change back to the default font (much like with
$color)
freq Returns CPU frequency in MHz freq Returns CPU frequency in MHz
@ -555,19 +558,19 @@ VARIABLES
freq_dyn freq_dyn
Returns CPU frequency in MHz, but is calculated by counting to Returns CPU frequency in MHz, but is calculated by counting to
clock cycles to complete an instruction. Only available for clock cycles to complete an instruction. Only available for
x86/amd64. x86/amd64.
freq_dyn_g freq_dyn_g
Returns CPU frequency in GHz, but is calculated by counting to Returns CPU frequency in GHz, but is calculated by counting to
clock cycles to complete an instruction. Only available for clock cycles to complete an instruction. Only available for
x86/amd64. x86/amd64.
fs_bar (height),(width) fs fs_bar (height),(width) fs
Bar that shows how much space is used on a file system. height 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. is the height in pixels. fs is any file on that file system.
@ -588,8 +591,8 @@ VARIABLES
head logfile lines (interval) head logfile lines (interval)
Displays first N lines of supplied text text file. If interval Displays first N lines of supplied text text file. If interval
is not supplied, Conky assumes 2x Conky's interval. Max of 30 is not supplied, Conky assumes 2x Conky's interval. Max of 30
lines can be displayed, or until the text buffer is filled. lines can be displayed, or until the text buffer is filled.
@ -598,100 +601,100 @@ VARIABLES
i2c (dev) type n i2c (dev) type n
I2C sensor from sysfs (Linux 2.6). dev may be omitted if you 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 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) voltage, fan meaning fan or temp/tempf (first in C, second in F)
meaning temperature. n is number of the sensor. See meaning temperature. n is number of the sensor. See
/sys/bus/i2c/devices/ on your local computer. /sys/bus/i2c/devices/ on your local computer.
i8k_ac_status i8k_ac_status
If running the i8k kernel driver for Inspiron laptops, displays If running the i8k kernel driver for Inspiron laptops, displays
whether ac power is on, as listed in /proc/i8k (translated to whether ac power is on, as listed in /proc/i8k (translated to
human-readable). Beware that this is by default not enabled by human-readable). Beware that this is by default not enabled by
i8k itself. i8k itself.
i8k_bios i8k_bios
If running the i8k kernel driver for Inspiron laptops, displays If running the i8k kernel driver for Inspiron laptops, displays
the bios version as listed in /proc/i8k. the bios version as listed in /proc/i8k.
i8k_buttons_status i8k_buttons_status
If running the i8k kernel driver for Inspiron laptops, displays If running the i8k kernel driver for Inspiron laptops, displays
the volume buttons status as listed in /proc/i8k. the volume buttons status as listed in /proc/i8k.
i8k_cpu_temp i8k_cpu_temp
If running the i8k kernel driver for Inspiron laptops, displays If running the i8k kernel driver for Inspiron laptops, displays
the cpu temperature in Celsius, as reported by /proc/i8k. the cpu temperature in Celsius, as reported by /proc/i8k.
i8k_cpu_tempf i8k_cpu_tempf
If running the i8k kernel driver for Inspiron laptops, displays If running the i8k kernel driver for Inspiron laptops, displays
the cpu temperature in Farenheit, as reported by /proc/i8k. the cpu temperature in Farenheit, as reported by /proc/i8k.
i8k_left_fan_rpm i8k_left_fan_rpm
If running the i8k kernel driver for Inspiron laptops, displays If running the i8k kernel driver for Inspiron laptops, displays
the left fan's rate of rotation, in revolutions per minute as the left fan's rate of rotation, in revolutions per minute as
listed in /proc/i8k. Beware, some laptops i8k reports these fans listed in /proc/i8k. Beware, some laptops i8k reports these fans
in reverse order. in reverse order.
i8k_left_fan_status i8k_left_fan_status
If running the i8k kernel driver for Inspiron laptops, displays If running the i8k kernel driver for Inspiron laptops, displays
the left fan status as listed in /proc/i8k (translated to human- the left fan status as listed in /proc/i8k (translated to human-
readable). Beware, some laptops i8k reports these fans in readable). Beware, some laptops i8k reports these fans in
reverse order. reverse order.
i8k_right_fan_rpm i8k_right_fan_rpm
If running the i8k kernel driver for Inspiron laptops, displays If running the i8k kernel driver for Inspiron laptops, displays
the right fan's rate of rotation, in revolutions per minute as the right fan's rate of rotation, in revolutions per minute as
listed in /proc/i8k. Beware, some laptops i8k reports these fans listed in /proc/i8k. Beware, some laptops i8k reports these fans
in reverse order. in reverse order.
i8k_right_fan_status i8k_right_fan_status
If running the i8k kernel driver for Inspiron laptops, displays If running the i8k kernel driver for Inspiron laptops, displays
the right fan status as listed in /proc/i8k (translated to the right fan status as listed in /proc/i8k (translated to
human-readable). Beware, some laptops i8k reports these fans in human-readable). Beware, some laptops i8k reports these fans in
reverse order. reverse order.
i8k_serial i8k_serial
If running the i8k kernel driver for Inspiron laptops, displays If running the i8k kernel driver for Inspiron laptops, displays
your laptop serial number as listed in /proc/i8k. your laptop serial number as listed in /proc/i8k.
i8k_version i8k_version
If running the i8k kernel driver for Inspiron laptops, displays If running the i8k kernel driver for Inspiron laptops, displays
the version formatting of /proc/i8k. the version formatting of /proc/i8k.
if_running (process) if_running (process)
if PROCESS is running, display everything if_running and the if PROCESS is running, display everything if_running and the
matching $endif matching $endif
if_existing (file) if_existing (file)
if FILE exists, display everything between if_existing and the if FILE exists, display everything between if_existing and the
matching $endif matching $endif
if_mounted (mountpoint) if_mounted (mountpoint)
if MOUNTPOINT is mounted, display everything between if_mounted if MOUNTPOINT is mounted, display everything between if_mounted
and the matching $endif and the matching $endif
imap_messages (args) imap_messages (args)
Displays the number of messages in your global IMAP inbox by Displays the number of messages in your global IMAP inbox by
default. You can define individual IMAP inboxes seperately by default. You can define individual IMAP inboxes seperately by
passing arguments to this object. Arguments are: "host user pass passing arguments to this object. Arguments are: "host user pass
[-i interval] [-p port] [-e command]". Default port is 110, [-i interval] [-p port] [-e command]". Default port is 110,
default interval is 5 minutes. If the password is supplied as default interval is 5 minutes. If the password is supplied as
'*', you will be prompted to enter the password when Conky '*', you will be prompted to enter the password when Conky
starts. starts.
@ -699,9 +702,9 @@ VARIABLES
Displays the number of unseen messages in your global IMAP inbox Displays the number of unseen messages in your global IMAP inbox
by default. You can define individual IMAP inboxes seperately by by default. You can define individual IMAP inboxes seperately by
passing arguments to this object. Arguments are: "host user pass passing arguments to this object. Arguments are: "host user pass
[-i interval] [-p port] [-e command]". Default port is 110, [-i interval] [-p port] [-e command]". Default port is 110,
default interval is 5 minutes. If the password is supplied as default interval is 5 minutes. If the password is supplied as
'*', you will be prompted to enter the password when Conky '*', you will be prompted to enter the password when Conky
starts. starts.
@ -721,8 +724,8 @@ VARIABLES
Machine, i686 for example Machine, i686 for example
mails Mail count in mail spool. You can use program like fetchmail to mails Mail count in mail spool. You can use program like fetchmail to
get mails from some server using your favourite protocol. See get mails from some server using your favourite protocol. See
also new_mails. also new_mails.
@ -819,19 +822,19 @@ VARIABLES
pb_battery item pb_battery item
If running on Apple powerbook/ibook, display information on bat- If running on Apple powerbook/ibook, display information on bat-
tery status. The item parameter specifies, what information to tery status. The item parameter specifies, what information to
display. Exactly one item must be specified. Valid items are: display. Exactly one item must be specified. Valid items are:
status: Display if battery is fully charged, charging, discharg- status: Display if battery is fully charged, charging, discharg-
ing or absent (running on AC) ing or absent (running on AC)
percent: Display charge of battery in percent, if charging or percent: Display charge of battery in percent, if charging or
discharging. Nothing will be displayed, if battery is fully discharging. Nothing will be displayed, if battery is fully
charged or absent. charged or absent.
time: Display the time remaining until the battery will be fully time: Display the time remaining until the battery will be fully
charged or discharged at current rate. Nothing is displayed, if charged or discharged at current rate. Nothing is displayed, if
battery is absent or if it's present but fully charged and not battery is absent or if it's present but fully charged and not
discharging. discharging.
@ -839,18 +842,18 @@ VARIABLES
Displays the number of unseen messages in your global POP3 inbox Displays the number of unseen messages in your global POP3 inbox
by default. You can define individual POP3 inboxes seperately by by default. You can define individual POP3 inboxes seperately by
passing arguments to this object. Arguments are: "host user pass passing arguments to this object. Arguments are: "host user pass
[-i interval] [-p port] [-e command]". Default port is 110, [-i interval] [-p port] [-e command]". Default port is 110,
default interval is 5 minutes. If the password is supplied as default interval is 5 minutes. If the password is supplied as
'*', you will be prompted to enter the password when Conky '*', you will be prompted to enter the password when Conky
starts. starts.
pop3_used (args) pop3_used (args)
Displays the amount of space (in MiB, 2^20) used in your global Displays the amount of space (in MiB, 2^20) used in your global
POP3 inbox by default. You can define individual POP3 inboxes POP3 inbox by default. You can define individual POP3 inboxes
seperately by passing arguments to this object. Arguments are: seperately by passing arguments to this object. Arguments are:
"host user pass [-i interval] [-p port] [-e command]". Default "host user pass [-i interval] [-p port] [-e command]". Default
port is 110, default interval is 5 minutes. If the password is port is 110, default interval is 5 minutes. If the password is
supplied as '*', you will be prompted to enter the password when supplied as '*', you will be prompted to enter the password when
Conky starts. Conky starts.
@ -918,20 +921,20 @@ VARIABLES
lservice - local service name from /etc/services lservice - local service name from /etc/services
The connection index provides you with access to each connection The connection index provides you with access to each connection
in the port monitor. The monitor will return information for in the port monitor. The monitor will return information for
index values from 0 to n-1 connections. Values higher than n-1 index values from 0 to n-1 connections. Values higher than n-1
are simply ignored. For the "count" item, the connection index are simply ignored. For the "count" item, the connection index
must be omitted. It is required for all other items. must be omitted. It is required for all other items.
Examples: Examples:
${tcp_portmon 6881 6999 count} - displays the number of connec- ${tcp_portmon 6881 6999 count} - displays the number of connec-
tions in the bittorrent port range tions in the bittorrent port range
${tcp_portmon 22 22 rip 0} - displays the remote host ip of the ${tcp_portmon 22 22 rip 0} - displays the remote host ip of the
first sshd connection first sshd connection
${tcp_portmon 22 22 rip 9} - displays the remote host ip of the ${tcp_portmon 22 22 rip 9} - displays the remote host ip of the
tenth sshd connection tenth sshd connection
${tcp_portmon 1 1024 rhost 0} - displays the remote host name of ${tcp_portmon 1 1024 rhost 0} - displays the remote host name of
@ -940,22 +943,22 @@ VARIABLES
${tcp_portmon 1 1024 rport 4} - displays the remote host port of ${tcp_portmon 1 1024 rport 4} - displays the remote host port of
the fifth connection on a privileged port the fifth connection on a privileged port
${tcp_portmon 1 65535 lservice 14} - displays the local service ${tcp_portmon 1 65535 lservice 14} - displays the local service
name of the fifteenth connection in the range of all ports name of the fifteenth connection in the range of all ports
Note that port monitor variables which share the same port range Note that port monitor variables which share the same port range
actually refer to the same monitor, so many references to a sin- actually refer to the same monitor, so many references to a sin-
gle port range for different items and different indexes all use gle port range for different items and different indexes all use
the same monitor internally. In other words, the program avoids the same monitor internally. In other words, the program avoids
creating redundant monitors. creating redundant monitors.
texeci interval command texeci interval command
Runs a command at an interval inside a thread and displays the Runs a command at an interval inside a thread and displays the
output. Same as $execi, except the command is run inside a output. Same as $execi, except the command is run inside a
thread. Use this if you have a slow script to keep Conky updat- thread. Use this if you have a slow script to keep Conky updat-
ing. You should make the interval slightly longer then the time ing. You should make the interval slightly longer then the time
it takes your script to execute. For example, if you have a it takes your script to execute. For example, if you have a
script that take 5 seconds to execute, you should make the script that take 5 seconds to execute, you should make the
interval at least 6 seconds. See also $execi. interval at least 6 seconds. See also $execi.
@ -970,21 +973,21 @@ VARIABLES
time (format) time (format)
Local time, see man strftime to get more information about for- Local time, see man strftime to get more information about for-
mat mat
totaldown net totaldown net
Total download, overflows at 4 GB on Linux with 32-bit arch and 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 there doesn't seem to be a way to know how many times it has
already done that before conky has started. already done that before conky has started.
top type, num top type, num
This takes arguments in the form:top (name) (number) Basically, This takes arguments in the form:top (name) (number) Basically,
processes are ranked from highest to lowest in terms of cpu processes are ranked from highest to lowest in terms of cpu
usage, which is what (num) represents. The types are: "name", usage, which is what (num) represents. The types are: "name",
"pid", "cpu", and mem". There can be a max of 10 processes "pid", "cpu", and mem". There can be a max of 10 processes
listed. listed.
@ -1008,9 +1011,9 @@ VARIABLES
Upload speed in kilobytes with one decimal Upload speed in kilobytes with one decimal
upspeedgraph net (height),(width) (gradient colour 1) (gradient colour upspeedgraph net (height),(width) (gradient colour 1) (gradient colour
2) (scale) 2) (scale)
Upload speed graph, colours defined in hex, minus the #. If Upload speed graph, colours defined in hex, minus the #. If
scale is non-zero, it becomes the scale for the graph. scale is non-zero, it becomes the scale for the graph.
@ -1034,7 +1037,7 @@ VARIABLES
voffset (pixels) voffset (pixels)
Change vertical offset by N pixels. Negative values will cause Change vertical offset by N pixels. Negative values will cause
text to overlap. See also $offset. text to overlap. See also $offset.
@ -1047,12 +1050,12 @@ VARIABLES
xmms_channels xmms_channels
xmms / bmp / audacious / infopipe: number of audio channels of xmms / bmp / audacious / infopipe: number of audio channels of
current tune current tune
xmms_filename xmms_filename
xmms / bmp / audacious / infopipe: full path and filename of xmms / bmp / audacious / infopipe: full path and filename of
current tune current tune
@ -1062,17 +1065,17 @@ VARIABLES
xmms_length xmms_length
xmms / bmp / audacious / infopipe: total length of current tune xmms / bmp / audacious / infopipe: total length of current tune
as MM:SS as MM:SS
xmms_length_seconds xmms_length_seconds
xmms / bmp / audacious / infopipe: total length of current tune xmms / bmp / audacious / infopipe: total length of current tune
in seconds in seconds
xmms_playlist_position xmms_playlist_position
xmms / bmp / audacious / infopipe: playlist position of current xmms / bmp / audacious / infopipe: playlist position of current
tune tune
@ -1081,12 +1084,12 @@ VARIABLES
xmms_position xmms_position
xmms / bmp / audacious / infopipe: MM:SS position of current xmms / bmp / audacious / infopipe: MM:SS position of current
tune tune
xmms_position_seconds xmms_position_seconds
xmms / bmp / audacious / infopipe: position of current tune in xmms / bmp / audacious / infopipe: position of current tune in
seconds seconds
@ -1104,13 +1107,13 @@ VARIABLES
ibm_temps N ibm_temps N
If running the IBM ACPI, displays the temperatures from the IBM If running the IBM ACPI, displays the temperatures from the IBM
temperature sensors (N=0..7) Sensor 0 is on the CPU, 3 is on the temperature sensors (N=0..7) Sensor 0 is on the CPU, 3 is on the
GPU. GPU.
ibm_volume ibm_volume
If running the IBM ACPI, displays the "master" volume, con- If running the IBM ACPI, displays the "master" volume, con-
trolled by the volume keys (0-14). trolled by the volume keys (0-14).
@ -1133,11 +1136,11 @@ FILES
BUGS BUGS
Drawing to root or some other desktop window directly doesn't work with Drawing to root or some other desktop window directly doesn't work with
all window managers. Especially doesn't work well with Gnome and it has all window managers. Especially doesn't work well with Gnome and it has
been reported that it doesn't work with KDE either. Nautilus can be been reported that it doesn't work with KDE either. Nautilus can be
disabled from drawing to desktop with program gconf-editor. Uncheck disabled from drawing to desktop with program gconf-editor. Uncheck
show_desktop in /apps/nautilus/preferences/. There is -w switch in show_desktop in /apps/nautilus/preferences/. There is -w switch in
Conky to set some specific window id. You might find xwininfo -tree Conky to set some specific window id. You might find xwininfo -tree
useful to find the window to draw to. You can also use -o argument useful to find the window to draw to. You can also use -o argument
which makes Conky to create its own window. which makes Conky to create its own window.
SEE ALSO SEE ALSO
@ -1153,4 +1156,4 @@ AUTHORS
2006-04-23 conky(1) 2006-05-09 conky(1)

View File

@ -1,5 +1,5 @@
.\" -*- coding: us-ascii -*- .\" -*- coding: us-ascii -*-
.TH conky 1 2006-04-23 .TH conky 1 2006-05-09
.SH NAME .SH NAME
conky \- A system monitor for X originally based on the torsmo code, but more kickass. It just keeps on given'er. Yeah. conky \- A system monitor for X originally based on the torsmo code, but more kickass. It just keeps on given'er. Yeah.
.SH SYNOPSIS .SH SYNOPSIS
@ -497,8 +497,8 @@ Same as execbar, except with an interval
Same as execigraph, but takes an interval arg graphs values Same as execigraph, but takes an interval arg graphs values
.TP .TP
\fBfont\fR \fBfont\fR \fBfont\fR \fB(font)\fR
Specify a different font. Only applies to one line. Specify a different font. This new font will apply to the current line and everything following. You can use a $font with no arguments to change back to the default font (much like with $color)
.TP .TP
\fBfreq\fR \fBfreq\fR

View File

@ -16,7 +16,7 @@
<firstname>Brenden</firstname> <firstname>Brenden</firstname>
<surname>Matthews</surname> <surname>Matthews</surname>
</author> </author>
<date>2006-04-23</date> <date>2006-05-09</date>
</refentryinfo> </refentryinfo>
<refmeta> <refmeta>

View File

@ -354,10 +354,10 @@
<varlistentry> <varlistentry>
<term> <term>
<command><option>font</option></command> <command><option>font</option></command>
<option>font</option> <option>(font)</option>
</term> </term>
<listitem> <listitem>
Specify a different font. Only applies to one line. Specify a different font. This new font will apply to the current line and everything following. You can use a $font with no arguments to change back to the default font (much like with $color)
<para></para></listitem> <para></para></listitem>
</varlistentry> </varlistentry>

View File

@ -155,7 +155,7 @@ void free_fonts()
static void load_fonts() static void load_fonts()
{ {
int i; int i;
for (i=0;i<=font_count;i++) { for (i=0; i <= font_count; i++) {
#ifdef XFT #ifdef XFT
/* load Xft font */ /* load Xft font */
if (use_xft) { if (use_xft) {
@ -497,20 +497,30 @@ static char *scan_font(const char *args)
if (args && sizeof(args) < 127) { if (args && sizeof(args) < 127) {
return strdup(args); return strdup(args);
} }
else { /* else {
ERR("font scan failed, lets hope it doesn't mess stuff up"); ERR("font scan failed, lets hope it doesn't mess stuff up");
} we'll assume this means to use the default font now, like $color
}*/
return NULL; return NULL;
} }
#ifdef X11 #ifdef X11
static void new_font(char *buf, char * args) { static void new_font(char *buf, char * args) {
struct special_t *s = new_special(buf, FONT); if (args) {
if (!s->font_added || strcmp(args, fonts[s->font_added].name)) { struct special_t *s = new_special(buf, FONT);
if (!s->font_added || strcmp(args, fonts[s->font_added].name)) {
int tmp = selected_font;
selected_font = s->font_added = addfont(args);
load_fonts();
//set_font();
selected_font = tmp;
}
} else {
struct special_t *s = new_special(buf, FONT);
int tmp = selected_font; int tmp = selected_font;
selected_font = s->font_added = addfont(args); selected_font = s->font_added = 0;
load_fonts(); load_fonts();
// set_font(); //set_font();
selected_font = tmp; selected_font = tmp;
} }
} }
@ -1057,15 +1067,6 @@ int register_thread(struct thread_info_s *new_thread)
return thread_count - 1; return thread_count - 1;
} }
void replace_thread(struct thread_info_s *new_thread, int pos) // this isn't even used anymore; oh wells
{
if (pos >= 0 && pos < MAX_THREADS) {
thread_list[pos] = new_thread;
} else {
ERR("thread position out of bounds");
}
}
#define MAXDATASIZE 1000 #define MAXDATASIZE 1000
#define POP3 0 #define POP3 0
#define IMAP 1 #define IMAP 1
@ -4524,9 +4525,9 @@ static void text_size_updater(char *s)
text_width = maximum_width; text_width = maximum_width;
text_height += h; text_height += h;
if (fontchange) { /* if (fontchange) {
selected_font = 0; selected_font = 0;
} }*/
} }
#endif /* X11 */ #endif /* X11 */
@ -5127,9 +5128,9 @@ static void draw_line(char *s)
draw_string(s); draw_string(s);
cur_y += font_descent(); cur_y += font_descent();
if (fontchange) { /* if (fontchange) {
selected_font = 0; selected_font = 0;
} }*/
#endif /* X11 */ #endif /* X11 */
} }