2025-01-08 09:15:26 -08:00
|
|
|
#!/bin/bash
|
2024-04-17 12:10:02 -07:00
|
|
|
gui () {
|
2025-01-08 09:15:26 -08:00
|
|
|
echo switching to graphical display
|
2024-04-17 12:10:02 -07:00
|
|
|
sudo systemctl isolate graphical.target
|
2025-01-08 09:15:26 -08:00
|
|
|
echo starting display manager
|
2024-04-17 12:10:02 -07:00
|
|
|
sudo systemctl start lightdm
|
2025-01-08 09:15:26 -08:00
|
|
|
echo starting remote desktop server
|
2024-04-17 12:10:02 -07:00
|
|
|
sudo systemctl start nxserver
|
|
|
|
}
|
|
|
|
|
|
|
|
tui () {
|
2025-01-08 09:15:26 -08:00
|
|
|
echo switching to text only command line mode
|
|
|
|
echo stopping display manager
|
2024-04-17 12:10:02 -07:00
|
|
|
sudo systemctl stop lightdm
|
2025-01-08 09:15:26 -08:00
|
|
|
echo stopping graphical display
|
2024-04-17 12:10:02 -07:00
|
|
|
sudo systemctl isolate multi-user.target
|
|
|
|
sleep 3
|
2024-04-30 08:00:37 -07:00
|
|
|
sudo chvt ${VTTY:-2}
|
2025-01-08 09:15:26 -08:00
|
|
|
echo stopping remote desktop server
|
|
|
|
sudo systemctl stop nxserver
|
2024-04-17 12:10:02 -07:00
|
|
|
}
|
|
|
|
|
2025-01-08 09:15:26 -08:00
|
|
|
tui_default () {
|
|
|
|
echo curret default display target $(systemctl get-default)
|
|
|
|
echo setting boot default to command line only
|
2024-04-30 08:00:37 -07:00
|
|
|
sudo systemctl set-default multi-user.target
|
2025-01-08 09:15:26 -08:00
|
|
|
echo new default display target $(systemctl get-default)
|
2024-04-30 08:00:37 -07:00
|
|
|
}
|
|
|
|
|
2025-01-08 09:15:26 -08:00
|
|
|
gui_default () {
|
|
|
|
echo curret default display target $(systemctl get-default)
|
|
|
|
echo setting boot default to graphical
|
2024-04-30 08:00:37 -07:00
|
|
|
sudo systemctl set-default graphical.target
|
2025-01-08 09:15:26 -08:00
|
|
|
echo new default display target $(systemctl get-default)
|
|
|
|
}
|