diff --git a/doc/help.json b/doc/help.json index da6732fbc..511099b3e 100644 --- a/doc/help.json +++ b/doc/help.json @@ -83,6 +83,16 @@ "type": "num", "default": 0 } + }, + { + "long": "watch", + "short": "w", + "desc": "Alias of dynamic-interval, but the value is in seconds instead of milliseconds. If no value is provided, it defaults to 1 second", + "arg": { + "type": "num", + "optional": true, + "default": 1 + } } ], "Config": [ diff --git a/src/fastfetch.c b/src/fastfetch.c index cad134e15..3146cefba 100644 --- a/src/fastfetch.c +++ b/src/fastfetch.c @@ -670,6 +670,12 @@ static void parseCommand(FFdata* data, char* key, char* value) { } } else if (ffStrEqualsIgnCase(key, "--dynamic-interval")) { instance.state.dynamicInterval = ffOptionParseUInt32(key, value); // seconds to milliseconds + } else if (ffStrEqualsIgnCase(key, "-w") || ffStrEqualsIgnCase(key, "--watch")) { + if (value == nullptr) { + instance.state.dynamicInterval = 1000; // default to 1 second if no value is provided + } else { + instance.state.dynamicInterval = ffOptionParseUInt32(key, value) * 1000; // seconds to milliseconds + } } else { return; }