Преглед на файлове

Updating the social icon when a mesh peer goes online

Bob Mottram преди 7 години
родител
ревизия
1d929909ba
променени са 1 файла, в които са добавени 8 реда и са изтрити 4 реда
  1. 8
    4
      src/freedombone-image-customise

+ 8
- 4
src/freedombone-image-customise Целия файл

@@ -966,7 +966,15 @@ if [ \$no_of_users -gt 0 ]; then
966 966
         fi
967 967
     fi
968 968
 
969
+    add_social_icon=
969 970
     if [ ! -f /home/$MY_USERNAME/Desktop/social.desktop ]; then
971
+        add_social_icon=1
972
+    else
973
+        if grep -q "Offline" /home/$MY_USERNAME/Desktop/social.desktop; then
974
+            add_social_icon=1
975
+        fi
976
+    fi
977
+    if [ $add_social_icon ]; then
970 978
         echo '[Desktop Entry]' > /home/$MY_USERNAME/Desktop/social.desktop
971 979
         echo 'Name=Social' >> /home/$MY_USERNAME/Desktop/social.desktop
972 980
         echo 'Name[el]=Κοινωνικός' >> /home/$MY_USERNAME/Desktop/social.desktop
@@ -997,10 +1005,6 @@ if [ \$no_of_users -gt 0 ]; then
997 1005
         echo 'Categories=Application;' >> /home/$MY_USERNAME/Desktop/social.desktop
998 1006
         chmod +x /home/$MY_USERNAME/Desktop/social.desktop
999 1007
         chown $MY_USERNAME:$MY_USERNAME /home/$MY_USERNAME/Desktop/social.desktop
1000
-    else
1001
-        if grep -q "Offline" /home/$MY_USERNAME/Desktop/social.desktop; then
1002
-            sed -i 's|Name=.*|Name=Social|g' /home/$MY_USERNAME/Desktop/social.desktop
1003
-        fi
1004 1008
     fi
1005 1009
 
1006 1010
     #if [ ! -f /home/$MY_USERNAME/Desktop/audio.desktop ]; then