Launcher and script to “clear recent documents” for the main (slab) menu in openSUSE 11.0 gnome.
If you would like to clear the recent documents in the main (slab) menu like you can with the Traditional Gnome Menu or the Gnome Menu Bar, here is something that worked for me.
- In gedit or other text editor open a new document and insert the following.
#! /bin/sh
rm ~/.recently-used
touch ~/.recently-used
rm ~/.recently-used.xbel
touch ~/.recently-used.xbel
killall gnome-panel
-
Save as “clear_recent.sh” in a folder you keep for scripts. E.g., a good place is in “/home/yourhomedirectory/Documents/Scripts/”. (Replace “yourhomedirectory” with the name of your directory.)
-
Navigate to the file in Nautilus and right click on the file. Select “Properties.”
-
In the “Permissions” tab select “Allow executing file as program.”
You can now add a launcher to the panel, and/or add a launcher to the slab menu.
For adding to the panel, right click on the panel and select “Add to Panel.” Select “Custom Application Launcher.” Name it whatever you want, and use the “Browse” button to locate the script file you just saved for the Command. Click on the icon and select your favorite icon. Suggestion: “/usr/share/icons/Tango/scalable/actions/edit-clear.svg”. (If Tango icons are installed.)
To add to the slab menu, you need to have a good menu editor installed. Alacarte works well and is recommended with Gnome. It is not installed with openSUSE 11.0 Gnome, so you need to install it with software management in YaST.
Once Alacarte is installed, use “alt-F2” for “Run Application” and type in “alacarte” (not the quotation marks). This will open the menu editor in “user mode.” You can add a launcher for your “clear recent” anywhere, but Utilities is a logical choice.
-
Click on Utilities.
-
Select + New Item.
-
This is just like adding a custom application launcher to the panel several paragraphs above. Name it what you want: something like “Clear Recent Docs”.
-
Once the new launcher is added to Utilities, close Alacarte and open the slab menu. Click on “More Applications.” Find “Clear Recent Docs.” If you put it in Utilities, that’s where it should be. It also could be in “Recent Applications.” Right click on “Clear Recent Docs” and select “Add to Favorites.” (Note: For some reason, sometimes recently added items do not show up right away. If they don’t show up right away, restart Gnome by logging out [ctl-alt-delete] or reboot.)
-
Open the main (slab) menu. You should find “Clear Recent Docs” there. If you want it there, that is good. Another place to put it, however, is in the “System” area on the right. Left click and hold on the “Clear Recent Docs” and drag it to the “System” area. It can be moved to where you want it there. To remove the launcher from the “Favorite Applications” just right click on it and select “Remove from Favorites.”
-
Check it out. Click on the launcher. The panel will disappear then appear a few milliseconds later. Recent documents have been cleared.
If you like this way to clear recent docs and it works for you, you might also want to clear all those pesty thumbnails that build up in “.thumbnails” in your home folder. Here is the script, the rest is just like we did for “Clear Recent Docs” if you want to put a launcher in a convenient place on the main (slab) menu.
#! /bin/sh
rm -rf ~/.thumbnails
mkdir ~/.thumbnails ~/.thumbnails/normal
killall gnome-panel