2024-03-03 15:38:55 +02:00
|
|
|
#!/bin/sh
|
2024-10-10 06:18:29 +03:00
|
|
|
arRPCdir="$HOME/.local/share/arRPC"
|
|
|
|
Vesktopdir="$HOME/.local/share/Vesktop"
|
2024-03-03 15:38:55 +02:00
|
|
|
|
2024-05-21 18:55:45 +03:00
|
|
|
if [ ! $(which node) ]; then
|
|
|
|
echo "Pleases install nodejs and try again."
|
|
|
|
exit
|
|
|
|
fi
|
|
|
|
|
2024-04-19 11:59:09 +03:00
|
|
|
install_arRPC () {
|
2024-04-22 06:06:41 +03:00
|
|
|
echo "Installing arRPC"
|
2024-04-19 11:59:09 +03:00
|
|
|
git clone https://github.com/OpenAsar/arRPC "$arRPCdir"
|
|
|
|
cd "$arRPCdir" && npm install
|
2024-04-22 06:06:41 +03:00
|
|
|
echo "arRPC installed"
|
|
|
|
}
|
|
|
|
|
|
|
|
install_vesktop () {
|
|
|
|
echo "Installing Vesktop"
|
2024-05-21 18:55:45 +03:00
|
|
|
pull_vesktop
|
|
|
|
build_vesktop
|
2024-04-22 06:06:41 +03:00
|
|
|
git clone https://github.com/Vencord/Vesktop $Vesktopdir
|
2024-05-21 18:55:45 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
build_vesktop () {
|
|
|
|
export COREPACK_ENABLE_STRICT=0
|
2024-04-22 06:06:41 +03:00
|
|
|
cd $Vesktopdir
|
|
|
|
pnpm i
|
2024-05-21 18:55:45 +03:00
|
|
|
pnpm package:dir
|
2024-04-22 06:06:41 +03:00
|
|
|
echo "Vesktop installed"
|
|
|
|
}
|
|
|
|
|
|
|
|
run_arRPC () {
|
|
|
|
# skip if already running
|
|
|
|
if [ $(pgrep -f 'node src') ]; then return; fi
|
|
|
|
echo "Starting arRPC"
|
|
|
|
cd "$arRPCdir"
|
|
|
|
node src &
|
|
|
|
}
|
|
|
|
|
|
|
|
run_vesktop () {
|
|
|
|
echo "Starting Vesktop"
|
2024-10-10 06:18:29 +03:00
|
|
|
if [ ! -d $Vesktopdir ]; then install_vesktop; fi
|
|
|
|
if [ ! -d $Vesktopdir/dist/linux-unpacked ]; then build_vesktop; fi
|
|
|
|
cd $Vesktopdir/dist/linux-unpacked
|
2024-04-22 06:06:41 +03:00
|
|
|
./vesktop \
|
|
|
|
--enable-features=UseOzonePlatform,WaylandWindowDecorations \
|
|
|
|
--ozone-platform-hint=auto
|
2024-04-19 11:59:09 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
if [ ! -d "$arRPCdir" ]; then
|
|
|
|
install_arRPC
|
|
|
|
fi
|
|
|
|
|
2024-04-22 06:06:41 +03:00
|
|
|
run_arRPC
|
2024-04-19 11:59:09 +03:00
|
|
|
arRPCPID=$(pgrep -f 'node src')
|
|
|
|
|
2024-04-22 06:06:41 +03:00
|
|
|
run_vesktop
|
2024-03-03 15:38:55 +02:00
|
|
|
|
2024-04-22 06:06:41 +03:00
|
|
|
echo "Killing arRPC"
|
2024-04-19 11:59:09 +03:00
|
|
|
# exit arRPC when Vesktop closes
|
2024-04-22 06:06:41 +03:00
|
|
|
echo "Trying to kill $arRPCPID"
|
|
|
|
killall node -n $arRPCPID
|
|
|
|
if [ ! $(pgrep -f 'node src' ) ]; then
|
|
|
|
echo "arRPC killed"
|
|
|
|
else
|
|
|
|
echo "arRPC could not be killed"
|
|
|
|
fi
|