mirror of
https://github.com/AquaMorph/dotfiles.git
synced 2026-11-03 08:17:59 +00:00
Toggle run level
This commit is contained in:
1 parent
dee02d73d9
commit
c4e62f6db9
1 file changed
+17
@@ -0,0 +1,17 @@
|
|||||||
|
#! /bin/bash
|
||||||
|
|
||||||
|
# Script to toggle graphical
|
||||||
|
|
||||||
|
defTarget=$(systemctl get-default)
|
||||||
|
|
||||||
|
if [[ $defTarget == 'graphical.target' ]]
|
||||||
|
then
|
||||||
|
echo 'Changing default target to nongraphical shell'
|
||||||
|
sudo systemctl set-default multi-user.target
|
||||||
|
else
|
||||||
|
echo 'Changing default target to graphical shell'
|
||||||
|
sudo systemctl set-default graphical.target
|
||||||
|
fi
|
||||||
|
echo
|
||||||
|
echo 'Default target changed to '$(systemctl get-default)
|
||||||
|
echo 'Please reboot for the change to take effect'
|
||||||
Reference in new issue
Block a user