Compare commits

..

4 commits

4 changed files with 42 additions and 16 deletions

View file

@ -3,4 +3,4 @@
NC_DIR="$HOME/Nextcloud" NC_DIR="$HOME/Nextcloud"
NC_URL="https://cloud.criminallycute.fi" NC_URL="https://cloud.criminallycute.fi"
nextcloudcmd -u $NC_USER -p $NC_PASS $NC_DIR $NC_URL nextcloudcmd -s -u $NC_USER -p $NC_PASS $NC_DIR $NC_URL

View file

@ -1,23 +1,55 @@
#!/bin/sh #!/bin/sh
arRPCdir="$HOME/.local/share/vesktop/arrpc" arRPCdir="$HOME/src/arRPC"
# check if arRPC is installed and autoinstall if necessary Vesktopdir="$HOME/src/Vesktop"
install_arRPC () { install_arRPC () {
echo "Installing arRPC"
git clone https://github.com/OpenAsar/arRPC "$arRPCdir" git clone https://github.com/OpenAsar/arRPC "$arRPCdir"
cd "$arRPCdir" && npm install cd "$arRPCdir" && npm install
echo "arRPC installed"
}
install_vesktop () {
echo "Installing Vesktop"
export COREPACK_ENABLE_STRICT=0
git clone https://github.com/Vencord/Vesktop $Vesktopdir
cd $Vesktopdir
pnpm i
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
cd $HOME/src/Vesktop/dist/linux-unpacked
./vesktop \
--enable-features=UseOzonePlatform,WaylandWindowDecorations \
--ozone-platform-hint=auto
} }
if [ ! -d "$arRPCdir" ]; then if [ ! -d "$arRPCdir" ]; then
install_arRPC install_arRPC
fi fi
# start arRPC run_arRPC
cd "$arRPCdir" && node src &
arRPCPID=$(pgrep -f 'node src') arRPCPID=$(pgrep -f 'node src')
# start Vesktop run_vesktop
$HOME/.local/share/vesktop/vesktop --enable-features=UseOzonePlatform,WaylandWindowDecorations --ozone-platform-hint=auto
echo "Killing arRPC"
# exit arRPC when Vesktop closes # exit arRPC when Vesktop closes
pkill -9 $arRPCPID 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

View file

@ -1,6 +0,0 @@
#!/bin/sh
emerge --search "$1" --fuzzy-search n \
| grep "Description" \
| head -1 \
| cut -d":" -f2 \
| awk '{$1=$1;print}'

View file

@ -12,7 +12,7 @@ artist=$(echo "$data" | jq '.artist_name' | tr -d '"')
track=$(echo "$data" | jq '.track_name' | tr -d '"') track=$(echo "$data" | jq '.track_name' | tr -d '"')
if [[ "$artist" != "null" ]]; then if [[ "$artist" != "null" ]]; then
echo "$artist" - "$track" echo "Currently playing: $artist" - "$track"
else else
echo "Not listening to anything right now." echo "Not listening to anything right now."
fi fi