-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmultilaunch
More file actions
55 lines (43 loc) · 1.27 KB
/
Copy pathmultilaunch
File metadata and controls
55 lines (43 loc) · 1.27 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
#!/usr/bin/env bash
# Try importing the settings we need, otherwise use default
if [ -f "$HOME/.config/scraft/config/scriptConfig" ]; then
source "$HOME/.config/scraft/config/scriptConfig"
else
SCDF_MangoLAunch=false
fi
# List of instance names and launch options, make sure to properly wrap arguments
declare -A instances=(
[Scraftia]="-l 'Scraftia - SMP'"
[Wynncraft]="-l 'Wynntils' -s 'play.wynncraft.com'"
[Hypixel]="-l 'Scraft PvP' -s 'play.hypixel.net'"
)
if [ "$1" = "-v" ]; then
echo "---[ Array ]---"
echo "${instances[@]}"
echo "---[ Keys ]---"
for key in "${!instances[@]}"; do
echo "$key"
done
echo "[Info]: Passing instance list to dmenu."
fi
instance=$(dmenu -p "Launch:" -l 10 <<< $(for key in "${!instances[@]}"; do echo "$key";done))
if [ "$instance" = "" ]; then
if [ "$1" = "-v" ]; then
echo "[Info]: No instance chosen, exiting."
fi
exit
fi
if [ "$1" = "-v" ]; then
echo "---[ Selected instance ]---"
echo "$instance"
echo "---[ Value ]---"
echo ${instances[${instance}]}
echo "[Info]: Launching minecraft!"
fi
notify-send "Launching: ${instance}"
# We use eval to launch multimc with our selected instance
if [ "$SCDF_MangoLAunch" = true ]; then
eval mangohud multimc ${instances[${instance}]}
else
eval multimc ${instances[${instance}]}
fi