Skip to content

Commit 9b0c6fd

Browse files
committed
tinyfetch.c: fix issue where ascii spacing isnt printed if wm is NULL in tinyram()
Signed-off-by: kernaltrap <[email protected]>
1 parent d6f728a commit 9b0c6fd

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

src/tinyfetch.c

+4-6
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ void format_uptime(long int uptime) {
278278
minutes = uptime / 60;
279279
seconds = uptime % 60;
280280

281-
int first = 1; // To handle the comma placement correctly
281+
int first = 1; // To handle comma placement correctly
282282

283283
if (days > 0) {
284284
printf("%d day%s", days, days > 1 ? "s" : "");
@@ -296,7 +296,8 @@ void format_uptime(long int uptime) {
296296
printf("%d minute%s", minutes, minutes > 1 ? "s" : "");
297297
first = 0;
298298
}
299-
if (seconds > 0) {
299+
if (seconds > 0 && days == 0 &&
300+
hours == 0) { // Only show seconds if under an hour
300301
if (!first)
301302
printf(", ");
302303
printf("%d second%s", seconds, seconds > 1 ? "s" : "");
@@ -804,10 +805,7 @@ void tinywm(void) {
804805

805806
void tinyram(void) {
806807
if (ascii_enable == 1) {
807-
char *wm = getenv("XDG_CURRENT_DESKTOP");
808-
if (wm != NULL) {
809-
printf("%s", tinyascii_p7);
810-
}
808+
printf("%s", tinyascii_p7);
811809
}
812810

813811
pretext(pretext_ram);

0 commit comments

Comments
 (0)