2022-09-14 21:35:38 +00:00
|
|
|
#!/bin/bash
|
2023-10-23 22:44:47 +00:00
|
|
|
# SPDX-License-Identifier: GPL-2.0
|
2023-10-24 16:00:57 +00:00
|
|
|
# Copyright (C) 2023 JELOS (https://github.com/JustEnoughLinuxOS)
|
2022-10-08 23:38:08 +00:00
|
|
|
|
2022-09-14 21:35:38 +00:00
|
|
|
. /etc/profile
|
|
|
|
|
2023-04-16 23:31:51 +00:00
|
|
|
ui_state() {
|
|
|
|
clear >/dev/console 2>&1
|
|
|
|
systemctl ${1} ${UI_SERVICE}
|
|
|
|
}
|
|
|
|
|
2022-09-14 21:35:38 +00:00
|
|
|
if [ "${UI_SERVICE}" = "weston.service" ]
|
|
|
|
then
|
2022-11-03 01:43:14 +00:00
|
|
|
if [ -f "${*}" ]
|
|
|
|
then
|
|
|
|
RUN=$(echo ${*} | sed 's# #\\ #g')
|
|
|
|
weston-terminal --command="${RUN}"
|
|
|
|
else
|
|
|
|
weston-terminal --command="${*}"
|
|
|
|
fi
|
2022-09-14 21:35:38 +00:00
|
|
|
else
|
2023-04-16 23:31:51 +00:00
|
|
|
ui_state stop
|
2022-10-09 19:13:24 +00:00
|
|
|
clear >/dev/console 2>&1
|
2023-04-16 23:31:51 +00:00
|
|
|
$* >/dev/console 2>&1
|
|
|
|
if [ "$?" == 0 ]
|
|
|
|
then
|
|
|
|
ui_state start
|
|
|
|
exit 0
|
|
|
|
else
|
|
|
|
"$*" >/dev/console 2>&1
|
|
|
|
ui_state start
|
|
|
|
exit 0
|
|
|
|
fi
|
2022-09-14 21:35:38 +00:00
|
|
|
fi
|
2023-04-16 23:31:51 +00:00
|
|
|
|