summaryrefslogtreecommitdiff
path: root/src/settings.c
diff options
context:
space:
mode:
authorMichał Cichoń <michcic@gmail.com>2015-08-25 18:39:36 +0200
committerMichał Cichoń <michcic@gmail.com>2015-08-25 18:39:36 +0200
commitd5876d68f2676072834c83509f1ee79fb3c48f65 (patch)
treef21aa1ad30b9f99071c148917aa74e0f7fb98816 /src/settings.c
parent103d71ac2fb3ead96da16d25097f1f559c953fcd (diff)
downloadpianobar-windows-d5876d68f2676072834c83509f1ee79fb3c48f65.tar.gz
pianobar-windows-d5876d68f2676072834c83509f1ee79fb3c48f65.tar.bz2
pianobar-windows-d5876d68f2676072834c83509f1ee79fb3c48f65.zip
Add format_title settings to control Pianobar window title appearance.
Since I'm not aware of any standard method to set title with escape codes explicit mechanism to control window title was introduced.
Diffstat (limited to 'src/settings.c')
-rw-r--r--src/settings.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/settings.c b/src/settings.c
index 297cfbc..6ce55c9 100644
--- a/src/settings.c
+++ b/src/settings.c
@@ -128,6 +128,7 @@ void BarSettingsDestroy (BarSettings_t *settings) {
free (settings->npSongFormat);
free (settings->npStationFormat);
free (settings->listSongFormat);
+ free (settings->titleFormat);
free (settings->fifo);
free (settings->rpcHost);
free (settings->rpcTlsPort);
@@ -173,6 +174,7 @@ void BarSettingsRead (BarSettings_t *settings) {
settings->npSongFormat = strdup ("\"%t\" by \"%a\" on \"%l\"%r%@%s");
settings->npStationFormat = strdup ("Station \"%n\" (%i)");
settings->listSongFormat = strdup ("%i) %a - %t%r");
+ settings->titleFormat = strdup (TITLE " - \"%t\" by \"%a\" on \"%l\"%r%@%s");
settings->rpcHost = strdup (PIANO_RPC_HOST);
settings->rpcTlsPort = NULL;
settings->partnerUser = strdup ("android");
@@ -325,6 +327,9 @@ void BarSettingsRead (BarSettings_t *settings) {
} else if (streq ("format_list_song", key)) {
free (settings->listSongFormat);
settings->listSongFormat = strdup (val);
+ } else if (streq ("format_title", key)) {
+ free (settings->titleFormat);
+ settings->titleFormat = strdup (val);
} else if (streq ("fifo", key)) {
free (settings->fifo);
settings->fifo = BarSettingsExpandTilde (val, userhome);