Glad to hear. There is more to consider, though.
These are per user settings. So, if you have more than one user account set up on your system, you need to run these 2 commands for each user.
Then there is the issue of GDM. After booting, the system runs the display manager (where you enter your user credentials to log in). For GNOME, the display manager is called GDM.
GDM has it's settings of it's own. The default setting is to suspend computer if you haven't logged in within 5 minutes after boot.
These settings can only be changed as "gdm" user.
To do so, open an terminal and run:
sudo su - gdm -s /bin/sh
to become gdm user. Then run
gsettings get org.gnome.settings-daemon.plugins.power sleep-inactive-ac-type
and
gsettings get org.gnome.settings-daemon.plugins.power sleep-inactive-battery-type
to see what is set. I expect both commands to output 'suspend'
To get a list of valid values, you can run
gsettings range org.gnome.settings-daemon.plugins.power sleep-inactive-ac-type
You can now either chose to set GDM inactivity behaviour either to 'nothing' or 'hibernate'
to do so, run
dbus-launch --exit-with-session gsettings set org.gnome.settings-daemon.plugins.power sleep-inactive-ac-type 'nothing'
(or hibernate) and
dbus-launch --exit-with-session gsettings set org.gnome.settings-daemon.plugins.power sleep-inactive-battery-type 'nothing'
(or hibernate)
To check if settings have been altered succesfully, you can again run
gsettings get org.gnome.settings-daemon.plugins.power sleep-inactive-ac-type
and
gsettings get org.gnome.settings-daemon.plugins.power sleep-inactive-battery-type
and check output.
then enter exit
to quit acting as gdm user.
The power/logout menu in quick settings in right corner in top bar will still list "suspend" option.
You can adjust this by installing and configuring(with extensions app) this extension:
https://extensions.gnome.org/extension/755/hibernate-status-button/
edit: ignore the comment on the extension page where a user suggest to modify /etc/polkit-1/rules.d/10-enable-hibernate.rules
. This doesn't seem to be necessary according to arch linux forum