Skip to content

Commit

Permalink
Fix: float math bug
Browse files Browse the repository at this point in the history
  • Loading branch information
ssleert committed Jul 14, 2022
1 parent f39342a commit 228b819
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 9 deletions.
Binary file added nitch
Binary file not shown.
16 changes: 8 additions & 8 deletions src/funcs/drawing.nim
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ import ../nitches/[getUser, getHostname,
# the main function for drawing fetch
proc drawInfo*() =
const # icons before cotegores
userIcon: string = "" # recomended: " "
hnameIcon: string = "" # recomended: " "
distroIcon: string = "" # recomended: " "
kernelIcon: string = "" # recomended: " "
uptimeIcon: string = "" # recomended: " "
shellIcon: string = "" # recomended: " "
pkgsIcon: string = "" # recomended: " "
ramIcon: string = "" # recomended: " "
userIcon: string = "->" # recomended: " "
hnameIcon: string = "->" # recomended: " "
distroIcon: string = "->" # recomended: " "
kernelIcon: string = "->" # recomended: " "
uptimeIcon: string = "->" # recomended: " "
shellIcon: string = "->" # recomended: " "
pkgsIcon: string = "->" # recomended: " "
ramIcon: string = "->" # recomended: " "
# please insert any char after the icon
# to avoid the bug with cropping the edge of the icon

Expand Down
6 changes: 5 additions & 1 deletion src/nitches/getUptime.nim
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,8 @@ proc getUptime*(): string =
uptimeSeq: seq[string] = readFile("/proc/uptime").split(".")
uptimeHours: string = $(parseInt(uptimeSeq[0]) / 3600)

result = uptimeHours & "h"
if len(uptimeHours) > 4:
result = uptimeHours[0 .. 4] & "h"

else:
result = uptimeHours & "h"

0 comments on commit 228b819

Please sign in to comment.