67 lines
1.4 KiB
Bash
Executable file
67 lines
1.4 KiB
Bash
Executable file
#!/bin/sh
|
|
arRPCdir="$HOME/src/arRPC"
|
|
Vesktopdir="$HOME/src/Vesktop"
|
|
|
|
if [ ! $(which node) ]; then
|
|
echo "Pleases install nodejs and try again."
|
|
exit
|
|
fi
|
|
|
|
install_arRPC () {
|
|
echo "Installing arRPC"
|
|
git clone https://github.com/OpenAsar/arRPC "$arRPCdir"
|
|
cd "$arRPCdir" && npm install
|
|
echo "arRPC installed"
|
|
}
|
|
|
|
install_vesktop () {
|
|
echo "Installing Vesktop"
|
|
pull_vesktop
|
|
build_vesktop
|
|
git clone https://github.com/Vencord/Vesktop $Vesktopdir
|
|
}
|
|
|
|
build_vesktop () {
|
|
export COREPACK_ENABLE_STRICT=0
|
|
cd $Vesktopdir
|
|
pnpm i
|
|
pnpm package:dir
|
|
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"
|
|
if [ ! -d $HOME/src/Vesktop ]; then install_vesktop; fi
|
|
if [ ! -d $HOME/src/Vesktop/dist/linux-unpacked ]; then build_vesktop; fi
|
|
cd $HOME/src/Vesktop/dist/linux-unpacked
|
|
./vesktop \
|
|
--enable-features=UseOzonePlatform,WaylandWindowDecorations \
|
|
--ozone-platform-hint=auto
|
|
}
|
|
|
|
if [ ! -d "$arRPCdir" ]; then
|
|
install_arRPC
|
|
fi
|
|
|
|
run_arRPC
|
|
arRPCPID=$(pgrep -f 'node src')
|
|
|
|
run_vesktop
|
|
|
|
echo "Killing arRPC"
|
|
# exit arRPC when Vesktop closes
|
|
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
|