itsfolf / Discord-Screenshare-Linux

Updating Discord's shit because they won't do it themselves 2: Electric Boogaloo
220 stars 5 forks source link

uninstall #15

Open E-daw opened 1 year ago

E-daw commented 1 year ago

Are there any directions for uninstalling?

Nerya1 commented 1 year ago

scripts/install.sh removes existing installations before installing. I downloaded it and scripts/patch.js and commented out the lines after #Download latest, after running the updated files with bash install.sh discord seems to work as normal.

The new install.sh file looks like this:

#!/bin/sh
username=$(logname)
dirs=(/home/$username/.config/discord*/*/modules/discord_voice /home/$username/.var/app/com.discordapp.*/config/discord/*/modules/discord_voice)
dirs=( $( for i in ${dirs[@]} ; do echo $i ; done | grep -v "*" ) )
len=${#dirs[@]}

if [[ $len -eq 0 ]]; then
    echo "No Discord installation found"
    exit 1
fi

if [[ $len -gt 1 ]]; then
    echo "Multiple Discord installations found"
    echo "Please select one:"
    for i in "${!dirs[@]}"; do
        echo -n "$((i+1)): "
        echo "${dirs[$i]}"
    done

    read -p "Enter selection: " selection
    selectedIndex=$((selection-1))
    selected=${dirs[$selectedIndex]}
    if [[ $selectedIndex -lt 0 || $selectedIndex -ge $len ]]; then
        echo "Invalid selection"
        exit 1
    fi
else
    selected=${dirs[0]}
fi

echo "Installing LinuxFix to $selected..."

chmod 644 $selected/index.js

separator="\/\/ ==Discord Screenshare Linux Fix=="

# Remove any existing installation
sed -i.bak '/^'"$separator"'/,/^'"$separator"'/{/^#/!{/^\$/!d}}' $selected/index.js

#Download latest
# downloadUrl=$(wget -qO- https://api.github.com/repos/fuwwy/Discord-Screenshare-Linux/releases/latest | grep browser_download_url | cut -d '"' -f 4)
# wget -O $selected/linux-fix.node -q --show-progress "$downloadUrl"
# code=$(wget -qO- https://raw.githubusercontent.com/fuwwy/Discord-Screenshare-Linux/main/scripts/patch.js)

#echo -e "\n" >> $selected/index.js
echo "$code" >> $selected/index.js

chmod 444 $selected/index.js
E-daw commented 1 year ago

Thank you and sorry I could've totally have seen that if I looked at the install script but I was lazy. Hope this wasn't redundant or tedious. Thanks again.

Nerya1 commented 1 year ago

I'm glad I could help. I actually installed it earlier today and checked this issue once I saw that it crashes. Thought I'd leave my solution for other people.

AAAtroush commented 6 months ago

I am new to linux and when i applied this it maked discord crashes whenever i try to share screen i don't really know how to revert it any help?