Created
June 15, 2017 12:50
-
-
Save stefandz/270123b215a806abd99a412c3f80aa2c to your computer and use it in GitHub Desktop.
Enable or disable the Ubuntu Mate GUI
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [[ "$1" == 'enable' || "$1" == 'disable' ]]; then | |
if [ "$1" == 'disable' ]; then | |
systemctl set-default multi-user.target --force | |
fi | |
systemctl $1 lightdm.service --force | |
systemctl $1 graphical.target --force | |
systemctl $1 plymouth.service --force | |
if [ "$1" == 'enable' ]; then | |
if [ ! -h /etc/systemd/system/display-manager.service ]; then | |
ln -s /lib/systemd/system/lightdm.service /etc/systemd/system/display-manager.service | |
fi | |
systemctl set-default graphical.target --force | |
fi | |
else | |
echo 'Enables or disables GUI at boot.' | |
echo "Usage : $(basename) {enable | disable}" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment