36 lines
1.1 KiB
Bash
Executable file
36 lines
1.1 KiB
Bash
Executable file
#!/bin/sh
|
|
|
|
mkdir -p ~/Apps/Element.app/Resources
|
|
cd ~/Apps/Element.app
|
|
|
|
# create icon
|
|
wget -nc https://element.io/images/logo-mark-primary.svg
|
|
convert -resize 48x48 logo-mark-primary.svg Element.tiff
|
|
|
|
# create resource plist
|
|
printf "{\n" > Resources/Info-gnustep.plist
|
|
printf " NSExecutable = \"Element\";\n" >> Resources/Info-gnustep.plist
|
|
printf " NSIcon = \"Element.tiff\";\n" >> Resources/Info-gnustep.plist
|
|
printf " XAppWrapper = YES;\n" >> Resources/Info-gnustep.plist
|
|
printf "}\n" >> Resources/Info-gnustep.plist
|
|
|
|
# create launcher
|
|
printf '#!/bin/sh\n' > Element
|
|
printf 'CURRENT_DIR=\"$( cd \"$( dirname \"${BASH_SOURCE[0]}\" )\" && pwd )\"\n' >> Element
|
|
printf '${CURRENT_DIR}/element-desktop-nightly-latest/element-desktop-nightly &\n' >> Element
|
|
chmod +x Element
|
|
|
|
OLD_DIR=$(find -name "element-desktop-nightly-*" -type d)
|
|
|
|
if [ ! -z "$OLD_DIR" ]
|
|
then
|
|
rm -rf "$OLD_DIR"
|
|
fi
|
|
|
|
wget https://packages.element.io/nightly/install/linux/glibc-x86-64/element-desktop-nightly.tar.gz
|
|
|
|
tar xvf element-desktop-nightly.tar.gz
|
|
rm element-desktop-nightly.tar.gz
|
|
|
|
NEW_DIR=$(find -name "element-desktop-nightly-*" -type d)
|
|
mv "$NEW_DIR" "./element-desktop-nightly-latest"
|