I'm looking for a way to block my computer's access to WiFi during the hours of 12 AM to 6 AM. My goal is to encourage myself to go to bed earlier instead of staying up until 3 AM. I've tried using parental controls, but that requires setting up a different user account, which feels unnecessary since I could just switch back to my main account. I've managed to set this up on my phone with app limits and website blockers, but I need help applying similar methods on my Linux system. Any tips would be greatly appreciated! Just to note, I'm using the latest version of Ubuntu.
3 Answers
Check out this resources page in the wiki; it might have some useful tips for your setup! Also, remember to take regular backups and understand each command before executing it!
Have you considered managing WiFi access directly through your router? Many routers have features that let you set schedules for when devices can connect to the internet, which might be easier than messing around with your computer settings.
You could try using `crontab -e` to set up a couple of cron jobs. Something like this:
`0 0 * * * nmcli radio wifi off`
`0 6 * * * nmcli radio wifi on`
This way, your WiFi will automatically turn off and on at the scheduled times. But honestly, if I had to depend on that to keep me off the internet, it might not work for me! I'm posting this at 2:58 AM, so I totally get it!
Haha, I'm reading this at 3:46 AM—what a coincidence!