Skip to content

Commit

Permalink
Fix: minor
Browse files Browse the repository at this point in the history
  • Loading branch information
ssleert committed Jul 14, 2022
1 parent 43f7b34 commit 7079aa1
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 23 deletions.
32 changes: 16 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,27 +103,27 @@ proc drawInfo*() =
let # all info about system
defaultLogo: string = nitchLogo # default nitch logo from nitch/src/assets/logos
userUser: string = getUser() # get user through $USER env variable
userHostname: string = getHostname() # get Hostname hostname through /etc/hostname
userDistro: string = getDistro() # get distro through /etc/os-release
userKernel: string = getKernel() # get kernel through /proc/version
userUptime: string = getUptime() # get Uptime through /proc/uptime file
userShell: string = getShell() # get shell through $SHELL env variable
userPkgs: string = getPkgs() # get amount of packages in distro
userRam: string = getRam() # get ram through /proc/meminfo
userInfo: string = getUser() # get user through $USER env variable
hostnameInfo: string = getHostname() # get Hostname hostname through /etc/hostname
distroInfo: string = getDistro() # get distro through /etc/os-release
kernelInfo: string = getKernel() # get kernel through /proc/version
uptimeInfo: string = getUptime() # get Uptime through /proc/uptime file
shellInfo: string = getShell() # get shell through $SHELL env variable
pkgsInfo: string = getPkgs() # get amount of packages in distro
ramInfo: string = getRam() # get ram through /proc/meminfo
# colored out
stdout.styledWrite(styleBright, fgRed, defaultLogo)
stdout.styledWrite(styleBright, " ╭───────────╮\n")
stdout.styledWrite(styleBright, " │ ", fgGreen, userIcon, fgDefault, userCat, fgGreen, userUser, "\n")
stdout.styledWrite(styleBright, " │ ", fgYellow, hnameIcon, fgDefault, hnameCat, fgYellow, userHostname, "\n")
stdout.styledWrite(styleBright, " │ ", fgRed, distroIcon, fgDefault, distroCat, fgRed, userDistro, "\n")
stdout.styledWrite(styleBright, " │ ", fgBlue, kernelIcon, fgDefault, kernelCat, fgBlue, userKernel, "\n")
stdout.styledWrite(styleBright, " │ ", fgCyan, uptimeIcon, fgDefault, uptimeCat, fgCyan, userUptime, "\n")
stdout.styledWrite(styleBright, " │ ", fgMagenta, shellIcon, fgDefault, shellCat, fgMagenta, userShell, "\n")
stdout.styledWrite(styleBright, " │ ", fgGreen, pkgsIcon, fgDefault, pkgsCat, fgGreen, userPkgs, "\n")
stdout.styledWrite(styleBright, " │ ", fgYellow, ramIcon, fgDefault, ramCat, fgYellow, userRam, "\n")
stdout.styledWrite(styleBright, " │ ", fgGreen, userIcon, fgDefault, userCat, fgGreen, userInfo, "\n")
stdout.styledWrite(styleBright, " │ ", fgYellow, hnameIcon, fgDefault, hnameCat, fgYellow, hostnameInfo, "\n")
stdout.styledWrite(styleBright, " │ ", fgRed, distroIcon, fgDefault, distroCat, fgRed, distroInfo, "\n")
stdout.styledWrite(styleBright, " │ ", fgBlue, kernelIcon, fgDefault, kernelCat, fgBlue, kernelInfo, "\n")
stdout.styledWrite(styleBright, " │ ", fgCyan, uptimeIcon, fgDefault, uptimeCat, fgCyan, uptimeInfo, "\n")
stdout.styledWrite(styleBright, " │ ", fgMagenta, shellIcon, fgDefault, shellCat, fgMagenta, shellInfo, "\n")
stdout.styledWrite(styleBright, " │ ", fgGreen, pkgsIcon, fgDefault, pkgsCat, fgGreen, pkgsInfo, "\n")
stdout.styledWrite(styleBright, " │ ", fgYellow, ramIcon, fgDefault, ramCat, fgYellow, ramInfo, "\n")
stdout.styledWrite(styleBright, " ╰───────────╯\n\n")
```

Expand Down
Binary file modified nitch
Binary file not shown.
6 changes: 3 additions & 3 deletions src/funcs/drawing.nim
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import std/terminal # import standard terminal lib
import ../assets/logos # import logos from nitch/src/assets/logos
import ../nitches/[getUser, getHostname,
getDistro, getKernel,
getUptime, getShell,
getPkgs, getRam] # import nitches to get info about user system
getDistro, getKernel,
getUptime, getShell,
getPkgs, getRam] # import nitches to get info about user system

# the main function for drawing fetch
proc drawInfo*() =
Expand Down
6 changes: 2 additions & 4 deletions src/nitches/getUptime.nim
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ import std/strutils
proc getUptime*(): string =
let
uptimeSeq: seq[string] = readFile("/proc/uptime").split(".")
uptimeHours: float = parseInt(uptimeSeq[0]) / 3600
uptimeHours: string = $(parseInt(uptimeSeq[0]) / 3600)

uptimeObject: string = $(int(uptimeHours * 100) / 100)

result = uptimeObject & "h"
result = uptimeHours & "h"

0 comments on commit 7079aa1

Please sign in to comment.