Skip to content

Instantly share code, notes, and snippets.

@SurealCereal
Created June 19, 2015 13:30
Show Gist options
  • Save SurealCereal/6d6d5ea017a71378060e to your computer and use it in GitHub Desktop.
Save SurealCereal/6d6d5ea017a71378060e to your computer and use it in GitHub Desktop.
Bash script to enable/disable the GUI on boot for Ubuntu Mate. Tested on Ubuntu Mate 15.04 on a Raspberry Pi 2 B.
#!/bin/bash
# Call with either enable or disable as first parameter
if [[ "$1" == 'enable' || "$1" == 'disable' ]]; then
sudo systemctl set-default multi-user.target --force
sudo systemctl $1 lightdm.service --force
sudo systemctl $1 graphical.target --force
sudo systemctl $1 plymouth.service --force
else
echo Call with either "enable" or "disable" as first parameter.
fi
@SurealCereal
Copy link
Author

Afterwards execute chmod +x bootgui to make the script executable.
Call with ./bootgui disable or ./bootgui enable

Thanks to "AceFace" for posting the original solution on which this script is based.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment