You are browsing as a guest. Sign up (or log in) to start making projects!

8h 25m 29s logged

hackfetch is now TMUX + NVIM COMPATIBLE :party-11ty:

new thing today: hackfetch will just show up wherever you already look. tmux status bar. nvim statusline. any tool that can shell out to a command and put text on a screen.

The addition was simple:

hackfetch -status
prints one line:

2h 11m today · hackfetch (45m) · streak 12

just the numbers, for tools that already have their own rendering. hackfetch is a data source now, not just a display.

in tmux

two lines in ~/.tmux.conf:

set -g status-interval 60

thats it. every tmux session, every window, refreshing once a minute. i dropped it in a pink Catppuccin capsule to the left of my existing date capsule and now i cant stop glancing at it lol.

in neovim (lualine)

same story, five lines of lua:

  sections = {
    lualine_z = {
      function()
        return vim.fn.system("hackfetch -status"):gsub("\n", "")
      end
    }
  }
}

shells out on every redraw. works with airline too, or any custom statusline that lets you plug in a function.

the fun part

making hackfetch call safe for “something tmux runs every 60s forever” meant fixing three assumptions the normal fetch was making. this was way harder than it should have been ngl.

setup cant block. if you dont have ~/.wakatime.cfg, normal hackfetch throws you into an interactive setup wizard (ask me how i know). in status mode that would freeze your tmux bar until you notice and Ctrl+C it. so status mode is fully non interactive now.

no config → print nothing → tmux shows nothing → no deadlock 🙏

api errors cant leak into your bar. hackatime offline? old behavior would dump HTTP 500 timeout into your status area which looks INSANE. now status mode exits silently instead so your bar stays clean

every call has to be cheap. hackfetch’s parallel fetch alr seconds, and the shared HTTP client keeps connections alive across the 4 API calls it fires, so tmux polling every 60s is easy on the API. a proper local file cache is on the list for later but honestly not
needed for now (i’m lazy)

ship

landed in v1.9.0. if you already have it:

brew update
brew upgrade hackfetch

or arch family:

yay -Syu hackfetch-bin

(for more installs for ur specific os check out the github pls)

then drop the tmux or lualine snippet above into your dotfiles and its just there in every terminal. no plugin. no config. no daemon. just a flag.

0
42

Comments 0

No comments yet. Be the first!