Text only mode in Linux (No Gnome, KDE, Unity) to prolong battery life

batterycommand linedesktop-environment

If I want to disable my GUIs completely to save battery life, how would I proceed?

I know that I can hit Ctrl + Alt + F3 and be on the command line, but the desktop manager would be in the background still (I suppose).

So, after Ctrl + Alt + F3, I need three commands to:

  • tell me battery life from the command line
  • close desktop environments

Does this make sense?

Best Answer

If I want to disable my GUIs completely to save battery life, how would I proceed?

You can just disable your Display Manager (be it kde, lightdm, gdm, etc.) to run at boot, just run depending of your system:

sudo update-rc.d gdm remove
sudo update-rc.d kdm remove
sudo update-rc.d lightdm remove

With this you don't have to stop the desktop manager after booting. But if you don't want this, sudo /etc/init.d/<display_manager_name> stop will close the desktop manager after booting:

sudo service gdm stop
sudo service kdm stop
sudo service lightdm stop

This will work in any system that uses upstart, like Debian and derivatives.

In case your system uses systemd, you can use systemctl:

## All the next lines are executed as root
systemctl disable gdm ## or gdm3
systemctl disable kdm
systemctl disable lightdm
systemctl disable <name_of_the_service>

tell me battery life from the command line

For seeing your battery status you could either, install and run screen/byobu (which is a screen manager, and will show the percentage of the battery + other statistics) or running acpi -b.

close desktop environments

Check my previous response.

I know that I can hit Ctrl + Alt + F3 and be on the command line, but the desktop manager would be in the background still (I suppose).

Ctrl + Alt + F1-6 just switch you to one of the tty. All the programs you are running will continue executing on background.

Related Question