This script will automatically nag you to get away from your computer after a certain period of time each day.
It will:
- Check how long you have been active on your machine using ActivityWatch.
- See if you have been longer than a certain amount of time.
- If above that time, it will ask you to confirm if you want to continue on you machine.
- If you say no, your machine will automatically suspend.
- A bash shell
- Ability to run cron or some mechanism to schedule bash scripts
- Activity Watch installed and running
- Zenity installed and running
- Download the script and make executable with
chmod +x activitynag.sh
- Add to your crontab with whatever interval you desire and make sure to export display correct for zenity to work. So to check/nag every minute add:
* * * * * export DISPLAY=:0 && ~/bin/activitynag.sh