From ce49d06d1837e38bc602b3eb8471de25cdb6cbda Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Tue, 24 Oct 2017 14:05:26 +0100 Subject: [PATCH] Use hostname when opening cryptpad from desktop icon So that copying and pasting a link to a document makes sense --- src/freedombone-image-customise | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/freedombone-image-customise b/src/freedombone-image-customise index 70c1ad8b..1fa38c24 100755 --- a/src/freedombone-image-customise +++ b/src/freedombone-image-customise @@ -933,13 +933,16 @@ if [ \$no_of_users -gt 0 ]; then echo 'Name=CryptPad' >> /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 "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 'Terminal=false' >> /home/$MY_USERNAME/Desktop/cryptpad.desktop echo 'Categories=Application;' >> /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 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 sed -i 's|Name=.*|Name=CryptPad|g' /home/$MY_USERNAME/Desktop/cryptpad.desktop fi