diff options
| author | TheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com> | 2026-04-28 15:42:50 +0900 |
|---|---|---|
| committer | TheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com> | 2026-04-28 15:42:50 +0900 |
| commit | ae78dbbff81196f1d7bc8fabf84d05e6b9f3ca03 (patch) | |
| tree | fdc69ee3e2772aa4db7e8efe4bd30d101c7f82ac /fedora/.local/bin/htop-vim/UptimeMeter.c | |
| parent | 06ad645351572c0e7188c52028998384d718df2e (diff) | |
Diffstat (limited to 'fedora/.local/bin/htop-vim/UptimeMeter.c')
| -rw-r--r-- | fedora/.local/bin/htop-vim/UptimeMeter.c | 60 |
1 files changed, 0 insertions, 60 deletions
diff --git a/fedora/.local/bin/htop-vim/UptimeMeter.c b/fedora/.local/bin/htop-vim/UptimeMeter.c deleted file mode 100644 index d4b3175..0000000 --- a/fedora/.local/bin/htop-vim/UptimeMeter.c +++ /dev/null @@ -1,60 +0,0 @@ -/* -htop - UptimeMeter.c -(C) 2004-2011 Hisham H. Muhammad -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - -#include "UptimeMeter.h" - -#include "CRT.h" -#include "Object.h" -#include "Platform.h" -#include "XUtils.h" - - -static const int UptimeMeter_attributes[] = { - UPTIME -}; - -static void UptimeMeter_updateValues(Meter* this) { - int totalseconds = Platform_getUptime(); - if (totalseconds <= 0) { - xSnprintf(this->txtBuffer, sizeof(this->txtBuffer), "(unknown)"); - return; - } - int seconds = totalseconds % 60; - int minutes = (totalseconds / 60) % 60; - int hours = (totalseconds / 3600) % 24; - int days = (totalseconds / 86400); - this->values[0] = days; - if (days > this->total) { - this->total = days; - } - char daysbuf[32]; - if (days > 100) { - xSnprintf(daysbuf, sizeof(daysbuf), "%d days(!), ", days); - } else if (days > 1) { - xSnprintf(daysbuf, sizeof(daysbuf), "%d days, ", days); - } else if (days == 1) { - xSnprintf(daysbuf, sizeof(daysbuf), "1 day, "); - } else { - daysbuf[0] = '\0'; - } - xSnprintf(this->txtBuffer, sizeof(this->txtBuffer), "%s%02d:%02d:%02d", daysbuf, hours, minutes, seconds); -} - -const MeterClass UptimeMeter_class = { - .super = { - .extends = Class(Meter), - .delete = Meter_delete - }, - .updateValues = UptimeMeter_updateValues, - .defaultMode = TEXT_METERMODE, - .maxItems = 1, - .total = 100.0, - .attributes = UptimeMeter_attributes, - .name = "Uptime", - .uiName = "Uptime", - .caption = "Uptime: " -}; |
