소스 검색

[PR] dylanaraps/neofetch#2020 from yzgyyang - Add exclamation mark for uptime > 100 days

Upstream PR: https://github.com/dylanaraps/neofetch/pull/2020
Thanks to @yzgyyang

Co-authored-by: Guangyuan Yang <yzgyyang@outlook.com>
Azalea (on HyDEV-Daisy) 3 년 전
부모
커밋
497caf0bd3
1개의 변경된 파일3개의 추가작업 그리고 0개의 파일을 삭제
  1. 3 0
      neofetch

+ 3 - 0
neofetch

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