1
0
mirror of https://github.com/Llewellynvdm/conky.git synced 2024-11-18 02:55:12 +00:00

The --stdin-config param is kinda pointless, just use -c /dev/stdin

This commit is contained in:
Pavel Labath 2010-09-12 13:44:15 +02:00
parent 0a655c1ff6
commit 4426a8fa5b

View File

@ -365,8 +365,6 @@ struct information info;
/* path to config file */ /* path to config file */
std::string current_config; std::string current_config;
bool stdinconfig = false;
/* set to 1 if you want all text to be in uppercase */ /* set to 1 if you want all text to be in uppercase */
static conky::simple_config_setting<bool> stuff_in_uppercase("uppercase", false, true); static conky::simple_config_setting<bool> stuff_in_uppercase("uppercase", false, true);
@ -2880,7 +2878,6 @@ static void print_help(const char *prog_name) {
" -y Y y position\n" " -y Y y position\n"
#endif /* BUILD_X11 */ #endif /* BUILD_X11 */
" -s, --for-scripts=TEXT render TEXT on stdout and exit, enclose TEXT by single quotes\n" " -s, --for-scripts=TEXT render TEXT on stdout and exit, enclose TEXT by single quotes\n"
" -S, --stdin-config read configuration from stdin\n"
" -t, --text=TEXT text to render, remember single quotes, like -t '$uptime'\n" " -t, --text=TEXT text to render, remember single quotes, like -t '$uptime'\n"
" -u, --interval=SECS update interval\n" " -u, --interval=SECS update interval\n"
" -i COUNT number of times to update "PACKAGE_NAME" (and quit)\n" " -i COUNT number of times to update "PACKAGE_NAME" (and quit)\n"
@ -2937,7 +2934,6 @@ static const struct option longopts[] = {
{ "window-id", 1, NULL, 'w' }, { "window-id", 1, NULL, 'w' },
#endif /* BUILD_X11 */ #endif /* BUILD_X11 */
{ "for-scripts", 1, NULL, 's' }, { "for-scripts", 1, NULL, 's' },
{ "stdin-config", 0, NULL, 'S' },
{ "text", 1, NULL, 't' }, { "text", 1, NULL, 't' },
{ "interval", 1, NULL, 'u' }, { "interval", 1, NULL, 'u' },
{ "pause", 1, NULL, 'p' }, { "pause", 1, NULL, 'p' },
@ -2945,21 +2941,6 @@ static const struct option longopts[] = {
}; };
void set_current_config() { void set_current_config() {
/* set configfile to stdin if that's requested or check if specified config file is valid */
if(stdinconfig) {
char mystdin[32];
#define CONKYSTDIN "/proc/%u/fd/0"
sprintf(mystdin, CONKYSTDIN, getpid());
current_config = mystdin;
} else if (not current_config.empty()) {
struct stat sb;
if (stat(current_config.c_str(), &sb) ||
(!S_ISREG(sb.st_mode) && !S_ISLNK(sb.st_mode))) {
NORM_ERR("invalid configuration file '%s'\n", current_config.c_str());
current_config.clear();
}
}
/* load current_config, CONFIG_FILE or SYSTEM_CONFIG_FILE */ /* load current_config, CONFIG_FILE or SYSTEM_CONFIG_FILE */
if (current_config.empty()) { if (current_config.empty()) {
@ -3221,9 +3202,6 @@ int main(int argc, char **argv)
case 'c': case 'c':
current_config = optarg; current_config = optarg;
break; break;
case 'S':
stdinconfig = true;
break;
case 'q': case 'q':
if (!freopen("/dev/null", "w", stderr)) if (!freopen("/dev/null", "w", stderr))
CRIT_ERR(0, 0, "could not open /dev/null as stderr!"); CRIT_ERR(0, 0, "could not open /dev/null as stderr!");