Eyes feeling sore, itchy and dry?
Does your back, neck or legs hurt?
Are you having frequent headaches?
Probably you have been sitting on computer for too long, resulting in any of the problems mentioned above. It is just too easy to forget taking a break while working on solving paramount issues or creating the next big thing, and especially when we are in flow.
Although this state of focus and involvement can be stimulating and exciting, it might harm us in the long run, resulting in health problems such as weight gain, weakened muscles, dry eyes and even Cancer!
I am starting small by following the simple 20-20-20 rule, "Every 20 minutes, look at something 20 feet away for 20 seconds." Additionally, "Every hour, stand up and get moving for few minutes".
This is a small script that I wrote, which sends me a notification whenever I logon to my computer.
Perform the following steps to get this script working (Tested on Windows 7+)
The time interval for notifications will be a bit off when you lock your system and log back in, so you need to manually restart the script each time you log on in order to start fresh. A better option is to schedule it using Windows Task scheduler.
That is it! Each time you unlock your system, a new instance for the script is run. Please comment in case of queries
Happy coding, happy living :)
Does your back, neck or legs hurt?
Are you having frequent headaches?
Probably you have been sitting on computer for too long, resulting in any of the problems mentioned above. It is just too easy to forget taking a break while working on solving paramount issues or creating the next big thing, and especially when we are in flow.
Although this state of focus and involvement can be stimulating and exciting, it might harm us in the long run, resulting in health problems such as weight gain, weakened muscles, dry eyes and even Cancer!
I am starting small by following the simple 20-20-20 rule, "Every 20 minutes, look at something 20 feet away for 20 seconds." Additionally, "Every hour, stand up and get moving for few minutes".
This is a small script that I wrote, which sends me a notification whenever I logon to my computer.
Perform the following steps to get this script working (Tested on Windows 7+)
- Install Python from https://www.python.org/ (I prefer Python 3.7 and above) and ensure it is added to PATH.
- Install Plyer via command line using:
python -m pip install plyer
. Plyer provides cross-platform wrappers for platform specific APIs. We will be using the Notification facade. - Download the script here and the icon file here, and place them together in the same directory.
- You can now run the python script using
python script.py
.
The time interval for notifications will be a bit off when you lock your system and log back in, so you need to manually restart the script each time you log on in order to start fresh. A better option is to schedule it using Windows Task scheduler.
- Start Task Scheduler from the Start Menu.
- Right click on the Task Scheduler Library in the left navigation pane and select "Create Task...".
- Triggers tab -> New -> In the "Begin the task:" drop down, select "On workstation unlock".
- Program/script -> Paste the location of python interpreter (eg.: C:\Users\abc\AppData\Local\Programs\Python\Python37-32\Scripts)
- Add arguments -> Paste the location of the python script (eg.: E:\script.py)
- Settings tab -> If the task is already running, "Stop the existing instance".
- Click OK.
That is it! Each time you unlock your system, a new instance for the script is run. Please comment in case of queries
Happy coding, happy living :)
Comments
Post a Comment