Use hostname when opening cryptpad from desktop icon

So that copying and pasting a link to a document makes sense
This commit is contained in:
Bob Mottram 2017-10-24 14:05:26 +01:00
parent 14e21bc6dd
commit ce49d06d18
1 changed files with 4 additions and 1 deletions

View File

@ -933,13 +933,16 @@ if [ \$no_of_users -gt 0 ]; then
echo 'Name=CryptPad' >> /home/$MY_USERNAME/Desktop/cryptpad.desktop echo 'Name=CryptPad' >> /home/$MY_USERNAME/Desktop/cryptpad.desktop
echo 'Type=Application' >> /home/$MY_USERNAME/Desktop/cryptpad.desktop echo 'Type=Application' >> /home/$MY_USERNAME/Desktop/cryptpad.desktop
echo 'Comment=Realtime collaborative editing of documents' >> /home/$MY_USERNAME/Desktop/cryptpad.desktop echo 'Comment=Realtime collaborative editing of documents' >> /home/$MY_USERNAME/Desktop/cryptpad.desktop
echo "Exec=$BROWSER http://127.0.0.1" >> /home/$MY_USERNAME/Desktop/cryptpad.desktop echo "Exec=$BROWSER http://${HOSTNAME}.local" >> /home/$MY_USERNAME/Desktop/cryptpad.desktop
echo "Icon=/etc/cryptpad/icon_cryptpad.png" >> /home/$MY_USERNAME/Desktop/cryptpad.desktop echo "Icon=/etc/cryptpad/icon_cryptpad.png" >> /home/$MY_USERNAME/Desktop/cryptpad.desktop
echo 'Terminal=false' >> /home/$MY_USERNAME/Desktop/cryptpad.desktop echo 'Terminal=false' >> /home/$MY_USERNAME/Desktop/cryptpad.desktop
echo 'Categories=Application;' >> /home/$MY_USERNAME/Desktop/cryptpad.desktop echo 'Categories=Application;' >> /home/$MY_USERNAME/Desktop/cryptpad.desktop
chmod +x /home/$MY_USERNAME/Desktop/cryptpad.desktop chmod +x /home/$MY_USERNAME/Desktop/cryptpad.desktop
chown $MY_USERNAME:$MY_USERNAME /home/$MY_USERNAME/Desktop/cryptpad.desktop chown $MY_USERNAME:$MY_USERNAME /home/$MY_USERNAME/Desktop/cryptpad.desktop
else else
if ! grep -q "${HOSTNAME}.local" /home/$MY_USERNAME/Desktop/cryptpad.desktop; then
sed -i "s|Exec=.*|Exec=$BROWSER http://${HOSTNAME}.local|g" /home/$MY_USERNAME/Desktop/cryptpad.desktop
fi
if grep -q "Offline" /home/$MY_USERNAME/Desktop/cryptpad.desktop; then if grep -q "Offline" /home/$MY_USERNAME/Desktop/cryptpad.desktop; then
sed -i 's|Name=.*|Name=CryptPad|g' /home/$MY_USERNAME/Desktop/cryptpad.desktop sed -i 's|Name=.*|Name=CryptPad|g' /home/$MY_USERNAME/Desktop/cryptpad.desktop
fi fi