-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
59 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,7 @@ | ||
# Discord Screenshare Linux | ||
WIP repo that adds Discord screenshare support for Wayland and Pipewire aswell as audio sharing, without the need to use the web client. | ||
WIP repo that adds Discord screenshare support for Wayland and Pipewire aswell as audio sharing, without the need to use the web client. | ||
|
||
## Install | ||
``` | ||
sh -c "$(curl https://raw.githubusercontent.com/fuwwy/Discord-Screenshare-Linux/main/scripts/install.sh -sSfL)" | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
#!/bin/sh | ||
username=$(logname) | ||
dirs=(/home/$username/.config/discord*/*/modules/discord_voice) | ||
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]}" | cut --delimiter='/' --fields=5 | ||
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 |