mirror of
https://github.com/Llewellynvdm/conky.git
synced 2024-11-05 21:07:52 +00:00
add max_length to audacious_title
git-svn-id: https://conky.svn.sourceforge.net/svnroot/conky/trunk/conky1@800 7f574dfc-610e-0410-a909-a81674777703
This commit is contained in:
parent
31ed581a28
commit
afcae6eba5
@ -4,6 +4,8 @@
|
|||||||
* Added $entropy_avail, $entropy_poolsize and $entropy_bar
|
* Added $entropy_avail, $entropy_poolsize and $entropy_bar
|
||||||
for the crypto freaks. Idea suggested by Perttu Luukko
|
for the crypto freaks. Idea suggested by Perttu Luukko
|
||||||
<nuteater@users.sourceforge.net> in feature request 1497050.
|
<nuteater@users.sourceforge.net> in feature request 1497050.
|
||||||
|
* Added max length specifier to audacious_title. Closes
|
||||||
|
feature request #1600631.
|
||||||
|
|
||||||
2006-11-28
|
2006-11-28
|
||||||
* Rearrange retry attempts in pop3 and imap code, removing sleep()
|
* Rearrange retry attempts in pop3 and imap code, removing sleep()
|
||||||
|
4
README
4
README
@ -464,8 +464,8 @@ VARIABLES
|
|||||||
Player status (Playing/Paused/Stopped/Not running)
|
Player status (Playing/Paused/Stopped/Not running)
|
||||||
|
|
||||||
|
|
||||||
audacious_title
|
audacious_title (max length)
|
||||||
Title of current tune
|
Title of current tune with optional maximum length specifier
|
||||||
|
|
||||||
|
|
||||||
battery (num)
|
battery (num)
|
||||||
|
@ -440,8 +440,8 @@ Position of current tune in seconds
|
|||||||
Player status (Playing/Paused/Stopped/Not running)
|
Player status (Playing/Paused/Stopped/Not running)
|
||||||
|
|
||||||
.TP
|
.TP
|
||||||
\fB\*(T<\fBaudacious_title\fR\*(T>\fR
|
\fB\*(T<\fBaudacious_title\fR\*(T>\fR \*(T<\fB(max length)\fR\*(T>
|
||||||
Title of current tune
|
Title of current tune with optional maximum length specifier
|
||||||
|
|
||||||
.TP
|
.TP
|
||||||
\fB\*(T<\fBbattery\fR\*(T>\fR \*(T<\fB(num)\fR\*(T>
|
\fB\*(T<\fBbattery\fR\*(T>\fR \*(T<\fB(num)\fR\*(T>
|
||||||
|
@ -223,9 +223,10 @@
|
|||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>
|
<term>
|
||||||
<command><option>audacious_title</option></command>
|
<command><option>audacious_title</option></command>
|
||||||
|
<option>(max length)</option>
|
||||||
</term>
|
</term>
|
||||||
<listitem>
|
<listitem>
|
||||||
Title of current tune
|
Title of current tune with optional maximum length specifier
|
||||||
<para></para></listitem>
|
<para></para></listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
|
19
src/conky.c
19
src/conky.c
@ -2828,7 +2828,7 @@ static struct text_object *construct_text_object(const char *s, const char *arg,
|
|||||||
END OBJ(xmms2_date, INFO_XMMS2)
|
END OBJ(xmms2_date, INFO_XMMS2)
|
||||||
END OBJ(xmms2_id, INFO_XMMS2)
|
END OBJ(xmms2_id, INFO_XMMS2)
|
||||||
END OBJ(xmms2_duration, INFO_XMMS2)
|
END OBJ(xmms2_duration, INFO_XMMS2)
|
||||||
END OBJ(xmms2_elapsed, INFO_XMMS2)
|
END OBJ(xmms2_elapsed, INFO_XMMS2)
|
||||||
END OBJ(xmms2_size, INFO_XMMS2)
|
END OBJ(xmms2_size, INFO_XMMS2)
|
||||||
END OBJ(xmms2_status, INFO_XMMS2)
|
END OBJ(xmms2_status, INFO_XMMS2)
|
||||||
END OBJ(xmms2_percent, INFO_XMMS2)
|
END OBJ(xmms2_percent, INFO_XMMS2)
|
||||||
@ -2839,7 +2839,18 @@ static struct text_object *construct_text_object(const char *s, const char *arg,
|
|||||||
#endif
|
#endif
|
||||||
#ifdef AUDACIOUS
|
#ifdef AUDACIOUS
|
||||||
OBJ(audacious_status, INFO_AUDACIOUS) END
|
OBJ(audacious_status, INFO_AUDACIOUS) END
|
||||||
OBJ(audacious_title, INFO_AUDACIOUS) END
|
OBJ(audacious_title, INFO_AUDACIOUS)
|
||||||
|
{
|
||||||
|
if (arg)
|
||||||
|
{
|
||||||
|
sscanf (arg, "%d", &info.audacious.max_title_len);
|
||||||
|
if (info.audacious.max_title_len > 0)
|
||||||
|
info.audacious.max_title_len++;
|
||||||
|
else
|
||||||
|
CRIT_ERR ("audacious_title: invalid length argument");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
END
|
||||||
OBJ(audacious_length, INFO_AUDACIOUS) END
|
OBJ(audacious_length, INFO_AUDACIOUS) END
|
||||||
OBJ(audacious_length_seconds, INFO_AUDACIOUS) END
|
OBJ(audacious_length_seconds, INFO_AUDACIOUS) END
|
||||||
OBJ(audacious_position, INFO_AUDACIOUS) END
|
OBJ(audacious_position, INFO_AUDACIOUS) END
|
||||||
@ -4430,7 +4441,9 @@ static void generate_text_internal(char *p, int p_max_size, struct text_object *
|
|||||||
snprintf(p, p_max_size, "%s", cur->audacious.items[AUDACIOUS_STATUS]);
|
snprintf(p, p_max_size, "%s", cur->audacious.items[AUDACIOUS_STATUS]);
|
||||||
}
|
}
|
||||||
OBJ(audacious_title) {
|
OBJ(audacious_title) {
|
||||||
snprintf(p, p_max_size, "%s", cur->audacious.items[AUDACIOUS_TITLE]);
|
snprintf(p, cur->audacious.max_title_len > 0 ?
|
||||||
|
cur->audacious.max_title_len : p_max_size, "%s",
|
||||||
|
cur->audacious.items[AUDACIOUS_TITLE]);
|
||||||
}
|
}
|
||||||
OBJ(audacious_length) {
|
OBJ(audacious_length) {
|
||||||
snprintf(p, p_max_size, "%s", cur->audacious.items[AUDACIOUS_LENGTH]);
|
snprintf(p, p_max_size, "%s", cur->audacious.items[AUDACIOUS_LENGTH]);
|
||||||
|
@ -170,6 +170,7 @@ struct xmms2_s {
|
|||||||
#ifdef AUDACIOUS
|
#ifdef AUDACIOUS
|
||||||
struct audacious_s {
|
struct audacious_s {
|
||||||
audacious_t items; /* e.g. items[AUDACIOUS_STATUS] */
|
audacious_t items; /* e.g. items[AUDACIOUS_STATUS] */
|
||||||
|
int max_title_len; /* e.g. ${audacious_title 50} */
|
||||||
timed_thread *p_timed_thread;
|
timed_thread *p_timed_thread;
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user