2022-09-14 21:35:38 +00:00
|
|
|
#!/bin/bash
|
2022-10-08 23:38:08 +00:00
|
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
# Copyright (C) 2020-present Fewtarius
|
|
|
|
|
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
|
|
|
|