-
-
Notifications
You must be signed in to change notification settings - Fork 80
Expand file tree
/
Copy pathNonSteamLaunchers.sh
More file actions
executable file
·4351 lines (3419 loc) · 183 KB
/
NonSteamLaunchers.sh
File metadata and controls
executable file
·4351 lines (3419 loc) · 183 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#!/usr/bin/env bash
set -x # activate debugging (execution shown)
set -o pipefail # capture error from pipes
# ENVIRONMENT VARIABLES
# Get the logged-in user, fallback to whoami if needed
logged_in_user=$(logname 2>/dev/null || whoami)
# DBUS
# Add the DBUS_SESSION_BUS_ADDRESS environment variable if missing
if [[ -z "$DBUS_SESSION_BUS_ADDRESS" ]]; then
eval "$(dbus-launch --sh-syntax)"
fi
# Try Zenity notification, fallback if it fails
if ! zenity --notification --text="NonSteamLaunchers is running tests..." >/dev/null 2>&1; then
export GSK_RENDERER=cairo
export GDK_BACKEND=x11
export LIBGL_ALWAYS_SOFTWARE=1
fi
# Set LD_LIBRARY_PATH to current directory (prepend if you want to keep existing)
export LD_LIBRARY_PATH="$(pwd):${LD_LIBRARY_PATH:-}"
# Get logged-in user's UID and HOME directory
logged_in_uid=$(id -u "${logged_in_user}")
logged_in_home=$(eval echo "~${logged_in_user}")
# Setup download directory and log file path
download_dir="${logged_in_home}/Downloads/NonSteamLaunchersInstallation"
log_file="${logged_in_home}/Downloads/NonSteamLaunchers-install.log"
#Cleaning
# Define the path to the compatdata directory
compatdata_dir="${logged_in_home}/.local/share/Steam/steamapps/compatdata"
# Define the NonSteamLaunchers directory path for cleaning .tmp files
non_steam_launchers_dir="${compatdata_dir}/NonSteamLaunchers/pfx/drive_c/"
# Define an array of folder names
folder_names=("NonSteamLaunchers" "EpicGamesLauncher" "GogGalaxyLauncher" "UplayLauncher" "Battle.netLauncher" "TheEAappLauncher" "AmazonGamesLauncher" "itchioLauncher" "LegacyGamesLauncher" "HumbleGamesLauncher" "IndieGalaLauncher" "RockstarGamesLauncher" "GlyphLauncher" "PlaystationPlusLauncher" "VKPlayLauncher" "HoYoPlayLauncher" "NexonLauncher" "GameJoltLauncher" "ArtixGameLauncher" "ARCLauncher" "PokeTCGLauncher" "AntstreamLauncher" "PURPLELauncher" "PlariumLauncher" "VFUNLauncher" "TempoLauncher" "BigFishLauncher" "GryphlinkLauncher")
# Cleaning up empty directories in compatdata (maxdepth 1 to avoid subdirectories)
echo "Cleaning up empty directories in $compatdata_dir..."
find "${compatdata_dir}" -maxdepth 1 -type d -empty -delete
echo "Empty directories cleaned up."
# Cleaning up .tmp files in the NonSteamLaunchers directory
echo "Cleaning up .tmp files in $non_steam_launchers_dir..."
find "${non_steam_launchers_dir}" -maxdepth 1 -type f -name "*.tmp" -delete
echo ".tmp files cleaned up."
# Loop through each folder name for symlink checking and deletion
for folder in "${folder_names[@]}"; do
SYMLINK="$compatdata_dir/$folder"
# Check if it's a symlink and if the target is broken
if [ -L "$SYMLINK" ] && [ ! -e "$(readlink "$SYMLINK")" ]; then
echo "The symlink $SYMLINK is broken. Deleting it..."
# Delete the broken symlink
rm "$SYMLINK"
echo "Symlink $SYMLINK deleted successfully."
else
echo "The symlink $SYMLINK is either not a symlink or not broken. No action taken."
fi
# Check if the folder exists and clean up any .tmp files in it if applicable
TARGET_DIR="$compatdata_dir/$folder/pfx/drive_c/"
if [ -d "$TARGET_DIR" ]; then
echo "Cleaning up .tmp files in $TARGET_DIR..."
find "$TARGET_DIR" -maxdepth 1 -type f -name "*.tmp" -delete
echo ".tmp files cleaned up in $TARGET_DIR."
else
echo "No valid directory found for $folder at $TARGET_DIR. No .tmp cleanup needed."
fi
done
echo "Cleanup completed!"
# Remove existing log file if it exists
if [[ -f $log_file ]]; then
rm $log_file
fi
# Redirect all output to the log file
exec > >(tee -a "$log_file") 2>&1
# Version number (major.minor)
version=v4.2.89
#NSL Decky Plugin Latest Github Version
deckyversion=$(curl -s https://raw.githubusercontent.com/moraroy/NonSteamLaunchersDecky/refs/heads/main/package.json | grep -o '"version": "[^"]*' | sed 's/"version": "//')
# Function to display a Zenity message
show_message() {
zenity --notification --text="$1" --timeout=1
}
# Check repo releases via GitHub API then display current stable version
check_for_updates() {
local api_url="https://api.github.com/repos/moraroy/NonSteamLaunchers-On-Steam-Deck/releases/latest"
local latest_version=$(curl -s "$api_url" | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/')
if [ "$version" != "$latest_version" ]; then
zenity --info --text="A new version is available: $latest_version\nPlease download it from GitHub." --width=200 --height=100 --timeout=5
else
echo "You are already running the latest version: $version"
fi
}
# Check if Zenity is installed
if ! command -v zenity &> /dev/null; then
echo "Zenity is not installed. Installing Zenity..."
if command -v apt-get &> /dev/null; then
sudo apt-get install -y zenity
elif command -v dnf &> /dev/null; then
sudo dnf install -y zenity
elif command -v pacman &> /dev/null; then
sudo pacman -S --noconfirm zenity
else
echo "Unknown package manager. Please install Zenity manually."
exit 1
fi
fi
# Check if Steam is installed (non-flatpak)
if ! command -v steam &> /dev/null; then
echo "Steam is not installed. Please install the non-flatpak version of Steam."
# Provide instructions for different package managers:
if command -v apt-get &> /dev/null; then
echo "To install Steam on a Debian-based system (e.g., Ubuntu, Pop!_OS), run:"
echo " sudo apt update && sudo apt install steam"
elif command -v dnf &> /dev/null; then
echo "To install Steam on a Fedora-based system, run:"
echo " sudo dnf install steam"
elif command -v pacman &> /dev/null; then
echo "To install Steam on an Arch-based system (e.g., ChimeraOS), run:"
echo " sudo pacman -S steam"
else
echo "Unknown package manager. Please install Steam manually."
exit 1
fi
fi
# Check if wget is installed
if ! command -v wget &> /dev/null; then
echo "wget is not installed. Installing wget..."
if command -v apt-get &> /dev/null; then
sudo apt-get install -y wget
elif command -v dnf &> /dev/null; then
sudo dnf install -y wget
elif command -v pacman &> /dev/null; then
sudo pacman -S --noconfirm wget
else
echo "Unknown package manager. Please install wget manually."
exit 1
fi
fi
# Check if curl is installed
if ! command -v curl &> /dev/null; then
echo "curl is not installed. Installing curl..."
if command -v apt-get &> /dev/null; then
sudo apt-get install -y curl
elif command -v dnf &> /dev/null; then
sudo dnf install -y curl
elif command -v pacman &> /dev/null; then
sudo pacman -S --noconfirm curl
else
echo "Unknown package manager. Please install curl manually."
exit 1
fi
fi
# Check if jq is installed
if ! command -v jq &> /dev/null; then
echo "jq is not installed. Installing jq..."
if command -v apt-get &> /dev/null; then
sudo apt-get install -y jq
elif command -v dnf &> /dev/null; then
sudo dnf install -y jq
elif command -v pacman &> /dev/null; then
sudo pacman -S --noconfirm jq
else
echo "Unknown package manager. Please install jq manually."
exit 1
fi
fi
# Get the command line arguments
args=("$@")
echo "Arguments passed: ${args[@]}" # Debugging the passed arguments
# First Run: VARIABLE SETUP
# Function to extract steamid3 from Steam config
get_steam_user_info() {
if [[ -f "${logged_in_home}/.steam/root/config/loginusers.vdf" ]] || [[ -f "${logged_in_home}/.local/share/Steam/config/loginusers.vdf" ]]; then
if [[ -f "${logged_in_home}/.steam/root/config/loginusers.vdf" ]]; then
file_path="${logged_in_home}/.steam/root/config/loginusers.vdf"
else
file_path="${logged_in_home}/.local/share/Steam/config/loginusers.vdf"
fi
most_recent_user=$(sed -n '/"users"/,/"MostRecent" "1"/p' "$file_path")
max_timestamp=0
current_user=""
current_steamid=""
while IFS="," read -r steamid account timestamp; do
if (( timestamp > max_timestamp )); then
max_timestamp=$timestamp
current_user=$account
current_steamid=$steamid
fi
done < <(echo "$most_recent_user" | awk -v RS='}\n' -F'\n' '
{
for(i=1;i<=NF;i++){
if($i ~ /[0-9]{17}/){ split($i,a, "\""); steamid=a[2]; }
if($i ~ /"AccountName"/){ split($i,b, "\""); account=b[4]; }
if($i ~ /"Timestamp"/){ split($i,c, "\""); timestamp=c[4]; }
}
print steamid "," account "," timestamp
}')
steamid3=$((current_steamid - 76561197960265728))
echo "$steamid3"
else
return 0
fi
}
# Suppress all Steam ID output temporarily
{
set +x
steamid3=$(get_steam_user_info | tail -n1)
set -x
} 2>/dev/null
# Get Proton compatibility tool name or fall back
proton_dir=$(find -L "${logged_in_home}/.steam/root/compatibilitytools.d" -maxdepth 1 -type d -name "GE-Proton*" | sort -V | tail -n1)
if [[ -n "$proton_dir" ]]; then
compat_tool_name=$(basename "$proton_dir")
else
compat_tool_name="Proton Experimental"
fi
# Get Python version
python_version=$(python3 -c 'import sys; print(f"{sys.version_info.major}.{sys.version_info.minor}")' 2>/dev/null)
# Always assign these for Steam shortcut compatibility
chromedirectory="/usr/bin/flatpak"
chrome_startdir="/usr/bin"
# Optional extra variables
separate_appids=false
# Write to env_vars
env_file="${logged_in_home}/.config/systemd/user/env_vars"
mkdir -p "$(dirname "$env_file")"
# Declare vars to check and write
declare -A vars_to_set
vars_to_set["separate_appids"]=$separate_appids
[[ -n "$steamid3" ]] && vars_to_set["steamid3"]=$steamid3
vars_to_set["logged_in_home"]=$logged_in_home
vars_to_set["compat_tool_name"]=$compat_tool_name
[[ -n "$python_version" ]] && vars_to_set["python_version"]=$python_version
vars_to_set["chromedirectory"]=$chromedirectory
vars_to_set["chrome_startdir"]=$chrome_startdir
# Variables that should be quoted
declare -A quote_vars
quote_vars["chromedirectory"]=1
quote_vars["chrome_startdir"]=1
# If file is missing or empty, write everything at once
if [[ ! -s "$env_file" ]]; then
{
for key in "${!vars_to_set[@]}"; do
value="${vars_to_set[$key]}"
if [[ -n "${quote_vars[$key]:-}" ]]; then
echo "export $key=\"$value\""
else
echo "export $key=$value"
fi
done
} > "$env_file"
echo "Environment variables written to $env_file (new file)."
else
# Append only missing variables
for key in "${!vars_to_set[@]}"; do
if ! grep -qE "^export $key=" "$env_file"; then
value="${vars_to_set[$key]}"
if [[ -n "${quote_vars[$key]:-}" ]]; then
echo "export $key=\"$value\"" >> "$env_file"
else
echo "export $key=$value" >> "$env_file"
fi
echo "Added: export $key=$value"
fi
done
echo "Environment variables updated in $env_file (if needed)."
fi
#End of First Run Env_vars
### NSL Game Scanner.py Update/Scan
update_nsl_game_scanner() {
repo_url='https://github.com/moraroy/NonSteamLaunchers-On-Steam-Deck/archive/refs/heads/main.zip'
folders_to_clone=('urllib3' 'vdf' 'charset_normalizer')
parent_folder="${logged_in_home}/.config/systemd/user/Modules"
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"
env_vars="${logged_in_home}/.config/systemd/user/env_vars"
steam_debug_file="${logged_in_home}/.local/share/Steam/.cef-enable-remote-debugging"
nsl_config_dir="${logged_in_home}/.var/app/com.github.mtkennerly.ludusavi/config/ludusavi/NSLconfig"
# Stop and disable the service if it exists
if systemctl --user list-unit-files | grep -q "nslgamescanner.service"; then
if systemctl --user is-active --quiet nslgamescanner.service; then
systemctl --user stop nslgamescanner.service
fi
systemctl --user disable nslgamescanner.service 2>/dev/null || true
fi
# Remove the old python script if it exists
rm -f "$python_script_path"
# Create the parent folder if it doesn't exist
mkdir -p "${parent_folder}"
folders_exist=true
for folder in "${folders_to_clone[@]}"; do
if [ ! -d "${parent_folder}/${folder}" ]; then
folders_exist=false
break
fi
done
# Download and unzip the repo if necessary
if [ "${folders_exist}" = false ]; then
zip_file_path="${parent_folder}/repo.zip"
wget -O "${zip_file_path}" "${repo_url}" || { echo 'Download failed'; exit 1; }
unzip -d "${parent_folder}" "${zip_file_path}" || { echo 'Unzip failed'; exit 1; }
for folder in "${folders_to_clone[@]}"; do
destination_path="${parent_folder}/${folder}"
source_path="${parent_folder}/NonSteamLaunchers-On-Steam-Deck-main/Modules/${folder}"
if [ -d "${source_path}" ]; then
mv "${source_path}" "${destination_path}" || { echo "Move failed for ${folder}"; exit 1; }
fi
done
rm -f "${zip_file_path}"
rm -rf "${parent_folder}/NonSteamLaunchers-On-Steam-Deck-main"
fi
# Download the latest Python script
curl -fsSL -o "$python_script_path" "$github_link"
chmod +x "$python_script_path"
}
update_nsl_game_scanner
funny_messages=(
"Wow, you have a lot of games!"
"Getting artwork and descriptions for note system..."
"So many launchers, so little time..."
"Much game. Very library. Wow."
"Looking under the Steam Deck couch cushions..."
"Injecting metadata directly into your eyeballs..."
"Downloading more RAM... just kidding."
"Scanning your games like a barcode at checkout!"
"Adding +10 charm to your launcher list..."
"Man this is taking a long time..."
"Removing NSL from Decky Loader Store... jk that happened in real life."
"Learning your game choices and judging you for them..."
"But why is that game in here!!??"
"Downloading any boot videos for your enjoyment..."
"Thank you for being patient..."
"This may take a while..."
"You may need to grab a coffee..."
"If you see this notification, I'm still working don't worry..."
"Getting Descriptions, Artwork and Boot Videos if applicable..."
)
(
while true; do
sleep 2
loop_msg="${funny_messages[$RANDOM % ${#funny_messages[@]}]}"
show_message "Still scanning... ${loop_msg}"
sleep 15
done
) &
message_pid=$!
python3 "$python_script_path"
kill $message_pid 2>/dev/null
show_message "Scanning complete! Your game library looks good!"
if [ ! -f "$steam_debug_file" ]; then
touch "$steam_debug_file" || { echo "Failed to create $steam_debug_file"; exit 1; }
echo "Restarting Steam..."
killall steam 2>/dev/null || true
while pgrep -x steam >/dev/null; do sleep 1; done
nohup /usr/bin/steam -silent %U &>/dev/null &
fi
if systemctl --user list-unit-files | grep -q "nslgamescanner.service"; then
echo "[NSL] Starting NSL Game Scanner service..."
systemctl --user start nslgamescanner.service
else
echo "[NSL] Service file not found — skipping start."
fi
if [ -d "$nsl_config_dir" ] && flatpak list --app | grep -q "com.github.mtkennerly.ludusavi"; then
nohup flatpak run com.github.mtkennerly.ludusavi --config "$nsl_config_dir" backup --force > /dev/null 2>&1 &
wait $!
show_message "Game Saves have been backed up! Please check here: /home/deck/NSLGameSaves"
sleep 3
fi
show_message "Finished! Welcome to NonSteamLaunchers!"
sleep 3
###End of NSL Game Scanner update
# Check if any command line arguments were provided
if [ ${#args[@]} -eq 0 ]; then
# No command line arguments were provided, so check for updates and display the zenity window if necessary
check_for_updates
fi
# Check if the NonSteamLaunchersInstallation subfolder exists in the Downloads folder
if [ -d "$download_dir" ]; then
# Delete the NonSteamLaunchersInstallation subfolder
rm -rf "$download_dir"
echo "Deleted NonSteamLaunchersInstallation subfolder"
else
echo "NonSteamLaunchersInstallation subfolder does not exist"
fi
# Game Launchers
# TODO: parameterize hard-coded client versions (cf. 'app-26.1.9')
# Set the paths to the launcher executables
epic_games_launcher_path1="${logged_in_home}/.local/share/Steam/steamapps/compatdata/NonSteamLaunchers/pfx/drive_c/Program Files/Epic Games/Launcher/Portal/Binaries/Win64/EpicGamesLauncher.exe"
epic_games_launcher_path2="${logged_in_home}/.local/share/Steam/steamapps/compatdata/EpicGamesLauncher/pfx/drive_c/Program Files/Epic Games/Launcher/Portal/Binaries/Win64/EpicGamesLauncher.exe"
gog_galaxy_path1="${logged_in_home}/.local/share/Steam/steamapps/compatdata/NonSteamLaunchers/pfx/drive_c/Program Files (x86)/GOG Galaxy/GalaxyClient.exe"
gog_galaxy_path2="${logged_in_home}/.local/share/Steam/steamapps/compatdata/GogGalaxyLauncher/pfx/drive_c/Program Files (x86)/GOG Galaxy/GalaxyClient.exe"
uplay_path1="${logged_in_home}/.local/share/Steam/steamapps/compatdata/NonSteamLaunchers/pfx/drive_c/Program Files (x86)/Ubisoft/Ubisoft Game Launcher/upc.exe"
uplay_path2="${logged_in_home}/.local/share/Steam/steamapps/compatdata/UplayLauncher/pfx/drive_c/Program Files (x86)/Ubisoft/Ubisoft Game Launcher/upc.exe"
battlenet_path1="${logged_in_home}/.local/share/Steam/steamapps/compatdata/NonSteamLaunchers/pfx/drive_c/Program Files (x86)/Battle.net/Battle.net Launcher.exe"
battlenet_path2="${logged_in_home}/.local/share/Steam/steamapps/compatdata/Battle.netLauncher/pfx/drive_c/Program Files (x86)/Battle.net/Battle.net Launcher.exe"
eaapp_path1="${logged_in_home}/.local/share/Steam/steamapps/compatdata/NonSteamLaunchers/pfx/drive_c/Program Files/Electronic Arts/EA Desktop/EA Desktop/EADesktop.exe"
eaapp_path2="${logged_in_home}/.local/share/Steam/steamapps/compatdata/TheEAappLauncher/pfx/drive_c/Program Files/Electronic Arts/EA Desktop/EA Desktop/EADesktop.exe"
amazongames_path1="${logged_in_home}/.local/share/Steam/steamapps/compatdata/NonSteamLaunchers/pfx/drive_c/users/steamuser/AppData/Local/Amazon Games/App/Amazon Games.exe"
amazongames_path2="${logged_in_home}/.local/share/Steam/steamapps/compatdata/AmazonGamesLauncher/pfx/drive_c/users/steamuser/AppData/Local/Amazon Games/App/Amazon Games.exe"
itchio_path1="${logged_in_home}/.local/share/Steam/steamapps/compatdata/NonSteamLaunchers/pfx/drive_c/users/steamuser/AppData/Local/itch/app-26.9.0/itch.exe"
itchio_path2="${logged_in_home}/.local/share/Steam/steamapps/compatdata/itchioLauncher/pfx/drive_c/users/steamuser/AppData/Local/itch/app-26.9.0/itch.exe"
legacygames_path1="${logged_in_home}/.local/share/Steam/steamapps/compatdata/NonSteamLaunchers/pfx/drive_c/Program Files/Legacy Games/Legacy Games Launcher/Legacy Games Launcher.exe"
legacygames_path2="${logged_in_home}/.local/share/Steam/steamapps/compatdata/LegacyGamesLauncher/pfx/drive_c/Program Files/Legacy Games/Legacy Games Launcher/Legacy Games Launcher.exe"
humblegames_path1="${logged_in_home}/.local/share/Steam/steamapps/compatdata/NonSteamLaunchers/pfx/drive_c/Program Files/Humble App/Humble App.exe"
humblegames_path2="${logged_in_home}/.local/share/Steam/steamapps/compatdata/HumbleGamesLauncher/pfx/drive_c/Program Files/Humble App/Humble App.exe"
indiegala_path1="${logged_in_home}/.local/share/Steam/steamapps/compatdata/NonSteamLaunchers/pfx/drive_c/Program Files/IGClient/IGClient.exe"
indiegala_path2="${logged_in_home}/.local/share/Steam/steamapps/compatdata/IndieGalaLauncher/pfx/drive_c/Program Files/IGClient/IGClient.exe"
rockstar_path1="${logged_in_home}/.local/share/Steam/steamapps/compatdata/NonSteamLaunchers/pfx/drive_c/Program Files/Rockstar Games/Launcher/Launcher.exe"
rockstar_path2="${logged_in_home}/.local/share/Steam/steamapps/compatdata/RockstarGamesLauncher/pfx/drive_c/Program Files/Rockstar Games/Launcher/Launcher.exe"
glyph_path1="${logged_in_home}/.local/share/Steam/steamapps/compatdata/NonSteamLaunchers/pfx/drive_c/Program Files (x86)/Glyph/GlyphClient.exe"
glyph_path2="${logged_in_home}/.local/share/Steam/steamapps/compatdata/GlyphLauncher/pfx/drive_c/Program Files (x86)/Glyph/GlyphClient.exe"
minecraft_path1="${logged_in_home}/.local/share/Steam/steamapps/compatdata/NonSteamLaunchers/pfx/drive_c/Program Files (x86)/Minecraft Launcher/MinecraftLauncher.exe"
minecraft_path2="${logged_in_home}/.local/share/Steam/steamapps/compatdata/MinecraftLauncher/pfx/drive_c/Program Files (x86)/Minecraft Launcher/MinecraftLauncher.exe"
psplus_path1="${logged_in_home}/.local/share/Steam/steamapps/compatdata/NonSteamLaunchers/pfx/drive_c/Program Files (x86)/PlayStationPlus/pspluslauncher.exe"
psplus_path2="${logged_in_home}/.local/share/Steam/steamapps/compatdata/PlaystationPlusLauncher/pfx/drive_c/Program Files (x86)/PlayStationPlus/pspluslauncher.exe"
vkplay_path1="${logged_in_home}/.local/share/Steam/steamapps/compatdata/NonSteamLaunchers/pfx/drive_c/users/steamuser/AppData/Local/GameCenter/GameCenter.exe"
vkplay_path2="${logged_in_home}/.local/share/Steam/steamapps/compatdata/VKPlayLauncher/pfx/drive_c/users/steamuser/AppData/Local/GameCenter/GameCenter.exe"
hoyoplay_path1="${logged_in_home}/.local/share/Steam/steamapps/compatdata/NonSteamLaunchers/pfx/drive_c/Program Files/HoYoPlay/launcher.exe"
hoyoplay_path2="${logged_in_home}/.local/share/Steam/steamapps/compatdata/HoYoPlayLauncher/pfx/drive_c/Program Files/HoYoPlay/launcher.exe"
nexon_path1="${logged_in_home}/.local/share/Steam/steamapps/compatdata/NonSteamLaunchers/pfx/drive_c/Program Files (x86)/Nexon/Nexon Launcher/nexon_launcher.exe"
nexon_path2="${logged_in_home}/.local/share/Steam/steamapps/compatdata/NexonLauncher/pfx/drive_c/Program Files (x86)/Nexon/Nexon Launcher/nexon_launcher.exe"
gamejolt_path1="${logged_in_home}/.local/share/Steam/steamapps/compatdata/NonSteamLaunchers/pfx/drive_c/users/steamuser/AppData/Local/GameJoltClient/GameJoltClient.exe"
gamejolt_path2="${logged_in_home}/.local/share/Steam/steamapps/compatdata/GameJoltLauncher/pfx/drive_c/users/steamuser/AppData/Local/GameJoltClient/GameJoltClient.exe"
artixgame_path1="${logged_in_home}/.local/share/Steam/steamapps/compatdata/NonSteamLaunchers/pfx/drive_c/Program Files/Artix Game Launcher/Artix Game Launcher.exe"
artixgame_path2="${logged_in_home}/.local/share/Steam/steamapps/compatdata/ArtixGameLauncher/pfx/drive_c/Program Files/Artix Game Launcher/Artix Game Launcher.exe"
arc_path1="${logged_in_home}/.local/share/Steam/steamapps/compatdata/NonSteamLaunchers/pfx/drive_c/Program Files (x86)/Arc/Arc.exe"
arc_path2="${logged_in_home}/.local/share/Steam/steamapps/compatdata/ARCLauncher/pfx/drive_c/Program Files (x86)/Arc/Arc.exe"
poketcg_path1="${logged_in_home}/.local/share/Steam/steamapps/compatdata/NonSteamLaunchers/pfx/drive_c/users/steamuser/The Pokémon Company International/Pokémon Trading Card Game Live/Pokemon TCG Live.exe"
poketcg_path2="${logged_in_home}/.local/share/Steam/steamapps/compatdata/PokeTCGLauncher/pfx/drive_c/users/steamuser/The Pokémon Company International/Pokémon Trading Card Game Live/Pokemon TCG Live.exe"
antstream_path1="${logged_in_home}/.local/share/Steam/steamapps/compatdata/NonSteamLaunchers/pfx/drive_c/Program Files (x86)/Antstream Ltd/Antstream/AntstreamArcade.exe"
antstream_path2="${logged_in_home}/.local/share/Steam/steamapps/compatdata/AntstreamLauncher/pfx/drive_c/Program Files (x86)/Antstream Ltd/Antstream/AntstreamArcade.exe"
purple_path1="${logged_in_home}/.local/share/Steam/steamapps/compatdata/NonSteamLaunchers/pfx/drive_c/Program Files (x86)/NCSOFT/Purple/PurpleLauncher.exe"
purple_path2="${logged_in_home}/.local/share/Steam/steamapps/compatdata/PURPLELauncher/pfx/drive_c/Program Files (x86)/NCSOFT/Purple/PurpleLauncher.exe"
plarium_path1="${logged_in_home}/.local/share/Steam/steamapps/compatdata/NonSteamLaunchers/pfx/drive_c/users/steamuser/AppData/Local/PlariumPlay/PlariumPlay.exe"
plarium_path2="${logged_in_home}/.local/share/Steam/steamapps/compatdata/PlariumLauncher/pfx/drive_c/users/steamuser/AppData/Local/PlariumPlay/PlariumPlay.exe"
vfun_path1="${logged_in_home}/.local/share/Steam/steamapps/compatdata/NonSteamLaunchers/pfx/drive_c/VFUN/VLauncher/VFUNLauncher.exe"
vfun_path2="${logged_in_home}/.local/share/Steam/steamapps/compatdata/VFUNLauncher/pfx/drive_c/VFUN/VLauncher/VFUNLauncher.exe"
tempo_path1="${logged_in_home}/.local/share/Steam/steamapps/compatdata/NonSteamLaunchers/pfx/drive_c/Program Files/Tempo Launcher - Beta/Tempo Launcher - Beta.exe"
tempo_path2="${logged_in_home}/.local/share/Steam/steamapps/compatdata/TempoLauncher/pfx/drive_c/Program Files/Tempo Launcher - Beta/Tempo Launcher - Beta.exe"
stove_path1="${logged_in_home}/.local/share/Steam/steamapps/compatdata/NonSteamLaunchers/pfx/drive_c/ProgramData/Smilegate/STOVE/STOVE.exe"
stove_path2="${logged_in_home}/.local/share/Steam/steamapps/compatdata/STOVELauncher/pfx/drive_c/ProgramData/Smilegate/STOVE/STOVE.exe"
bigfish_path1="${logged_in_home}/.local/share/Steam/steamapps/compatdata/NonSteamLaunchers/pfx/drive_c/Program Files (x86)/bfgclient/bfgclient.exe"
bigfish_path2="${logged_in_home}/.local/share/Steam/steamapps/compatdata/BigFishLauncher/pfx/drive_c/Program Files (x86)/bfgclient/bfgclient.exe"
gryphlink_path1="${logged_in_home}/.local/share/Steam/steamapps/compatdata/NonSteamLaunchers/pfx/drive_c/Program Files/GRYPHLINK/Launcher.exe"
gryphlink_path2="${logged_in_home}/.local/share/Steam/steamapps/compatdata/GryphlinkLauncher/pfx/drive_c/Program Files/GRYPHLINK/Launcher.exe"
# Chrome File Path
# chrome_installpath="/app/bin/chrome"
chrome_path="/usr/bin/flatpak"
chrome_startdir="\"/usr/bin\""
chromedirectory="\"$chrome_path\""
#Zenity Launcher Check Installation
function CheckInstallations {
declare -A paths1 paths2 names
paths1=(["epic_games"]="$epic_games_launcher_path1" ["gog_galaxy"]="$gog_galaxy_path1" ["uplay"]="$uplay_path1" ["battlenet"]="$battlenet_path1" ["eaapp"]="$eaapp_path1" ["amazongames"]="$amazongames_path1" ["itchio"]="$itchio_path1" ["legacygames"]="$legacygames_path1" ["humblegames"]="$humblegames_path1" ["indiegala"]="$indiegala_path1" ["rockstar"]="$rockstar_path1" ["glyph"]="$glyph_path1" ["minecraft"]="$minecraft_path1" ["psplus"]="$psplus_path1" ["vkplay"]="$vkplay_path1" ["hoyoplay"]="$hoyoplay_path1" ["nexon"]="$nexon_path1" ["gamejolt"]="$gamejolt_path1" ["artixgame"]="$artixgame_path1" ["arc"]="$arc_path1" ["poketcg"]="$poketcg_path1" ["antstream"]="$antstream_path1" ["purple"]="$purple_path1" ["plarium"]="$plarium_path1" ["vfun"]="$vfun_path1" ["tempo"]="$tempo_path1" ["stove"]="$stove_path1" ["bigfish"]="$bigfish_path1" ["gryphlink"]="$gryphlink_path1")
paths2=(["epic_games"]="$epic_games_launcher_path2" ["gog_galaxy"]="$gog_galaxy_path2" ["uplay"]="$uplay_path2" ["battlenet"]="$battlenet_path2" ["eaapp"]="$eaapp_path2" ["amazongames"]="$amazongames_path2" ["itchio"]="$itchio_path2" ["legacygames"]="$legacygames_path2" ["humblegames"]="$humblegames_path2" ["indiegala"]="$indiegala_path2" ["rockstar"]="$rockstar_path2" ["glyph"]="$glyph_path2" ["minecraft"]="$minecraft_path2" ["psplus"]="$psplus_path2" ["vkplay"]="$vkplay_path2" ["hoyoplay"]="$hoyoplay_path2" ["nexon"]="$nexon_path2" ["gamejolt"]="$gamejolt_path2" ["artixgame"]="$artixgame_path2" ["arc"]="$arc_path2" ["poketcg"]="$poketcg_path2" ["antstream"]="$antstream_path2" ["purple"]="$purple_path2" ["plarium"]="$plarium_path2" ["vfun"]="$vfun_path2" ["tempo"]="$tempo_path2" ["stove"]="$stove_path2" ["bigfish"]="$bigfish_path2" ["gryphlink"]="$gryphlink_path1")
names=(["epic_games"]="Epic Games" ["gog_galaxy"]="GOG Galaxy" ["uplay"]="Ubisoft Connect" ["battlenet"]="Battle.net" ["eaapp"]="EA App" ["amazongames"]="Amazon Games" ["itchio"]="itch.io" ["legacygames"]="Legacy Games" ["humblegames"]="Humble Games Collection" ["indiegala"]="IndieGala" ["rockstar"]="Rockstar Games Launcher" ["glyph"]="Glyph Launcher" ["minecraft"]="Minecraft Launcher" ["psplus"]="Playstation Plus" ["vkplay"]="VK Play" ["hoyoplay"]="HoYoPlay" ["nexon"]="Nexon Launcher" ["gamejolt"]="Game Jolt Client" ["artixgame"]="Artix Game Launcher" ["arc"]="ARC Launcher" ["poketcg"]="Pokémon Trading Card Game Live" ["antstream"]="Antstream Arcade" ["purple"]="PURPLE Launcher" ["plarium"]="Plarium Play" ["vfun"]="VFUN Launcher" ["tempo"]="Tempo Launcher" ["stove"]="STOVE Client" ["bigfish"]="Big Fish Games Manager" ["gryphlink"]="Gryphlink")
for launcher in "${!names[@]}"; do
if [[ -f "${paths1[$launcher]}" ]]; then
declare -g "${launcher}_value"="FALSE"
declare -g "${launcher}_text"="${names[$launcher]} ===> ${paths1[$launcher]}"
elif [[ -f "${paths2[$launcher]}" ]]; then
declare -g "${launcher}_value"="FALSE"
declare -g "${launcher}_text"="${names[$launcher]} ===> ${paths2[$launcher]}"
else
declare -g "${launcher}_value"="FALSE"
declare -g "${launcher}_text"="${names[$launcher]}"
fi
done
}
# Verify launchers are installed
function CheckInstallationDirectory {
declare -A paths names
paths=(["nonsteamlauncher"]="${logged_in_home}/.local/share/Steam/steamapps/compatdata/NonSteamLaunchers" ["epicgameslauncher"]="${logged_in_home}/.local/share/Steam/steamapps/compatdata/EpicGamesLauncher" ["goggalaxylauncher"]="${logged_in_home}/.local/share/Steam/steamapps/compatdata/GogGalaxyLauncher" ["uplaylauncher"]="${logged_in_home}/.local/share/Steam/steamapps/compatdata/UplayLauncher" ["battlenetlauncher"]="${logged_in_home}/.local/share/Steam/steamapps/compatdata/Battle.netLauncher" ["eaapplauncher"]="${logged_in_home}/.local/share/Steam/steamapps/compatdata/TheEAappLauncher" ["amazongameslauncher"]="${logged_in_home}/.local/share/Steam/steamapps/compatdata/AmazonGamesLauncher" ["itchiolauncher"]="${logged_in_home}/.local/share/Steam/steamapps/compatdata/itchioLauncher" ["legacygameslauncher"]="${logged_in_home}/.local/share/Steam/steamapps/compatdata/LegacyGamesLauncher" ["humblegameslauncher"]="${logged_in_home}/.local/share/Steam/steamapps/compatdata/HumbleGamesLauncher" ["indiegalalauncher"]="${logged_in_home}/.local/share/Steam/steamapps/compatdata/IndieGalaLauncher" ["rockstargameslauncher"]="${logged_in_home}/.local/share/Steam/steamapps/compatdata/RockstarGamesLauncher" ["glyphlauncher"]="${logged_in_home}/.local/share/Steam/steamapps/compatdata/GlyphLauncher" ["minecraftlauncher"]="${logged_in_home}/.local/share/Steam/steamapps/compatdata/MinecraftLauncher" ["pspluslauncher"]="${logged_in_home}/.local/share/Steam/steamapps/compatdata/PlaystationPlusLauncher" ["vkplaylauncher"]="${logged_in_home}/.local/share/Steam/steamapps/compatdata/VKPlayLauncher" ["hoyoplaylauncher"]="${logged_in_home}/.local/share/Steam/steamapps/compatdata/HoYoPlayLauncher" ["nexonlauncher"]="${logged_in_home}/.local/share/Steam/steamapps/compatdata/NexonLauncher" ["gamejoltlauncher"]="${logged_in_home}/.local/share/Steam/steamapps/compatdata/GameJoltLauncher" ["artixgamelauncher"]="${logged_in_home}/.local/share/Steam/steamapps/compatdata/ArtixGameLauncher" ["arc"]="${logged_in_home}/.local/share/Steam/steamapps/compatdata/ARCLauncher" ["poketcglauncher"]="${logged_in_home}/.local/share/Steam/steamapps/compatdata/PokeTCGLauncher" ["antstreamlauncher"]="${logged_in_home}/.local/share/Steam/steamapps/compatdata/AntstreamLauncher" ["purplelauncher"]="${logged_in_home}/.local/share/Steam/steamapps/compatdata/PURPLELauncher" ["plarium"]="${logged_in_home}/.local/share/Steam/steamapps/compatdata/PlariumLauncher" ["vfun"]="${logged_in_home}/.local/share/Steam/steamapps/compatdata/VFUNLauncher" ["tempo"]="${logged_in_home}/.local/share/Steam/steamapps/compatdata/TempoLauncher" ["stove"]="${logged_in_home}/.local/share/Steam/steamapps/compatdata/STOVELauncher" ["bigfish"]="${logged_in_home}/.local/share/Steam/steamapps/compatdata/BigFishLauncher" ["gryphlink"]="${logged_in_home}/.local/share/Steam/steamapps/compatdata/GryphlinkLauncher")
names=(["nonsteamlauncher"]="NonSteamLaunchers" ["epicgameslauncher"]="EpicGamesLauncher" ["goggalaxylauncher"]="GogGalaxyLauncher" ["uplaylauncher"]="UplayLauncher" ["battlenetlauncher"]="Battle.netLauncher" ["eaapplauncher"]="TheEAappLauncher" ["amazongameslauncher"]="AmazonGamesLauncher" ["itchiolauncher"]="itchioLauncher" ["legacygameslauncher"]="LegacyGamesLauncher" ["humblegameslauncher"]="HumbleGamesLauncher" ["indiegalalauncher"]="IndieGalaLauncher" ["rockstargameslauncher"]="RockstarGamesLauncher" ["glyphlauncher"]="GlyphLauncher" ["minecraftlauncher"]="MinecraftLauncher" ["pspluslauncher"]="PlaystationPlusLauncher" ["vkplaylauncher"]="VKPlayLauncher" ["hoyoplaylauncher"]="HoYoPlayLauncher" ["nexonlauncher"]="NexonLauncher" ["gamejoltlauncher"]="GameJoltLauncher" ["artixgamelauncher"]="ArtixGameLauncher" ["arc"]="ARCLauncher" ["poketcg"]="PokeTCGLauncher" ["antstreamlauncher"]="AntstreamLauncher" ["purplelauncher"]="PURPLELauncher" ["plariumlauncher"]="PlariumLauncher" ["vfunlauncher"]="VFUNLauncher" ["tempolauncher"]="TempoLauncher" ["stovelauncher"]="STOVELauncher" ["bigfishlauncher"]="BigFishLauncher")
for launcher in "${!names[@]}"; do
if [[ -d "${paths[$launcher]}" ]]; then
declare -g "${launcher}_move_value"="TRUE"
else
declare -g "${launcher}_move_value"="FALSE"
fi
done
}
#Get SD Card Path
get_sd_path() {
local sd_mount
sd_mount=$(lsblk -nr -o NAME,MOUNTPOINT \
| awk '$1 ~ /^mmcblk.*p[0-9]+$/ && $2 != "" { print $2; exit }')
if [[ -z "$sd_mount" ]]; then
zenity --error --text="No SD card detected. Please insert and mount an SD card."
exit 1
fi
echo "$sd_mount"
}
### update proton ge
function patch_proton_script() {
proton_dir=$(find -L "${logged_in_home}/.steam/root/compatibilitytools.d" \
-maxdepth 1 -type d -name "GE-Proton*" | sort -V | tail -n1)
if [ -z "$proton_dir" ]; then
echo "No GE-Proton installation found to patch."
return
fi
proton_script="${proton_dir}/proton"
insert_line="os.environ['ENABLE_GAMESCOPE_WSI'] = '0'"
if [ -f "$proton_script" ] && ! grep -q "ENABLE_GAMESCOPE_WSI" "$proton_script"; then
echo "Patching Proton Python script to disable Gamescope WSI..."
sed -i "/^import protonfixes/a $insert_line" "$proton_script"
else
echo "Proton Python script already patched or not found."
fi
}
# Function For Updating Proton-GE
function download_ge_proton() {
echo "Downloading GE-Proton using the GitHub API"
cd "${logged_in_home}/Downloads/NonSteamLaunchersInstallation" || {
echo "Failed to change directory. Exiting."
exit 1
}
tarball_url=$(curl -s https://api.github.com/repos/GloriousEggroll/proton-ge-custom/releases/latest \
| grep browser_download_url | cut -d\" -f4 | grep .tar.gz)
if [ -z "$tarball_url" ]; then
echo "Failed to get tarball URL. Exiting."
exit 1
fi
curl --retry 5 --retry-delay 0 --retry-max-time 60 -sLOJ "$tarball_url" || {
echo "Curl failed to download tarball. Exiting."
exit 1
}
checksum_url=$(curl -s https://api.github.com/repos/GloriousEggroll/proton-ge-custom/releases/latest \
| grep browser_download_url | cut -d\" -f4 | grep .sha512sum)
if [ -z "$checksum_url" ]; then
echo "Failed to get checksum URL. Exiting."
exit 1
fi
curl --retry 5 --retry-delay 0 --retry-max-time 60 -sLOJ "$checksum_url" || {
echo "Curl failed to download checksum. Exiting."
exit 1
}
sha512sum -c ./*.sha512sum || {
echo "Checksum verification failed. Exiting."
exit 1
}
ge_folder_name=$(tar -tf GE-Proton*.tar.gz | head -n1 | cut -d/ -f1)
target_dir="${logged_in_home}/.steam/root/compatibilitytools.d/${ge_folder_name}"
if [ -d "$target_dir" ]; then
echo "Removing existing ${ge_folder_name} for clean replacement..."
rm -rf "$target_dir"
fi
tar -xf GE-Proton*.tar.gz -C "${logged_in_home}/.steam/root/compatibilitytools.d/" || {
echo "Tar extraction failed. Exiting."
exit 1
}
echo "All done :)"
}
function update_proton() {
echo "0"
echo "# Detecting, Updating and Installing GE-Proton...please wait..."
if [ ! -d "${logged_in_home}/.steam/root/compatibilitytools.d" ]; then
mkdir -p "${logged_in_home}/.steam/root/compatibilitytools.d" || {
echo "Failed to create directory. Exiting."
exit 1
}
fi
mkdir -p "${logged_in_home}/Downloads/NonSteamLaunchersInstallation" || {
echo "Failed to create directory. Exiting."
exit 1
}
proton_dir=$(find -L "${logged_in_home}/.steam/root/compatibilitytools.d" \
-maxdepth 1 -type d -name "GE-Proton*" | sort -V | tail -n1)
if [ -z "$proton_dir" ]; then
download_ge_proton
else
installed_version=$(basename "$proton_dir" | sed 's/GE-Proton-//')
latest_version=$(curl -s https://api.github.com/repos/GloriousEggroll/proton-ge-custom/releases/latest \
| grep tag_name | cut -d '"' -f 4)
if [ "$installed_version" != "$latest_version" ]; then
download_ge_proton
fi
fi
patch_proton_script
}
### End of updating proton ge
# Function For Updating UMU Launcher
function download_umu_launcher() {
echo "Downloading UMU Launcher using the GitHub API"
cd "${logged_in_home}/Downloads/NonSteamLaunchersInstallation" || { echo "Failed to change directory. Exiting."; exit 1; }
# Get the download URL for a file that matches the pattern 'umu-launcher-*zipapp*.tar.gz'
zip_url=$(curl -s https://api.github.com/repos/Open-Wine-Components/umu-launcher/releases/latest | \
grep '"browser_download_url":' | grep -E 'umu-launcher-.*-zipapp.*\.(zip|tar\.gz|tar)' | \
cut -d '"' -f 4)
if [ -z "$zip_url" ]; then
echo "Failed to get zip/tar URL. Exiting."
fi
echo "Found download URL: $zip_url"
# Download the file
curl --retry 5 --retry-delay 0 --retry-max-time 60 -sLOJ "$zip_url"
if [ $? -ne 0 ]; then
echo "Curl failed to download the file. Exiting."
fi
# Ensure the bin directory exists
if [ ! -d "${logged_in_home}/bin" ]; then
mkdir -p "${logged_in_home}/bin" || { echo "Failed to create bin directory. Exiting."; exit 1; }
fi
# Get the downloaded file name
downloaded_file=$(basename "$zip_url")
# Check if the downloaded file is a .zip file or a .tar.gz file and extract accordingly
if [[ "$downloaded_file" =~ \.zip$ ]]; then
# Extract the .zip file into without preserving directory structure
unzip -o -j "$downloaded_file" -d "${logged_in_home}/bin/"
if [ $? -ne 0 ]; then
echo "Zip extraction failed. Exiting."
fi
elif [[ "$downloaded_file" =~ \.tar\.gz$ ]] || [[ "$downloaded_file" =~ \.tar$ ]]; then
# Check the actual file type using the `file` command
file_type=$(file --mime-type -b "$downloaded_file")
if [[ "$file_type" == "application/gzip" ]]; then
# If it's a gzipped tar file, extract it without leading directory (strip umu/)
tar --strip-components=1 -xvzf "$downloaded_file" -C "${logged_in_home}/bin/"
if [ $? -ne 0 ]; then
echo "Tar.gz extraction failed. Exiting."
exit 1
fi
elif [[ "$file_type" == "application/x-tar" ]]; then
# If it's a tar file (without gzip), extract it without leading directory
tar --strip-components=1 -xvf "$downloaded_file" -C "${logged_in_home}/bin/"
if [ $? -ne 0 ]; then
echo "Tar extraction failed. Exiting."
fi
else
echo "Unknown file type: $file_type. Exiting."
fi
else
echo "Unsupported file type: $downloaded_file. Exiting."
fi
# Make all extracted files executable
find "${logged_in_home}/bin/" -type f -exec chmod +x {} \;
if [ -f "${logged_in_home}/bin/umu-run" ]; then
"${logged_in_home}/bin/umu-run" winetricks --self-update
else
echo "umu-run not found. Skipping self-update."
fi
echo "UMU Launcher update completed :)"
}
function update_umu_launcher() {
echo "0"
echo "# Detecting, Updating and Installing UMU Launcher...please wait..."
# Create NonSteamLaunchersInstallation subfolder in Downloads folder
mkdir -p "${logged_in_home}/Downloads/NonSteamLaunchersInstallation" || { echo "Failed to create directory. Exiting."; exit 1; }
# Set the path to the UMU Launcher directory
umu_dir="${logged_in_home}/bin/umu-launcher"
# Check if UMU Launcher is installed
if [ ! -d "$umu_dir" ]; then
download_umu_launcher
else
# Check if installed version is the latest version
installed_version=$(cat "$umu_dir/version.txt")
latest_version=$(curl -s https://api.github.com/repos/Open-Wine-Components/umu-launcher/releases/latest | grep tag_name | cut -d '"' -f 4)
if [ "$installed_version" != "$latest_version" ]; then
download_umu_launcher
fi
fi
}
# Pre-logic system cleanup
CheckInstallations
CheckInstallationDirectory
#rm -rf "${logged_in_home}/.config/systemd/user/nslgamescanner.service"
#unlink "${logged_in_home}/.config/systemd/user/default.target.wants/nslgamescanner.service"
#systemctl --user daemon-reload
#systemctl --user reset-failed
# Define launcher entries
launcher_entries=(
"FALSE|SEPARATE APP IDS - CHECK THIS TO SEPARATE YOUR PREFIX"
"$epic_games_value|$epic_games_text"
"$gog_galaxy_value|$gog_galaxy_text"
"$uplay_value|$uplay_text"
"$battlenet_value|$battlenet_text"
"$amazongames_value|$amazongames_text"
"$eaapp_value|$eaapp_text"
"$legacygames_value|$legacygames_text"
"$itchio_value|$itchio_text"
"$humblegames_value|$humblegames_text"
"$indiegala_value|$indiegala_text"
"$rockstar_value|$rockstar_text"
"$glyph_value|$glyph_text"
"$minecraft_value|$minecraft_text"
"$psplus_value|$psplus_text"
"$vkplay_value|$vkplay_text"
"$hoyoplay_value|$hoyoplay_text"
"$nexon_value|$nexon_text"
"$gamejolt_value|$gamejolt_text"
"$artixgame_value|$artixgame_text"
"$arc_value|$arc_text"
"$purple_value|$purple_text"
"$plarium_value|$plarium_text"
"$vfun_value|$vfun_text"
"$tempo_value|$tempo_text"
"$poketcg_value|$poketcg_text"
"$antstream_value|$antstream_text"
"$stove_value|$stove_text"
"$bigfish_value|$bigfish_text"
"$gryphlink_value|$gryphlink_text"
"FALSE|Hytale"
"FALSE|RemotePlayWhatever"
"FALSE|NVIDIA GeForce NOW"
"FALSE|Moonlight Game Streaming"
)
chrome_entries=(
"FALSE|Fortnite"
"FALSE|Venge"
"FALSE|Super Monkey Ball Online"
"FALSE|PokéRogue"
"FALSE|Xbox Game Pass"
"FALSE|Better xCloud"
"FALSE|GeForce Now"
"FALSE|Amazon Luna"
"FALSE|Stim.io"
"FALSE|Boosteroid Cloud Gaming"
"FALSE|Cloudy Pad"
"FALSE|Rocketcrab"
"FALSE|WebRcade"
"FALSE|WebRcade Editor"
"FALSE|Afterplay.io"
"FALSE|OnePlay"
"FALSE|AirGPU"
"FALSE|CloudDeck"
"FALSE|JioGamesCloud"
"FALSE|WatchParty"
"FALSE|Netflix"
"FALSE|Hulu"
"FALSE|Tubi"
"FALSE|Disney+"
"FALSE|Amazon Prime Video"
"FALSE|Youtube"
"FALSE|Youtube TV"
"FALSE|Twitch"
"FALSE|Apple TV+"
"FALSE|Crunchyroll"
"FALSE|Plex"
)
# Convert to newline-separated strings
launcher_data=$(IFS=$'\n'; echo "${launcher_entries[*]}")
chrome_data=$(IFS=$'\n'; echo "${chrome_entries[*]}")
# Export environment variables for GTK UI
export LAUNCHER_DATA="${launcher_data}"
export CHROME_DATA="${chrome_data}"
export UI_VERSION="${version}"
export UI_LIVE="${live}"
# Arrays and flags to be filled
selected_launchers=()
custom_websites=()
separate_appids=false
# --- Handle command line arguments or fallback to GTK UI ---
if [ $# -eq 0 ]; then
readarray -t gtk_output < <(python3 - <<'EOF'
import gi, os, sys, subprocess, re
gi.require_version("Gtk", "3.0")
from gi.repository import Gtk
def get_screen_resolution():
xrandr_output = subprocess.check_output(["xrandr"]).decode("utf-8")
resolutions = re.findall(r"(\d+)x(\d+)\s*\*+", xrandr_output)
return map(int, resolutions[0]) if resolutions else (1920,1080)
def is_multiple_monitors():
xrandr_output = subprocess.check_output(["xrandr"]).decode("utf-8")
return len(re.findall(r" connected", xrandr_output))>1
screen_width, screen_height = get_screen_resolution()
if is_multiple_monitors():
xrandr_output = subprocess.check_output(["xrandr"]).decode("utf-8")
match = re.search(r"(\d+)x(\d+)\s+connected", xrandr_output)
if match:
screen_width, screen_height = map(int, match.groups())
zenity_width = screen_width*80//100
zenity_height = screen_height*80//100
version = os.environ.get("UI_VERSION","NSL")
live = os.environ.get("UI_LIVE","")
launcher_lines = os.environ.get("LAUNCHER_DATA","").splitlines()
chrome_lines = os.environ.get("CHROME_DATA","").splitlines()
class LauncherUI(Gtk.Window):
def __init__(self):
Gtk.Window.__init__(self, title="Which launchers do you want to download and install?")
self.set_default_size(zenity_width, zenity_height)
self.store_launchers = Gtk.ListStore(bool, str)
self.store_chrome = Gtk.ListStore(bool, str)
for line in launcher_lines:
if "|" in line:
value,label = line.split("|",1)
self.store_launchers.append([value=="TRUE", label])
for line in chrome_lines:
if "|" in line:
value,label = line.split("|",1)
self.store_chrome.append([value=="TRUE", label])
main_box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL, spacing=6, margin=10)
self.add(main_box)
header_label = Gtk.Label()
header_label.set_markup(
f"<b>{version}</b> — Default = one App ID Installation, One Prefix, "
f"NonSteamLaunchers - updated the NSLGameScanner.py {live}"
)
header_label.set_line_wrap(True)
header_label.set_xalign(0)
main_box.pack_start(header_label, False, False, 0)
# Helper for toggles
def create_tree(model,toggle_callback):
tree = Gtk.TreeView(model=model)
toggle = Gtk.CellRendererToggle()
toggle.connect("toggled",toggle_callback)
tree.append_column(Gtk.TreeViewColumn("Select",toggle,active=0))
tree.append_column(Gtk.TreeViewColumn("Name",Gtk.CellRendererText(),text=1))
return tree
# Launchers Tree
main_box.pack_start(Gtk.Label(label="Launchers:", xalign=0), False, False, 0)
launcher_tree = create_tree(self.store_launchers,self.on_toggle_launcher)
scrolled1 = Gtk.ScrolledWindow()
scrolled1.set_vexpand(True)
scrolled1.add(launcher_tree)
main_box.pack_start(scrolled1, True, True, 0)
# Chrome Tree
main_box.pack_start(Gtk.Label(label="Browser-based Services:", xalign=0), False, False,0)
chrome_tree = create_tree(self.store_chrome,self.on_toggle_chrome)
scrolled2 = Gtk.ScrolledWindow()
scrolled2.set_vexpand(True)
scrolled2.add(chrome_tree)
main_box.pack_start(scrolled2, True, True, 0)
# Horizontal browser checkboxes
main_box.pack_start(Gtk.Label(label="Select a browser (required for web services or websites & will attempt to be installed if needed):", xalign=0), False, False,0)
self.browser_names = ["Google Chrome","Mozilla Firefox","Brave","Microsoft Edge", "Vivaldi", "LibreWolf"]
self.browser_checks = {}