How I force myself to take breaks
Note: This tutorial only applies to mac users and has only been tested on Mountain Lion (Mac OSX 10.8)
Habits can be hard to break. One of my worst is pushing through a days work without taking any breaks while assuming that more work = more productivity. However, this couldn’t be further from the truth. Many studies show that focused work intervals combined with frequent breaks will amount to greater productivity.
After a little bit of tinkering, I’ve come up with a hack that forces me to step away from my computer for a predetermined amount of time.
Enjoy!
Overview
The hack goes like this:
- Once activated, the script will launch the screensaver and simultaneously lock the computer.
- Next, the script launches a little command line utility changeInputthat swaps out your current keyboard layout to the Dvorak layout
- At this point, if you try to simply type in your password normally it will fail.
- Once the predetermined break time is up, changeInputwill return your keyboard to its original layout.
The key here is that you could login again during your break if you MUST. However, to do so will require a tedious process of;
- Finding a copy of the Dvorak keyboard layout (on Google via your tablet/smartphone or a printout)
- Slowly matching the location of the keys to your password on your keyboard.
During this process, you’ll have some time to think about your decision to forgo your (much needed) break.
Setup Tutorial
Screen Saver Settings
First, we need to secure our screensaver.
- Open System Preferencesand click on theSecurity & Privacyicon
- Click on the Generaltab.
- Check the box that starts with Require password.
- Change the amount of time to wait after screensaver begins to immediately.
Activate Other Keyboard Layouts
Now lets activate the alternative keyboard layout.
- In the System Preferenceswindow, click on theShow Allbutton
- Click the Language & Texticon.
- On the top of the window, click the the Input Sourcestab.
- On the left of the windows, you will now see a list of available keyboard layouts. Scroll down to find Dvorakand check the box to it’s left.
Download changeInput
This little command line tool will let us script the keyboard layout change.
- Download a copy of changeInput by Allan Craig and save it to the ~/bin/directory. > Note: You may need to create the~/bin/directory if it doesn’t already exist.
Set Up Pomodoro
- Download a copy of Pomodoro and launch the app. > The official website for Pomodoro seems to be broken at the moment, so I’ve taken the liberty of hosting the file myself for the time being.
- Open up the app’s preference window and click on the pomodoroicon
- Set the amount of minutes you would like to work under Pomodoro is initially set up to:
- Click the check box under Breaksand set thedurationnon the right.
- At the top of the window, click on the Scriptstab.
- Click the checkbox labeled End, copy the script below and paste it in the box on the right.do shell script "open /System/Library/Frameworks/ScreenSaver.framework/Versions/A/Resources/ScreenSaverEngine.app"do shell script "~/bin/changeInput > /tmp/myKeyboard"do shell script "~/bin/changeInput toggle $(cat /tmp/myKeyboard) Dvorak"
- Click the checkbox labeled Break End, copy the script below and paste it in the box on the right.do shell script "~/bin/changeInput toggle $(cat /tmp/myKeyboard) Dvorak"
- Click the Generalicon located at the top of the window.
- Check the box labeled Prevent sleep during a pomodoro
Go!
- Click on the Pomodoro icon in the menu bar and Click Start Pomodoro
- Pat yourself on the back for a job well done and get to work!
Final Thoughts
Yes, it’s a slightly convoluted process compared to just standing up and walking away, but if you need an extra push like I did, this should get the job done.