So I got a solution for you that might work!
#First you are gonna need to download the Autopoweroff package
wget https://github.com/deragon/autopoweroff/releases/download/3.0.0/autopoweroff-3.0.0-1.noarch.deb
#Then install it using
sudo dpkg -i autopoweroff-3.0.0-1.noarch.deb
sudo apt-get install -f
Then if you are using GNOME just look up autopoweroff in the activities, else go to /etc/autopoweroff/autopoweroff.conf.dpkg-new and modify the idle time as a sudo user!
If you use the file to modify the idle shutdown settings, here is what I did
[NO_SHUTDOWN_TIME_RANGE]
StartHour=
EndHour=
StartupDelay parameter (expressed in minutes):
When the computer is booting up, if all the conditions are met and
the computer is in the shutdown time range, as soon as Autopoweroff
is started, the computer will shutdown. Thus, the user will never
have the chance to boot into the computer. This is where the
"delay" parameter comes in. If "delay" is set to 15 for example,
Autopoweroff will not poweroff the computer even if all the
conditions are met, for a period of 15 minutes after the computer
has booted. This allows the user to login and change Autopoweroff's
configuration.
IdleTime parameter (expressed in minutes):
Like a screensaver, Autopoweroff detects keyboard and mouse
activity, and if there is any activity on the server, it would not
be powered off regardless if all the other conditions are met. If
set to 0, user activity on the server will be ignored.
[TIMEOUTS]
StartupDelay=5
IdleTime=30
#Part of the info was obtained here
https://www.ostechnix.com/auto-shutdown-reboot-suspend-hibernate-linux-system-specific-time/
man shutdown
. – mikewhatever Jul 04 '20 at 19:03