mirror of
https://github.com/moraroy/NonSteamLaunchers-On-Steam-Deck.git
synced 2024-11-20 08:09:18 +01:00
~only restart Steam if the DeckyPlugin is not installed
This commit is contained in:
parent
650c7d8a0f
commit
b2ad28753f
@ -2695,17 +2695,25 @@ echo "export python_version=$python_version" >> ${logged_in_home}/.config/system
|
|||||||
echo "export chromedirectory=$chromedirectory" >> ${logged_in_home}/.config/systemd/user/env_vars
|
echo "export chromedirectory=$chromedirectory" >> ${logged_in_home}/.config/systemd/user/env_vars
|
||||||
echo "export chrome_startdir=$chrome_startdir" >> ${logged_in_home}/.config/systemd/user/env_vars
|
echo "export chrome_startdir=$chrome_startdir" >> ${logged_in_home}/.config/systemd/user/env_vars
|
||||||
|
|
||||||
# Detach script from Steam process
|
|
||||||
nohup sh -c 'sleep 10; /usr/bin/steam' &
|
|
||||||
|
|
||||||
# Close all instances of Steam
|
#SteamRestartProcess
|
||||||
steam_pid() { pgrep -x steam ; }
|
|
||||||
steam_running=$(steam_pid)
|
|
||||||
[[ -n "$steam_running" ]] && killall steam
|
|
||||||
|
|
||||||
# Wait for the steam process to exit
|
# Define the directory path
|
||||||
while steam_pid > /dev/null; do sleep 5; done
|
dir_path="${logged_in_home}/homebrew/plugins/NonSteamLaunchers/"
|
||||||
|
|
||||||
|
# Check if the directory exists
|
||||||
|
if [ ! -d "$dir_path" ]; then
|
||||||
|
# Detach script from Steam process
|
||||||
|
nohup sh -c 'sleep 10; /usr/bin/steam' &
|
||||||
|
|
||||||
|
# Close all instances of Steam
|
||||||
|
steam_pid() { pgrep -x steam ; }
|
||||||
|
steam_running=$(steam_pid)
|
||||||
|
[[ -n "$steam_running" ]] && killall steam
|
||||||
|
|
||||||
|
# Wait for the steam process to exit
|
||||||
|
while steam_pid > /dev/null; do sleep 5; done
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -2739,32 +2747,31 @@ fi
|
|||||||
|
|
||||||
# TODO: might be better to relocate temp files to `/tmp` or even use `mktemp -d` since `rm -rf` is potentially dangerous without the `-i` flag
|
# TODO: might be better to relocate temp files to `/tmp` or even use `mktemp -d` since `rm -rf` is potentially dangerous without the `-i` flag
|
||||||
# Delete NonSteamLaunchersInstallation subfolder in Downloads folder
|
# Delete NonSteamLaunchersInstallation subfolder in Downloads folder
|
||||||
#rm -rf "$download_dir"
|
rm -rf "$download_dir"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#Setup NSLGameScanner.service
|
#Setup NSLGameScanner.service
|
||||||
# Define your Python script path
|
python_script_path="${logged_in_home}/.config/systemd/user/NSLGameScanner.py"
|
||||||
#python_script_path="${logged_in_home}/.config/systemd/user/NSLGameScanner.py"
|
|
||||||
|
|
||||||
# Define your GitHub link
|
# Define your GitHub link
|
||||||
#github_link="https://raw.githubusercontent.com/moraroy/NonSteamLaunchers-On-Steam-Deck/main/NSLGameScanner.py"
|
github_link="https://raw.githubusercontent.com/moraroy/NonSteamLaunchers-On-Steam-Deck/main/NSLGameScanner.py"
|
||||||
|
|
||||||
# Check if the service is already running
|
# Check if the service is already running
|
||||||
#service_status=$(systemctl --user is-active nslgamescanner.service)
|
service_status=$(systemctl --user is-active nslgamescanner.service)
|
||||||
|
|
||||||
#if [ "$service_status" = "active" ] || [ "$service_status" = "activating" ]
|
if [ "$service_status" = "active" ] || [ "$service_status" = "activating" ]
|
||||||
#then
|
then
|
||||||
#echo "Service is already running or activating. Stopping the service..."
|
echo "Service is already running or activating. Stopping the service..."
|
||||||
#systemctl --user stop nslgamescanner.service
|
systemctl --user stop nslgamescanner.service
|
||||||
#fi
|
fi
|
||||||
|
|
||||||
#echo "Updating Python script from GitHub..."
|
echo "Updating Python script from GitHub..."
|
||||||
# Download the Python script from GitHub
|
|
||||||
#curl -o $python_script_path $github_link
|
curl -o $python_script_path $github_link
|
||||||
|
|
||||||
|
echo "Starting the service..."
|
||||||
|
|
||||||
#echo "Starting the service..."
|
|
||||||
# Call your Python script
|
|
||||||
python3 $python_script_path
|
python3 $python_script_path
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user