mirror of
https://github.com/moraroy/NonSteamLaunchers-On-Steam-Deck.git
synced 2024-12-21 23:31:52 +01:00
Merge branch 'main' into dependabot/pip/pytest-8.0.2
This commit is contained in:
commit
5fce5b7b61
@ -51,28 +51,35 @@ check_for_updates() {
|
|||||||
# Get the command line arguments
|
# Get the command line arguments
|
||||||
args=("$@")
|
args=("$@")
|
||||||
|
|
||||||
|
for arg in "${args[@]}"; do
|
||||||
|
if [ "$arg" = "NoPython" ]; then
|
||||||
#Download Modules
|
nopython=true
|
||||||
# Define the repository and the folders to clone
|
|
||||||
repo_url='https://github.com/moraroy/NonSteamLaunchers-On-Steam-Deck/archive/refs/heads/main.zip'
|
|
||||||
folders_to_clone=('requests' 'urllib3' 'steamgrid' 'vdf')
|
|
||||||
|
|
||||||
# Define the parent folder
|
|
||||||
logged_in_home=$(eval echo ~$user)
|
|
||||||
parent_folder="${logged_in_home}/.config/systemd/user/Modules"
|
|
||||||
mkdir -p "${parent_folder}"
|
|
||||||
|
|
||||||
# Check if the folders already exist
|
|
||||||
folders_exist=true
|
|
||||||
for folder in "${folders_to_clone[@]}"; do
|
|
||||||
if [ ! -d "${parent_folder}/${folder}" ]; then
|
|
||||||
folders_exist=false
|
|
||||||
break
|
break
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
if [ "${folders_exist}" = false ]; then
|
if ["$nopython" = false]; then
|
||||||
|
|
||||||
|
#Download Modules
|
||||||
|
# Define the repository and the folders to clone
|
||||||
|
repo_url='https://github.com/moraroy/NonSteamLaunchers-On-Steam-Deck/archive/refs/heads/main.zip'
|
||||||
|
folders_to_clone=('requests' 'urllib3' 'steamgrid' 'vdf')
|
||||||
|
|
||||||
|
# Define the parent folder
|
||||||
|
logged_in_home=$(eval echo ~$user)
|
||||||
|
parent_folder="${logged_in_home}/.config/systemd/user/Modules"
|
||||||
|
mkdir -p "${parent_folder}"
|
||||||
|
|
||||||
|
# Check if the folders already exist
|
||||||
|
folders_exist=true
|
||||||
|
for folder in "${folders_to_clone[@]}"; do
|
||||||
|
if [ ! -d "${parent_folder}/${folder}" ]; then
|
||||||
|
folders_exist=false
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
if [ "${folders_exist}" = false ]; then
|
||||||
# Download the repository as a zip file
|
# Download the repository as a zip file
|
||||||
zip_file_path="${parent_folder}/repo.zip"
|
zip_file_path="${parent_folder}/repo.zip"
|
||||||
wget -O "${zip_file_path}" "${repo_url}"
|
wget -O "${zip_file_path}" "${repo_url}"
|
||||||
@ -92,57 +99,57 @@ if [ "${folders_exist}" = false ]; then
|
|||||||
# Delete the downloaded zip file and the extracted repository folder
|
# Delete the downloaded zip file and the extracted repository folder
|
||||||
rm "${zip_file_path}"
|
rm "${zip_file_path}"
|
||||||
rm -r "${parent_folder}/NonSteamLaunchers-On-Steam-Deck-main"
|
rm -r "${parent_folder}/NonSteamLaunchers-On-Steam-Deck-main"
|
||||||
fi
|
fi
|
||||||
#End of Download Modules
|
#End of Download Modules
|
||||||
|
|
||||||
|
|
||||||
#Service File rough update
|
#Service File rough update
|
||||||
rm -rf ${logged_in_home}/.config/systemd/user/NSLGameScanner.py
|
rm -rf ${logged_in_home}/.config/systemd/user/NSLGameScanner.py
|
||||||
|
|
||||||
# Delete the service file
|
# Delete the service file
|
||||||
rm -rf ${logged_in_home}/.config/systemd/user/nslgamescanner.service
|
rm -rf ${logged_in_home}/.config/systemd/user/nslgamescanner.service
|
||||||
|
|
||||||
# Remove the symlink
|
# Remove the symlink
|
||||||
unlink ${logged_in_home}/.config/systemd/user/default.target.wants/nslgamescanner.service
|
unlink ${logged_in_home}/.config/systemd/user/default.target.wants/nslgamescanner.service
|
||||||
|
|
||||||
# Reload the systemd user instance
|
# Reload the systemd user instance
|
||||||
systemctl --user daemon-reload
|
systemctl --user daemon-reload
|
||||||
|
|
||||||
# Define your Python script path
|
# 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"
|
||||||
curl -o $python_script_path $github_link
|
curl -o $python_script_path $github_link
|
||||||
|
|
||||||
# Define the path to the env_vars file
|
# Define the path to the env_vars file
|
||||||
env_vars="${logged_in_home}/.config/systemd/user/env_vars"
|
env_vars="${logged_in_home}/.config/systemd/user/env_vars"
|
||||||
#End of Rough Update of the .py
|
#End of Rough Update of the .py
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if [ -f "$env_vars" ]; then
|
if [ -f "$env_vars" ]; then
|
||||||
echo "env_vars file found. Running the .py file."
|
echo "env_vars file found. Running the .py file."
|
||||||
live="and is LIVE."
|
live="and is LIVE."
|
||||||
else
|
else
|
||||||
echo "env_vars file not found. Not Running the .py file."
|
echo "env_vars file not found. Not Running the .py file."
|
||||||
live="and is not LIVE."
|
live="and is not LIVE."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Check if "Decky Plugin" is one of the arguments
|
# Check if "Decky Plugin" is one of the arguments
|
||||||
decky_plugin=false
|
decky_plugin=false
|
||||||
for arg in "${args[@]}"; do
|
for arg in "${args[@]}"; do
|
||||||
if [ "$arg" = "Decky Plugin" ]; then
|
if [ "$arg" = "Decky Plugin" ]; then
|
||||||
decky_plugin=true
|
decky_plugin=true
|
||||||
break
|
break
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
# If the Decky Plugin argument is set, check if the env_vars file exists
|
# If the Decky Plugin argument is set, check if the env_vars file exists
|
||||||
if [ "$decky_plugin" = true ]; then
|
if [ "$decky_plugin" = true ]; then
|
||||||
if [ -f "$env_vars" ]; then
|
if [ -f "$env_vars" ]; then
|
||||||
# If the env_vars file exists, run the .py file and continue with the script
|
# If the env_vars file exists, run the .py file and continue with the script
|
||||||
echo "Decky Plugin argument set and env_vars file found. Running the .py file..."
|
echo "Decky Plugin argument set and env_vars file found. Running the .py file..."
|
||||||
@ -153,12 +160,13 @@ if [ "$decky_plugin" = true ]; then
|
|||||||
echo "Decky Plugin argument set but env_vars file not found. Exiting the script."
|
echo "Decky Plugin argument set but env_vars file not found. Exiting the script."
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
# If the Decky Plugin argument is not set, continue with the script
|
# If the Decky Plugin argument is not set, continue with the script
|
||||||
echo "Decky Plugin argument not set. Continuing with the script..."
|
echo "Decky Plugin argument not set. Continuing with the script..."
|
||||||
python3 $python_script_path
|
python3 $python_script_path
|
||||||
echo "env_vars file found. Running the .py file."
|
echo "env_vars file found. Running the .py file."
|
||||||
live="and is LIVE."
|
live="and is LIVE."
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
@ -166,7 +174,6 @@ fi
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Check if any command line arguments were provided
|
# Check if any command line arguments were provided
|
||||||
if [ ${#args[@]} -eq 0 ]; then
|
if [ ${#args[@]} -eq 0 ]; then
|
||||||
# No command line arguments were provided, so check for updates and display the zenity window if necessary
|
# No command line arguments were provided, so check for updates and display the zenity window if necessary
|
||||||
@ -2757,31 +2764,31 @@ fi
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if ["$nopython" = false]; then
|
||||||
|
#Setup NSLGameScanner.service
|
||||||
|
python_script_path="${logged_in_home}/.config/systemd/user/NSLGameScanner.py"
|
||||||
|
|
||||||
#Setup NSLGameScanner.service
|
# Define your GitHub link
|
||||||
python_script_path="${logged_in_home}/.config/systemd/user/NSLGameScanner.py"
|
github_link="https://raw.githubusercontent.com/moraroy/NonSteamLaunchers-On-Steam-Deck/main/NSLGameScanner.py"
|
||||||
|
|
||||||
# Define your GitHub link
|
# Check if the service is already running
|
||||||
github_link="https://raw.githubusercontent.com/moraroy/NonSteamLaunchers-On-Steam-Deck/main/NSLGameScanner.py"
|
service_status=$(systemctl --user is-active nslgamescanner.service)
|
||||||
|
|
||||||
# Check if the service is already running
|
if [ "$service_status" = "active" ] || [ "$service_status" = "activating" ]
|
||||||
service_status=$(systemctl --user is-active nslgamescanner.service)
|
then
|
||||||
|
|
||||||
if [ "$service_status" = "active" ] || [ "$service_status" = "activating" ]
|
|
||||||
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
|
||||||
|
|
||||||
|
echo "Updating Python script from GitHub..."
|
||||||
|
|
||||||
|
curl -o $python_script_path $github_link
|
||||||
|
|
||||||
|
echo "Starting the service..."
|
||||||
|
|
||||||
|
python3 $python_script_path
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Updating Python script from GitHub..."
|
|
||||||
|
|
||||||
curl -o $python_script_path $github_link
|
|
||||||
|
|
||||||
echo "Starting the service..."
|
|
||||||
|
|
||||||
python3 $python_script_path
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
15
poetry.lock
generated
15
poetry.lock
generated
@ -636,13 +636,13 @@ typing = ["typing-extensions (>=4.8)"]
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "hypothesis"
|
name = "hypothesis"
|
||||||
version = "6.98.11"
|
version = "6.98.15"
|
||||||
description = "A library for property-based testing"
|
description = "A library for property-based testing"
|
||||||
optional = false
|
optional = false
|
||||||
python-versions = ">=3.8"
|
python-versions = ">=3.8"
|
||||||
files = [
|
files = [
|
||||||
{file = "hypothesis-6.98.11-py3-none-any.whl", hash = "sha256:3ec000228b0a5367255dd79a5d0ed6d9b2f395b24cf6ae334c5f4837c1380f73"},
|
{file = "hypothesis-6.98.15-py3-none-any.whl", hash = "sha256:5b40fd81fce9e0b35f0a47e10eb41f375a6b9e8551d0e1084c83b8b0d0d1bb6b"},
|
||||||
{file = "hypothesis-6.98.11.tar.gz", hash = "sha256:64d4615574ab8346a2352c595f1438adb225904df2101adbdd17e0e3d817df1c"},
|
{file = "hypothesis-6.98.15.tar.gz", hash = "sha256:1e31210951511b24ce8b3b6e04d791c466385a30ac3af571bf2223954b025d77"},
|
||||||
]
|
]
|
||||||
|
|
||||||
[package.dependencies]
|
[package.dependencies]
|
||||||
@ -1479,13 +1479,13 @@ requests = ">=2.0.1,<3.0.0"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "rich"
|
name = "rich"
|
||||||
version = "13.7.0"
|
version = "13.7.1"
|
||||||
description = "Render rich text, tables, progress bars, syntax highlighting, markdown and more to the terminal"
|
description = "Render rich text, tables, progress bars, syntax highlighting, markdown and more to the terminal"
|
||||||
optional = false
|
optional = false
|
||||||
python-versions = ">=3.7.0"
|
python-versions = ">=3.7.0"
|
||||||
files = [
|
files = [
|
||||||
{file = "rich-13.7.0-py3-none-any.whl", hash = "sha256:6da14c108c4866ee9520bbffa71f6fe3962e193b7da68720583850cd4548e235"},
|
{file = "rich-13.7.1-py3-none-any.whl", hash = "sha256:4edbae314f59eb482f54e9e30bf00d33350aaa94f4bfcd4e9e3110e64d0d7222"},
|
||||||
{file = "rich-13.7.0.tar.gz", hash = "sha256:5cb5123b5cf9ee70584244246816e9114227e0b98ad9176eede6ad54bf5403fa"},
|
{file = "rich-13.7.1.tar.gz", hash = "sha256:9be308cb1fe2f1f57d67ce99e95af38a1e2bc71ad9813b0e247cf7ffbcc3a432"},
|
||||||
]
|
]
|
||||||
|
|
||||||
[package.dependencies]
|
[package.dependencies]
|
||||||
@ -1786,4 +1786,5 @@ testing = ["big-O", "jaraco.functools", "jaraco.itertools", "more-itertools", "p
|
|||||||
[metadata]
|
[metadata]
|
||||||
lock-version = "2.0"
|
lock-version = "2.0"
|
||||||
python-versions = ">=3.11,<3.13"
|
python-versions = ">=3.11,<3.13"
|
||||||
content-hash = "5c85dfc58854912b0e26a1748146508da4ad31c4e37e71881f4d0a453e15fb81"
|
content-hash = "965313bfe930c7e75609859087048154b4b32d7222837a8fe0f8a79cc10236a4"
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user