Was trying to figure out a good way to have a stock price in my prompt. I thought I'd have a cron job update a file once a minute, and then read from that file every prompt. I couldn't get the cron job working. Is this a good approach anyway? I don't want to actually fetch the data every time the prompt is rendered.
I like your approach. In my own segment (see next video) I fetch data during prompt rendering and cache it in a file for 24h. I don't think this would work for you since you invalidate your cache every minute.
Table of Contents:
00:00 Intro
04:21 Alacritty vs Windows Terminal
10:06 Fonts
18:47 p10k Configuration Wizard
28:11 p10k Installation From Scratch
37:45 p10k Custom Configuration
Beautiful priceless content as always
Was trying to figure out a good way to have a stock price in my prompt. I thought I'd have a cron job update a file once a minute, and then read from that file every prompt. I couldn't get the cron job working. Is this a good approach anyway? I don't want to actually fetch the data every time the prompt is rendered.
I like your approach. In my own segment (see next video) I fetch data during prompt rendering and cache it in a file for 24h. I don't think this would work for you since you invalidate your cache every minute.