Recently I felt uncomfortable on my eyes due to long-time use of the computer and phone. Therefore, I write simple scripts on Windows and execute periodically to force me to relax every hour.
My idea is to write a batch file to minimize all working windows and pop out a message box saying something like “Leave fuck off the screen!”.
Here is the batch file running PowerShell commands.
1 | :: eye-protection.bat |
Now we can force the user to temporarily stop the ongoing work. However, it is not graceful enough to show the execution windows. Here I use another VBScript to run the batch file invisibly as follow.
1 | ' invisible.vbs |
Run eye-protection.bat
invisibly.
1 | invisible.vbs eye-protection.bat |
The last step is to run the above command periodically, said every hour. I exploit “Task Scheduler” on Windows to reach the goal.