Hackfetch Can Finally Fetch
Hackfetch crossed a pretty big milestone today: it actually fetches things.
The goal is simple: build a Neofetch-style dashboard for Hack Club.
Run a single command and get a snapshot of your machine alongside your Hack Club activity.
hackfetch
and instantly see information like:
- OS
- Hostname
- Username
- Shell
- Terminal
- Editor
- Hackatime
- stats
Getting the system information was the easy part. Go makes it straightforward to grab things like the current user, hostname, operating system, and environment variables.
The harder problem was rendering everything cleanly beside an ASCII logo.
Each logo has different dimensions and line lengths, so I ended up building a small layout engine that calculates the width of every logo row and pads it dynamically before printing the corresponding information. Without that, the text column slowly drifts into the logo and the entire fetch screen looks broken.
Hooking into Hackatime
The more interesting work was integrating with the Hackatime API.Hackfetch reads your API key from:
~/.wakatime.cfg
authenticates with Hackatime, and pulls fresh coding statistics every time you run the command.Right now it can display:
Today’s coding time
Weekly coding time
Current streak
Top project
Most-used language
No browser.
No dashboard.
Just a terminal command.
Comments 1
trans flag!!!!!!!!!!!!!! :3
Sign in to join the conversation.