Hey guys how could I autoshutdown Ubuntu when it is idle for more than 30 minutes?
Autosuspend leaves the PC really slow at times.
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It only takes a minute to sign up.Sign up to join this community
If you are using a recent version of Ubuntu Desktop, you can configure this pretty quickly using
dconf-editor. Here's how:
dconf-editor if it is not already present:
sudo apt update sudo apt install dconf-editor
Click the magnifying glass to start a search, and type "sleep-inactive":
sleep-inactive-ac-timeout value to
1800 (30 Minutes):
sleep-inactive-ac-type value to
shutdown (or something else you might prefer):
Be sure to save your changes.
That's all there is to it.
matigo's answer works and is pretty easy, but if you prefer the command line, you can do the same with the following commands:
gsettings set org.gnome.settings-daemon.plugins.power sleep-inactive-ac-timeout 1800 gsettings set org.gnome.settings-daemon.plugins.power sleep-inactive-ac-type 'shutdown'