diff options
author | Lars-Dominik Braun <lars@6xq.net> | 2011-08-23 17:26:02 +0200 |
---|---|---|
committer | Lars-Dominik Braun <lars@6xq.net> | 2011-08-23 17:26:02 +0200 |
commit | b8cf55c28e131ebdcb0a32fe0e8c14fefebebcea (patch) | |
tree | ea01c8c1d9979a1f83d3b56ffb830ebdfea23c4f /src/settings.c | |
parent | df557e9c75d23a66c99a6fdad07b384f7636cb9c (diff) | |
download | pianobar-b8cf55c28e131ebdcb0a32fe0e8c14fefebebcea.tar.gz pianobar-b8cf55c28e131ebdcb0a32fe0e8c14fefebebcea.tar.bz2 pianobar-b8cf55c28e131ebdcb0a32fe0e8c14fefebebcea.zip |
Configureable fifo path
See #149.
Diffstat (limited to 'src/settings.c')
-rw-r--r-- | src/settings.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/settings.c b/src/settings.c index ea17985..49d75e6 100644 --- a/src/settings.c +++ b/src/settings.c @@ -91,6 +91,7 @@ void BarSettingsDestroy (BarSettings_t *settings) { free (settings->atIcon); free (settings->npSongFormat); free (settings->npStationFormat); + free (settings->fifo); for (size_t i = 0; i < MSG_COUNT; i++) { free (settings->msgFormat[i].prefix); free (settings->msgFormat[i].postfix); @@ -126,6 +127,8 @@ void BarSettingsRead (BarSettings_t *settings) { settings->atIcon = strdup (" @ "); settings->npSongFormat = strdup ("\"%t\" by \"%a\" on \"%l\"%r%@%s"); settings->npStationFormat = strdup ("Station \"%n\" (%i)"); + settings->fifo = malloc (PATH_MAX * sizeof (*settings->fifo)); + BarGetXdgConfigDir (PACKAGE "/ctl", settings->fifo, PATH_MAX); settings->msgFormat[MSG_NONE].prefix = NULL; settings->msgFormat[MSG_NONE].postfix = NULL; @@ -228,6 +231,9 @@ void BarSettingsRead (BarSettings_t *settings) { } else if (streq ("format_nowplaying_station", key)) { free (settings->npStationFormat); settings->npStationFormat = strdup (val); + } else if (streq ("fifo", key)) { + free (settings->fifo); + settings->fifo = strdup (val); } else if (strncmp (formatMsgPrefix, key, strlen (formatMsgPrefix)) == 0) { static const char *mapping[] = {"none", "info", "nowplaying", |