refactor tui/gui functions
This commit is contained in:
parent
7acd29cba2
commit
e39182f78b
1 changed files with 18 additions and 6 deletions
24
misc/ui
24
misc/ui
|
@ -1,23 +1,35 @@
|
||||||
|
#!/bin/bash
|
||||||
gui () {
|
gui () {
|
||||||
|
echo switching to graphical display
|
||||||
sudo systemctl isolate graphical.target
|
sudo systemctl isolate graphical.target
|
||||||
|
echo starting display manager
|
||||||
sudo systemctl start lightdm
|
sudo systemctl start lightdm
|
||||||
|
echo starting remote desktop server
|
||||||
sudo systemctl start nxserver
|
sudo systemctl start nxserver
|
||||||
}
|
}
|
||||||
|
|
||||||
tui () {
|
tui () {
|
||||||
|
echo switching to text only command line mode
|
||||||
|
echo stopping display manager
|
||||||
sudo systemctl stop lightdm
|
sudo systemctl stop lightdm
|
||||||
sudo systemctl stop nxserver
|
echo stopping graphical display
|
||||||
sudo systemctl isolate multi-user.target
|
sudo systemctl isolate multi-user.target
|
||||||
sleep 3
|
sleep 3
|
||||||
sudo chvt ${VTTY:-2}
|
sudo chvt ${VTTY:-2}
|
||||||
|
echo stopping remote desktop server
|
||||||
|
sudo systemctl stop nxserver
|
||||||
}
|
}
|
||||||
|
|
||||||
dtui () {
|
tui_default () {
|
||||||
sudo systemctl disable lightdm
|
echo curret default display target $(systemctl get-default)
|
||||||
|
echo setting boot default to command line only
|
||||||
sudo systemctl set-default multi-user.target
|
sudo systemctl set-default multi-user.target
|
||||||
|
echo new default display target $(systemctl get-default)
|
||||||
}
|
}
|
||||||
|
|
||||||
dgui () {
|
gui_default () {
|
||||||
sudo systemctl enable lightdm
|
echo curret default display target $(systemctl get-default)
|
||||||
|
echo setting boot default to graphical
|
||||||
sudo systemctl set-default graphical.target
|
sudo systemctl set-default graphical.target
|
||||||
}
|
echo new default display target $(systemctl get-default)
|
||||||
|
}
|
Loading…
Reference in a new issue