maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   General (https://talk.maemo.org/forumdisplay.php?f=7)
-   -   N9 terminal scripting? (https://talk.maemo.org/showthread.php?t=81981)

vihru 2012-01-30 07:41

N9 terminal scripting?
 
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 2012-01-30 13:08

Re: N9 terminal scripting?
 
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.

zayko 2012-01-30 13:47

Re: N9 terminal scripting?
 
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." ;;


vihru 2012-01-30 14:18

Re: N9 terminal scripting?
 
Quote:

Originally Posted by cddiede (Post 1157853)
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 2012-01-30 15:31

Re: N9 terminal scripting?
 
Quote:

Originally Posted by vihru (Post 1157887)
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?

slarti 2012-01-30 15:31

Re: N9 terminal scripting?
 
Quote:

Originally Posted by vihru (Post 1157887)
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.

vihru 2012-01-31 07:12

Re: N9 terminal scripting?
 
Quote:

Originally Posted by slarti (Post 1157925)
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!

eMiL 2012-01-31 07:32

Re: N9 terminal scripting?
 
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


All times are GMT. The time now is 10:32.

vBulletin® Version 3.8.8