Skip to content

[ General Polish ] Open new terminal instead of prompting user #2

@cyrneko

Description

@cyrneko

read -p "Start waydroid service in a separate terminal and once running, come back here and press return"

This line asks the user to start the Waydroid service in another Terminal

We could instead first check if the system is running under systemd:

if [ "$(readlink /sbin/init)" == "/lib/systemd/systemd" ]; then
	systemctl restart waydroid-container -q
else
	read -p "Start waydroid service in a separate terminal and once running, come back here and press return"
	sleep 20s
fi
# script would continue from here...

if systemd is not available, we could try running x-terminal-emulator if it's available, and ask the user to open one manually only if none is available like this:

if [ "$(readlink /sbin/init)" == "/lib/systemd/systemd" ]; then
	systemctl restart waydroid-container -q
else
	if [ "$(which x-terminal-emulator)" == "/usr/bin/x-terminal-emulator" ]; then
		x-terminal-emulator -e waydroid container start
	else
		read -p "Start waydroid service in a separate terminal and once running, come back here and press return"
		sleep 20s
	fi
fi
# script would continue from here...

Knowing myself, there's going to be issues with this approach (or my code lol), but hey, we learn from mistakes 😉

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions