Reply
Thread Tools
Posts: 59 | Thanked: 3 times | Joined on Nov 2011 @ Finland
#1
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!
 
cddiede's Avatar
Posts: 1,034 | Thanked: 784 times | Joined on Dec 2007 @ Annapolis, MD
#2
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.
 
Posts: 4 | Thanked: 4 times | Joined on Jan 2012
#3
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." ;;
 
Posts: 59 | Thanked: 3 times | Joined on Nov 2011 @ Finland
#4
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?
 
cddiede's Avatar
Posts: 1,034 | Thanked: 784 times | Joined on Dec 2007 @ Annapolis, MD
#5
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?
 
Posts: 277 | Thanked: 319 times | Joined on Jan 2010
#6
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.
 

The Following 2 Users Say Thank You to slarti For This Useful Post:
Posts: 59 | Thanked: 3 times | Joined on Nov 2011 @ Finland
#7
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!
 
Posts: 199 | Thanked: 232 times | Joined on Jan 2010 @ Sweden
#8
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
__________________
faN9oy I am!

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


 
Forum Jump


All times are GMT. The time now is 00:21.