Hi! I've been using a similar browser extension for a long time. It kept me motivated. I decided to create the same thing for the terminal where I spend a lot of time.
I did something similar that I hand wrote but it's different verses from the Bible whenever I cd into my main working location. It helps me memorize verses slowly over time and it's not too intrusive though occasionally I'll disable it before pair programming on something with a colleague since it feels inappropriate at work to force someone else to put up with it if they have qualms about it.
You can always just open a new terminal and then quickly hit ctrl-L to clear. Gives an opportunity for them to ask if they care, or to just move on otherwise.
I'm using zsh with tmux and it's a bit frustrating to have it appear on every window and every pane. At the same time if it only appears once I might miss it. Does anyone have suggestions on how to make it appear only a handful of times per day?
The problem with the RANDOM approach is that it scales with how many terminals you open on a given day. Compensating for that requires state.
I'm too lazy to write actual code right now, but here's a sketch of a possible solution that allows bursts. This is racy but safely so.
declare N, the burst size. Say, 5.
declare T, the time in seconds after which a new burst can start. Say, 3600.
declare S, the time in seconds after which a new occurrence is allowed within a burst. Say, 10.
declare P, a unique identifier. Say, the-last-sunday.
declare D, the directory to store state in. Say, /tmp/bursty-ratelimiter.
mkdir -p "$D"
if "$D/$P-central" exists and its timestamp is within the last "$S" seconds, exit the process without doing anything else (hmm, I suppose when opening multiple panes at the same time, this race might actually matter ... I guess you could use a lock if it matters that much)
touch (create and update the timestamp of) "$D/$P-central"
for I from 1 to "$N"
if "$D/$P-$I" exists and its timestamp is within the last "$T" seconds, continue with the next iteration
touch "$D/$P-$I"
run the rest of the program under load
exit the process without doing anything
I'm surprised that there's someone out there seeing it that way, and would be interested in hearing your reasons if you don't mind. Unless I'm hungover from a Saturday evening, Sunday is the day where I can be most creative and most free.
- Romans 6:3
- Proverbs 16:9
- Matthew 5:9
- Galatians 5:22
- Galatians 5:6b
- Isaiah 55:9
- Psalm 117
- Psalm 23 (this is the largest one)
- Matthew 9:37,38
I'm pretty sure I've since memorized all of these so it is time to add more verses into the mix!
I'm tempted to set up a cron job and receive daily emails.
Were you just doing shuf(1) on a text file of Bible quotes?
This is the struggle of existence.
I simplified the output a bit so it fits on 2 lines. This renderers a single progress bar the width of the terminal: https://gist.github.com/retrohacker/19978af044a080ed5677c0ea...
https://en.wikipedia.org/wiki/Memento_moriFucking terrifying.
(I moved it up to 80 years)
I'm too lazy to write actual code right now, but here's a sketch of a possible solution that allows bursts. This is racy but safely so.
If you never reboot could set up a cron job to delete it. Or store a counter in the file and output each time it reaches x % N.
Might be susceptible to race conditions, so could wrap it in a flock or something...
Or add after the command ;sleep 1;clear
to clear the screen after one second.
Deleted Comment
- I know Monday is coming, so I need to go to sleep early
- The day is shorter since I wake up late because Saturday was a long nice day, and because of previous point
- everything is closed. Not that I care much, but it limits the options of “what to do today”
Favorite day: Saturday and then Friday