Hack On Self: The Un-Crash Alarm

Ever get home, tired after work, sit down on a couch, and spend an hour or two sitting down without even managing to change into your home clothes? It’s a seriously unpleasant in-between state – almost comfortable, but you know you’re not really at rest, likely hungry, and even your phone battery is likely about to die. This kind of tiredness can get self-reinforcing real quick – especially if you’re too tired to cook food, or you’re stuck in an uncomfortable position. It’s like the inverse of the marshmallow test – instead of a desire, you’re dealing with lack thereof.

I’ve been dealing with this problem a lot within the last two years’ time. Day to day, I could lose hours to this kind of tiredness. It gets worse when I’m sick, and, it’s gotten worse on average after a few bouts of COVID. It’s not just tiredness, either – distractability and tiredness go hand in hand, and they play into each other, too.

My conclusion, so far, was pretty simple. When I’m tired, delayed but proper rest is way better than “resting” in a half-alert state, even if that takes effort I might not have yet. So, it’s important that I can get up, even if I’m already in a “crashed” position. Sure, I could use tricks like “do not sit down until I’m ready to rest”, but that only works sometimes – other times, the tiredness is too much to handle.

Audio files and sound playback library in hand, negative reinforcement methods fresh in my mind, I went and cooked together a very simple solution.

Anti-Crash Script

When I noticed myself being tired and in a “crash” state, I would think “oh, no worries, I’m going to get up any minute now”. Of course, it was never just a minute, and I decided to hook into that realization, subsurface but close enough that I could justify some intervention to myself.

Would you be surprised if I told you the solution was to ring a siren into my headphones? The algorithm is simple – every time I’m “crashed” and planning to get up “real soon”, I press a button that starts a five-minute timer, programmed to ring a siren into my headphones. When the seconds stop ticking and the siren triggers, I have a choice – get up and then re-trigger the alarm for five more minutes. There is no second choice, really – I don’t give myself one. The part where I get up before turning the siren off is crucial, of course – though, in case of missing willpower, an accelerometer measuring activity could do as well.

Not that much of my willpower would be required – turned out, it typically would be enough of a shock to realize just how quickly five minutes have passed. Consistently, every time I got tired, time would pass much quicker than I could feel it, and the “oh damn it’s been five minutes already” thought made for a surprisingly powerful reality check.

Initially, the script was a tiny local webserver – I had some Flask examples fresh in my mental toolbox, so I took those and wrote two tiny HTML pages, crash and uncrash. The crash page received a seconds argument, indicating how many seconds to wait before ringing the alarm, and the uncrash page stopped the alarm. Keep the two webpages open, and hit Ctrl+R on the page I need – simple enough.

Resistance Is Counterproductive

Later on, I beautified the pages a little – adding background colours, so that it’d be easy for me to find the pages in my laptop’s window switcher and not get confused between them. That was my first attempt to make the crash/uncrash “hooks” more accessible – since, unsurprisingly, having to Alt-Tab a couple times before finding the right page required some mental energy, so I would often forget about them altogether, and developing a habit of using these pages was significantly harder. Thinking back to the very first article and principles I outlined in it – reducing resistance to use was a must.

So, the “crash” webpages got turned into keybinds accessible on my laptop globally. Surprisingly, despite the crash endpoint’s arbitrary integer delay, I didn’t need much granularity. Right now, I only use three buttons , “uncrash”, “crash in 300 seconds” (5 minutes), and “crash in 1 second” (immediate). The “immediate crash” button was a surprisingly helpful one, too. See, the “oh, five minutes truly can pass quicker than expected” lesson has stuck with me – so, when I’d notice myself crashing, I knew better than to waste time trusting in the “just a few minutes” notice.

The keybinds got me to use the script more often – which has helped me find more usecases, and use it even when I’m not sick or super tired. Really, most of the trouble nowadays is noticing when I need to press the button – which, generally, is in the mornings, when I am still groggy and a scheduled appointment might not feel as important as it actually is.

One important aspect turned out to be retriggering the alarm instead of turning it off after five minutes. I get up either way, but usually, the crash doesn’t – I might “crash” immediately afterwards, or a minute-two later. Stopping the alarm ended up being a very intentional “crash is over” decision – so, the “stop” button never got into my muscle memory. I’ve indeed had muscle-memory cycle restarts, giving myself five more minutes without realizing – but I’ve never had muscle-memory stops, which is nice, because stopping the script without even realizing it would be a critical failure condition.

Retrospective: It’s Great, Somehow

Anything missing? Definitely! For one, there are some good keybinds I could add, even if maybe they wouldn’t fundamentally impact how the script is functioning. Say I’ve woken up, and I have to get somewhere early – so I use the “crash” script to get up and get with the gravity of my current situation. As I run around the house doing morning chores, five minutes pass and the alarm rings again, even though I’m currently actively doing something around the house.

Now, running back to the laptop and pressing a keybind isn’t a problem. The problem is that I could be pressing the “reset alarm” button in two different states – either I’m doing well, or I’m not, but it’s the same button. Making two different buttons, one “doing good” and one “still crashed”, would help me collect metadata I could use for a good purpose – and, quite likely, add a trigger for some sort of positive reinforcement.

Other than that? This script has eliminated yet another common failure mode from my life – and, once again, helped improve focus. It’s as simple as simple goes, and, it’s gotten me to a more comfortable point – often, making a difference between an evening lost to tiredness, and an evening of recuperation.

One thing you might notice – to actually work properly, this script requires always-on, wireless headphones. In the next article, I’ll talk about the wireless headphone device I’ve built, why I had to build one instead of buying one, and how that device has helped me solved a bunch of other problems I didn’t realize I had.

52 thoughts on “Hack On Self: The Un-Crash Alarm

    1. Seriously, this is as bad as advice can get. Yes, some people get almost magically better after ingesting psychedelics, or inhaling THC. But that’s because they are effectively applying sledge hammer to their brain.

      The same hammer can push you toward psychosis. And nobody is really sure how it’s determined. I have seen it happen myself and it’s not pleasant to say at least.

      1. yep, psychosis happens with people, sadly. the anti-drug sentiments of the western world are despicable, but, they are not silver bullets to diseases of mind and body, either. I’d recommend anyone passing to read this, and that’s for a start – there’s way more nuance to psychoactives than the zeitgeist dares admit.

        1. The feeling of what is “right” and what is actually logically reasonable have nothing to do with one another. I haven’t done LSD, but I recognize the effect from the influence of other substances, or just from having vivid dreams.

          1. Dude – no you don’t. Because I can tell from how you write that you have not lost yourself in that way. You speak, which is not a bad thing, like I did before me taking serious psychedelics.

            It’s humbling and you don’t think about your words or thoughts the same. I suggest you try it. Before I would yap on about things I learned about physics philosophy and science, expirements that proved my decisions were logical. Now I still run through the chain of reasoning but it feels superficial and small.

  1. Welcome to the world of chronic fatigue which I’m sure a doctor will insist that it’s all mental.

    Nice hack, never thought of doing this, glad to see it does provide the impetus to get up and do something. Will have to try a similar routine to see if it works for me

    1. It shocks me that people disparage mental health issues, taking personal offense and insisting it could only affect others.

      The greatest trick our brain pulled on us is convincing us it’s not part of our body and that we are little people hiding in human suits controlling it as a one way street.

      1. It’s not necessarily a feature of the brain, but the “ego” that we’ve grown to consider as ourselves, which is a cultural aspect. I hate to sound like someone peddling eastern mysticism, but there’s some merit in what they’re discussing.

        I think it was Alan Watts who asked rhetorically, do you beat your own heart? I ask, if you don’t, why does it keep beating?

  2. This is such a simple problem to solve. When I come home I plop in my favorite chair, I set my kitchen timer for 30 minutes, close my eyes and blank my mind. When the timer goes off I get up and have a productive evening. I do this every day.

    1. I prepare or buy something small and put it in the fridge, so when I get home I can just wolf it down and plop on the couch, and then sleep as long as I will without alarms. Work clothes or not – I refuse to worry about that. That deals with the immediate issue of being hungry and tired. Even if I wake up in the middle of the night, I don’t worry about it. I just read a book or browse the news and fall asleep again if that happens, until it’s time to get to work. It’s my recovery time, I do whatever I want with it.

      When I do that for a couple days, I get enough surplus energy to not crash again, so I can go to sleep at a reasonable time and wake up refreshed, eat regularly, and I can restore the normal schedule. If I push myself and work too hard, skip meals, or hang around doing “interesting stuff” way past my usual bedtime, I get exhausted and fall back to the pattern of crashing. When I notice that happening, I make the same preparations and allow myself to crash until I get better again.

      Ultimately, the trick to the whole thing is recognizing the exhaustion and avoiding it, but if it happens then there’s a way to make it better.

  3. I’m glad you’ve developed a solution that works for you, I find myself getting ‘stuck’ in much the same way you call ‘crashing’.

    I think I might benefit from an app that warns me if I’ve spent more than a few minutes doom-scrolling, more than 30 minutes without getting up and moving around, stuff like that. I find it very, very easy to muscle-memory-stop warnings, without really noticing. Mostly this shows up as my calendar having had “flush water heater sediment” on the first weekend of the month for 4 months now, and I always snooze it until I forget again.

    I just wish I could find the reason I’m routinely groggy or tired. Physician keeps saying it could be depression, or perhaps migraine symptoms as I have a family history of painless migraines. My whole generation seems to think it’s just normal for healthy adults to be tired all of the time.

    1. yeah we really ought to have more of these solutions! in particular, I have a phone and I’ve looked into doomscrolling prevention before, but alas, I have an iPhone, with its ScreenTime APIs that “prioritize privacy” to the point of being useless, with no way for me as a user to work around it. I am looking into some sort of accelerometer/gyro-backed body position&movement tracking, too – really, those would bring some much-needed context to the crash alarm, from its current straightforward mode of operation!

      And indeed, those problems can be tricky to figure out and track down. Fingers crossed you find some good leads soon! I’m currently pursuing a couple different avenues at once, both medical and environmental (GI tract functioning, exercise throughout the day, ADHD and related exhaustion management, and so on), hopefully at least one of them is fruitful.

  4. This has all the hallmarks of a technological solution for a problem that’s anything but. Please make sure to take care of your mental health and both mental and physical needs, so you’re not just staying afloat now, but also in the future.

    1. completely agree, that’s absolutely what it is! this one’s a bootstrap solution, so to say. The tricky part is, taking care of mental and physical health also requires some executive function – essentially, if you crash too early, the crash becomes self-reinforcing in so many ways. Aside from the bootstrap solution, I am absolutely tracking down the core issues – this is not how modern-day humans are expected to function, to put it bluntly.

      That said, the spirit of these articles is solving human problems in a technological way – for instance, ADHD warrants either medication or therapy, generally both, but there’s definitely technological solutions to be found, too, and I’ve certainly described a few ADHD helper tools in the previous installments!

  5. So many things wrong with this article… so many things wrong with the comments as well.

    Okay, being periodically tired during the day can have lots of causes, and it might be productive to do some experiments and see if one of the mundane causes line up with your symptoms.

    First up, do you drink coffee? And how much? Coffee has a listed half-life of 4 hours in the body, it has a known crash when it wears out, and… do you drink a cup or two at regular times and is this the cause of your crash?

    Second up, are you getting enough good sleep? Are you sitting up all night looking at screens with blue LED backgrounds (ie – your phone or TV) before going to bed? Your body needs red light, something approximating sunset, to prepare for sleep. Put off that preparation period and it happens after you go to bed but before you go to sleep. Try reading a book under an incandescent light for an hour before bedtime.

    Third up, is your “sleep hygiene” good? Do you have an old mattress and wake up with aches and pains? Is the environment too noisy, do ambulances bring you out of REM sleep every hour? Is your bedroom dark at night and allow sunlight in in the morning?

    Fourth up, does your day job require a lot of decision making or switching of gears? Our body has a bank account of [one of the neurotransmitters and I can’t remember which one right now], one evening of sleep will not completely refresh the account to full, and so day-by-day the levels get lower and lower until eventually you start the day with a low account balance and then run out during the day, but get a little better over the weekend and feel fully refreshed during a relaxing vacation. It’s why we can come home and feel completely washed out but not physically tired – our body is not evolved to handle a complex environment every day.

    Fifth and onward, is it pre-diabetes? Idiopathic post prandial syndrome?

    Are you getting enough Magnesium? Are you low in vitamin D? Try taking 5000 IU of vitamin D once or twice and see if that gives you more energy. (Note: Low vitamin D is very common.)

    Are you low in Iodine or any of the other micronutrients?

    Do you have a low-lying infection that your body can’t throw off? (Such as, for example, Lyme disease, but there are many others.)

    Really.

    Relying on a band-aid solution to compensate for an underlying medical condition is soooo American, but doesn’t address the actual problem.

    We’re a culture of scientists. List all the possible conditions, do some experiments, and see if you can eliminate all the known causes.

    You might be surprised.

    1. Just one thing to add: Leave your work and related worries in the office where they belong, don’t let your daytime job invade your leisure time. Working from home was a good thing during the pandemic, but it was later abused by both employers and employees and it has nasty long term side effects if one cannot handle it for whatever reason.

      1. This is absolutely necessary but very hard for me. Especially when I’m working down to the wire. My thoughts about work continue long after my scheduled work is done. Sometimes I have to FORCE myself to play video games in order to detach. It has to be an engaging activity so that I put my entire mind into it.

  6. You have made the classic mistake on getting positive/negative reinforcement/punishment backwards.

    Positive/negative refers to the addition/removal of input.
    Reinforcement/punishment refers to the desired behavioral result.

    You say “negative reinforcement”, which means you remove something, or keep the situation the same, to maintain the behavior, which is the exact opposite of what you then describe.

    You mean positive punishment, because you are [adding] an alarm, and your goal is to [discourage] the behavior of sitting there zoned out.

    IMO it’s a dumb convention tht only confuses people, but I don’t make the rules.

    1. Oh I’ve talked about this in my previous article! I’d say, I’m trying to talk in a way that I’m intuitively understood by an average reader – I’m not writing for the field, that’d be, a large task, I’m merely pulling “positive reinforcement” and “negative reinforcement” out of the collective consciousness. Hope I can be forgiven for making this somewhat harder to read for people with a relevant background, if that makes sense… a lot of terminology I need to invent here, anyway, guess I’m doing that all throughout.

      1. That’s fine. We can use terms any way we like as long as we define our use of them to the reader, if they differ from the proper of conventional usage. Sometimes… well, we can use that to pull rhetorical tricks to make a point or win an argument.

        The issue with pulling things out of the “collective consciousness” is always that the collective may not be what you understand it to be. Cultures, demographics and languages differ in their use of terminology.

        1. Yup. That’s why any term should be the dictionary definition, unless you define it in article.

          You never know when you reader will feel they need to look up a word, term, idiom, etc, and if you are using it in some non-standard way as a writer, you are contributing to the misunderstanding. (It’s worse if the reader then thinks they understand it, and uses it incorrectly, passing the confusion on.)

          People constantly hand waive this criticism with a “oh! But everyone understands what they mean. Why are you being pedantic?”

          Well, not everyone does understand.

  7. You need to rest and take care of yourself more; work less. You’re scraping the bottom of the barrel in terms of your productive energy and that’s why you’re “crashing”. I guarantee if you reduce your workload to 80% of what it currently is this problem will go away. An example would be switching to 4/5 time at your job. Everything in the modern world is designed to wring as much productivity out of us as possible. If you want mental health in the modern day, you need the throw the yoke. Buy less, work less, just say NO, to all of it.

  8. idk why everyone is insistent on ragging on the author for finding a hacky little solution that works for them, but good on the author for finding whats worked for them. constant tiredness, low energy, executive dysfunction issues, all just SUCK, and whatever u find that helps u work with ur deal, good on you

    1. I think it’s because the writing gives the subtle impression of selling the problem and the solution as universal instead of explicitly specifying that it’s a personal experience.

        1. It’s kind of a stylistic point. The style of the writing leans a bit on the side of those self-help articles that are really trying to sell a book. It can give people the wrong impression.

          If you have to write disclaimers about “this is my personal experience”, then you’re using the wrong emphasis in the article itself. It may be a fine edge to tread, but it’s there.

      1. You can do your own testing for diabetes and hypoglycemia, it’s not hard.

        Get a blood glucose tester from the drug store, $50, and a box of test strips (strips are specific for the type of tester you get).

        Then fast for 12 hours, mix up a sugar solution, drink it, and take measurements every 15 minutes. (Look up the dosage online, Glucose tablets are available at the drug store.)

        What I found for myself is that the sugar solution didn’t make me fall asleep, but 2 pieces of white bread knocked me out like a light switch.

        Both attempts had the same glucose rise/fall characteristic, but somehow the bread was knocking me out while the sugar solution didn’t.

        1. oh yeah I got a glucose tolerance test scheduled, but I should probably do this, too, this sounds like a wonderful way to check up on a body’s relationship to different kinds of sugars! (also, I do mean to reply to your original comment too, just that there’s a lot to reply to and I haven’t gotten enough free time yet)

        2. If bread specifically knocks you out, perhaps celiac or gluten intolerant is the case.

          I noticed I wiped out after a sandwich, though it was the cheese – turns out it was the bread – gluten free sandwich and no such problem.

          Anyway just a possibility

  9. I spend at least an hour each evening doing yoga, weights, and aerobic exercises, and paradoxically this gives me better energy levels. Haven’t had a cold in about a year or more either. I do take supplements and herbs, some of which help with energy levels and or immune system modulation. What I don’t do is risk damaging my body with new pharmaceutical products.

    1. Yoga/weights/exercise are an indispensable part of my day, too! human bodies really do tend to thrive with physical activity and stretches, generally. That said, I genuinely caution you and everyone else against weighing supplements more than you do medical treatments, it’s a silly thing to believe, as much as it’s somewhat common. Supplements are known to get way less scrutiny, especially so in USA – it’s not rare to see heavy metal levels being off the charts in certain kinds of supplements, not to mention herbal remedies, as I have heard aplenty about imported supplements discovered as grown in lead-infused soil of a third-world country. You really gotta grow your own herbs if you’re going the old school route – and I’m saying that as someone who’s been making sure to reduce my own medication requirements to the bare minimum possible. To find out which supplements you actually will benefit from, you need testing instead of blind faith – there’s some microelements you really don’t want to overdose yourself with. Pharmaceuticals have their well-earned place, especially new ones, and if you find a decent doctor willing to go the lengths with their patients and learn as they go, you will be pretty safe navigating the pharmaceutical world – which has centuries of work behind it, with more than plenty of lessons taken from the herb and supplement traditions.

  10. Thanks for sharing your experience and your solutions that work for you. I’ll politely echo what others have said above- great job finding solutions but don’t give up looking for the cause(s). Like a lot in life it’s possibly/probably multi factorial. But I’ll suggest mental hygiene could possible be a component. Too tired to function and feed yourself or even get off the sofa, again to me, smacks of depression. It manifests in different people in highly different ways. There are many ways to address it. Just something to think about or consider. Best!

  11. I agree with all of the comments about looking for the root cause, but having similar experiences to the OP, one thing I’ve found useful is the Pavlok shock band. It has several means of triggering (including a REST API), as well as several ways of disarming (jumping jacks, solve a puzzle, scan a QR code that you keep in a different room, etc.).

    Used properly, you never receive a shock – just knowing the consequence of ignoring the increasing signals (beep, vibrate, shock) seems to give your brain the push it needs to break out of the (snooze cycle, doomscrolling, whatever) and from there you are back in a position to make a rational decision about what to do next. I use it mostly as an alarm clock and it works where everything else has failed. And it keeps working – I’ve had it for 5+ years.

    So again I encourage you to keep looking for the root cause (as it sounds like you are, and so am I), but in the meantime we need to be able to function in the world with what we’ve been given. This is one tool to help do it.

    https://pavlok.com

    I am not associated with Pavlok in any way and am not being compensated in any way for this recommendation.

  12. That muscle memory stop the alarm failure mode is a real killer if it appears. Alarms basically stopped working for me once in a while because I would turn it off before awake. Even walking across the room. I ended up getting one of those pavlock alarm wrist thing that shocks you. Dude did that ever work. I would be out of my bed fully awake before my alarm went off so I could turn it off. But that also reduced the motivation to put it on at night. I’m super lucky right now to have a partner who doesn’t mind waking me up or else I’d have been fired for being late alot.

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.