mirror of
https://github.com/Llewellynvdm/conky.git
synced 2024-12-27 12:42:41 +00:00
The --stdin-config param is kinda pointless, just use -c /dev/stdin
This commit is contained in:
parent
0a655c1ff6
commit
4426a8fa5b
22
src/conky.cc
22
src/conky.cc
@ -365,8 +365,6 @@ struct information info;
|
||||
/* path to config file */
|
||||
std::string current_config;
|
||||
|
||||
bool stdinconfig = false;
|
||||
|
||||
/* set to 1 if you want all text to be in uppercase */
|
||||
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"
|
||||
#endif /* BUILD_X11 */
|
||||
" -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"
|
||||
" -u, --interval=SECS update interval\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' },
|
||||
#endif /* BUILD_X11 */
|
||||
{ "for-scripts", 1, NULL, 's' },
|
||||
{ "stdin-config", 0, NULL, 'S' },
|
||||
{ "text", 1, NULL, 't' },
|
||||
{ "interval", 1, NULL, 'u' },
|
||||
{ "pause", 1, NULL, 'p' },
|
||||
@ -2945,21 +2941,6 @@ static const struct option longopts[] = {
|
||||
};
|
||||
|
||||
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 */
|
||||
|
||||
if (current_config.empty()) {
|
||||
@ -3221,9 +3202,6 @@ int main(int argc, char **argv)
|
||||
case 'c':
|
||||
current_config = optarg;
|
||||
break;
|
||||
case 'S':
|
||||
stdinconfig = true;
|
||||
break;
|
||||
case 'q':
|
||||
if (!freopen("/dev/null", "w", stderr))
|
||||
CRIT_ERR(0, 0, "could not open /dev/null as stderr!");
|
||||
|
Loading…
Reference in New Issue
Block a user