Menu

Main Menu
Talk Get Daily Search

Member's Online

    User Name
    Password

    N9 terminal scripting?

    Reply
    vihru | # 1 | 2012-01-30, 07:41 | Report

    Good morning!

    Can someone tell me, it is possible to make script that delete wanted icons on desktop? i mean how to make that?
    rm facebook.desktop
    rm twitter.desktop
    etc..

    i dont want use n9 tweak or others.. i want know how to make it itself. because there i can write myself what i want delete. sorry my bad english, i am from finland.

    thanks a lot!

    Edit | Forward | Quote | Quick Reply | Thanks

     
    cddiede | # 2 | 2012-01-30, 13:08 | Report

    Why would you need to script that? There's simple serial commands that would only need to be executed once.

    As root, simply navigate to the /usr/share/applications directory and them perform your remove commands.

    Edit | Forward | Quote | Quick Reply | Thanks

     
    zayko | # 3 | 2012-01-30, 13:47 | Report

    I agree with the post above, a scripts really is not necessary.

    For education; here is the N9QTweak take on removing and restoring unwanted icons. ofc you must first back them up to restore.
    Code:
          j|J)
    
    		echo ""
    		echo "You can Remove or Restore the not necessary"
    		echo "icons from your homescreen."
    		echo "It's not uninstall, it's only remove icons like"
    		echo "User guide, facebook, twiter..."
    		echo ""
    		echo "REMOVE:"
    		echo "1. Remove All"
          echo "(Facebook/User guide/Twitter/Ovi Music/Search)"
    		echo "2. Remove Facebook"
          echo "3. Remove User guide"
          echo "4. Remove Twitter"
          echo "5. Remove Ovi Music"
          echo "6. Remove Search"
          echo " "
          echo "RESTORE:"
    		echo "7. Restore All"
          echo "(Facebook/User guide/Twitter/Ovi Music/Search)"
    		echo "8. Restore Facebook"
          echo "9. Restore User guide"
          echo "10. Restore Twitter"
          echo "11. Restore Ovi Music"
          echo "12. Restore Search"
          echo " "
        read -p "Choose the numbers: " inputline
        echo " "
    
       for carattere in $inputline; do
        case $carattere in
    			[1] ) cd /usr/share/applications && rm -r twitter-qml.desktop userguide.desktop morpheus.desktop facebookqml.desktop search.desktop
                   echo " "
                   echo "Icons Facebook/User guide/Twitter/Ovi Music/Search was removed successfully." ;;
    			[2] ) rm -r /usr/share/applications/facebookqml.desktop
                   echo " "
                   echo "Icon of Facebook was removed successfully." ;;
    			[3] ) rm -r /usr/share/applications/userguide.desktop
                   echo " "
                   echo "Icon of User guide was removed successfully." ;;
    			[4] ) rm -r /usr/share/applications/twitter-qml.desktop
                   echo " "
                   echo "Icon of Twitter was removed successfully." ;;
    			[5] ) rm -r /usr/share/applications/morpheus.desktop
                   echo " "
                   echo "Icon of Ovi Music was removed successfully." ;;
    			[6] ) rm -r /usr/share/applications/search.desktop
                   echo " "
                   echo "Icon of Search was removed successfully." ;;
    			[7] ) cp -f /home/user/MyDocs/.N9QTweakBackup/usr/share/applications/* /usr/share/applications
                   echo " "
                   echo "Icons Facebook/User guide/Twitter/Ovi Music/Search was restored successfully." ;;
    			[8] ) cp -f /home/user/MyDocs/.N9QTweakBackup/usr/share/applications/facebookqml.desktop /usr/share/applications
                   echo " "
                   echo "Icon of Facebook was restored successfully." ;;
    			[9] ) cp -f /home/user/MyDocs/.N9QTweakBackup/usr/share/applications/userguide.desktop /usr/share/applications
                   echo " "
                   echo "Icon of User guide was restored successfully." ;;
    		[1][0] ) cp -f /home/user/MyDocs/.N9QTweakBackup/usr/share/applications/twitter-qml.desktop /usr/share/applications
                   echo " "
                   echo "Icon of Twitter was restored successfully." ;;
    		[1][1] ) cp -f /home/user/MyDocs/.N9QTweakBackup/usr/share/applications/morpheus.desktop /usr/share/applications
                   echo " "
                   echo "Icon of Ovi Music was restored successfully." ;;
    		[1][2] ) cp -f /home/user/MyDocs/.N9QTweakBackup/usr/share/applications/search.desktop /usr/share/applications
                   echo " "
                   echo "Icon of Search was restored successfully." ;;

    Edit | Forward | Quote | Quick Reply | Thanks

     
    vihru | # 4 | 2012-01-30, 14:18 | Report

    Originally Posted by cddiede View Post
    Why would you need to script that? There's simple serial commands that would only need to be executed once.

    As root, simply navigate to the /usr/share/applications directory and them perform your remove commands.
    what do you mean?

    Edit | Forward | Quote | Quick Reply | Thanks

     
    cddiede | # 5 | 2012-01-30, 15:31 | Report

    Originally Posted by vihru View Post
    what do you mean?
    I mean if you want to delete a delete a desktop icon, like say Skype, all you have to do is the following as root in the terminal:

    cd /usr/share/applications
    rm skype.desktop


    That's it. Then it's gone forever, or until you re-flash. No need to script and automate a one time event like that, is there?

    Edit | Forward | Quote | Quick Reply | Thanks

     
    slarti | # 6 | 2012-01-30, 15:31 | Report

    Originally Posted by vihru View Post
    what do you mean?
    He means that you simply remove the .desktop file you want to remove. No need for scripts. For example...

    Code:
    rm -r /usr/share/applications/userguide.desktop
    ...removes the userguide icon.

    YOU SHOULD BACKUP THE FILE BEFORE REMOVING IT!

    Sama suomeksi/The same in Finnish:

    Turha tehdä mitään skriptejä kun ihan tavallinen tiedoston poisto riittää. Kopioit vaan tiedoston ensin jonnekin turvaan.

    Edit | Forward | Quote | Quick Reply | Thanks
    The Following 2 Users Say Thank You to slarti For This Useful Post:
    cddiede, don_falcone

     
    vihru | # 7 | 2012-01-31, 07:12 | Report

    Originally Posted by slarti View Post
    He means that you simply remove the .desktop file you want to remove. No need for scripts. For example...

    Code:
    rm -r /usr/share/applications/userguide.desktop
    ...removes the userguide icon.

    YOU SHOULD BACKUP THE FILE BEFORE REMOVING IT!

    Sama suomeksi/The same in Finnish:

    Turha tehdä mitään skriptejä kun ihan tavallinen tiedoston poisto riittää. Kopioit vaan tiedoston ensin jonnekin turvaan.
    Mietinkin sitä että miten saisin helposti esim poistettua kaikki turhat kuvakkeet tai esim. tehdä scriptin joka kopioi ne kuvakkeet tiettyyn kansioon.. Ehkä tarvitsee vaan opetella noita komentoja niin sillainkin onnistuu aika nopeasti.. Kiitos!

    Edit | Forward | Quote | Quick Reply | Thanks

     
    eMiL | # 8 | 2012-01-31, 07:32 | Report

    I suggest you just rename the files instead of removing them. That way they can be restored at any time:

    mv /usr/share/applications/userguide.desktop /usr/share/applications/.userguide.desktop

    Ad the "." in front of the .desktop entry and the icon in the launcher will be hidden.

    to restore, simply type it in reverse:

    mv /usr/share/applications/.userguide.desktop /usr/share/applications/userguide.desktop

    (all as root naturally!)

    edit: N9QuickTweak contains this particular script you are talking about already! Tweak J

    Edit | Forward | Quote | Quick Reply | Thanks

    Last edited by eMiL; 2012-01-31 at 07:37.

     
vBulletin® Version 3.8.8
Normal Logout