From e39182f78bbc26e8f0e50df1f8b6821900575f61 Mon Sep 17 00:00:00 2001 From: David Kebler Date: Wed, 8 Jan 2025 09:15:26 -0800 Subject: [PATCH] refactor tui/gui functions --- misc/ui | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/misc/ui b/misc/ui index 8985b39..37561c7 100644 --- a/misc/ui +++ b/misc/ui @@ -1,23 +1,35 @@ +#!/bin/bash gui () { + echo switching to graphical display sudo systemctl isolate graphical.target + echo starting display manager sudo systemctl start lightdm + echo starting remote desktop server sudo systemctl start nxserver } tui () { + echo switching to text only command line mode + echo stopping display manager sudo systemctl stop lightdm - sudo systemctl stop nxserver + echo stopping graphical display sudo systemctl isolate multi-user.target sleep 3 sudo chvt ${VTTY:-2} + echo stopping remote desktop server + sudo systemctl stop nxserver } -dtui () { - sudo systemctl disable lightdm +tui_default () { + echo curret default display target $(systemctl get-default) + echo setting boot default to command line only sudo systemctl set-default multi-user.target + echo new default display target $(systemctl get-default) } -dgui () { - sudo systemctl enable lightdm +gui_default () { + echo curret default display target $(systemctl get-default) + echo setting boot default to graphical sudo systemctl set-default graphical.target -} + echo new default display target $(systemctl get-default) +} \ No newline at end of file