Browse Source

Add exclamation mark for uptime > 100 days

htop has this for years, and I think it would be fun if neofetch also
matches it.

htop reference: https://github.com/htop-dev/htop/blob/1601931bbf7837a2a910b854d58716da344aeb22/UptimeMeter.c#L36
Guangyuan Yang 3 years ago
parent
commit
69df231e17
1 changed files with 3 additions and 0 deletions
  1. 3 0
      neofetch

+ 3 - 0
neofetch

@@ -1481,6 +1481,9 @@ get_uptime() {
     ((${h/ *} == 0)) && unset h
     ((${m/ *} == 0)) && unset m
 
+    # Add "(!)" if more than 100 days
+    ((${d/ *} > 100)) && d="${d}(!)"
+
     uptime=${d:+$d, }${h:+$h, }$m
     uptime=${uptime%', '}
     uptime=${uptime:-$s seconds}