Guide: Add Custom Launchers To The Main Menu


mindlord

Notices Two Things
Joined
Mar 10, 2006
Messages
1,790
Location
In a cave.
Website
Visit site
Let's say you have a program that you'd like to run from SD, but don't have a PND for and don't want to bother make an pxml.xml file for either? There's an easy way to do it. Note that this involves writing to the NAND, but .desktop files are very small.

By default the desktop is owned by the root (super user) account. Which is, well, wrong... you need to take ownership of your Desktop folder.

0) open a terminal and type:
Code:
sudo chown [your username]:[your username] /home/[username]/Desktop
0a) And enter your password of course.

1) Right click the desktop

2) Click "Create Launcher..."

3) Fill in the form
Name: Descriptive name for the command
Description: Nice description for the command, which will appear as a tooltip if you hover over the entry
Command: the commandline or path to the script you wish to execute

3a) Select a nice icon for it if you want.

4) Open Thunar

5) Hit Ctrl-H or Click "View" then "Show hidden files" to unhide the hidden icons in your home directory

6) Open the ".local" folder if it exists. If it doesn't exist create it by:

6a) Right click somewhere that isn't an icon and choose "Create Folder"

6b) Name the folder ".local"

7) Open the "share" folder if it exists. If it doesn't exist create it.

8) Open the "applications" folder if it exists. If it doesn't exist create it.

9) Click Desktop from the left side pane on Thunar

10) Right Click the launcher icon you created earlier and choose "Cut" if you don't want the launcher on the desktop too, otherwise choose copy.

11) Press Backspace to return you to ~/.local/share/applications

12) Right Click in the right pane of Thunar, and choose "Paste"
This will cause the launcher you created to appear in the "Other" category in your main menu. If that is good enough for you, you can stop now.

13) Right Click the launcher you just pasted into ~/.local/share/applications/

14) Choose Open with... -> mousepad

15) Locate the categories line, and append the Registered Category Id along with another semi-colon ( ;) to the line. For example if you want the icon to appear in Games your categories line should look like this:
Code:
Categories=Application;Game;

16) Save the file and exit mousepad

17) Have fun clicking on your custom menu entry.

Supplemental:
If you want to avoid writing to your NAND to add entries to your menu, and want the entries to be SD card specific you can do this:

0) If ~/.local/share/applications does not already exist, you will need to create it.
Either use Thunar to create the folders as in steps 6-8 or use the terminal and do:
Code:
mkdir ~/.local
mkdir ~/.local/share
mkdir ~/.local/share/applications

1) Using either Thunar or the termainal create a folder on one of your SD cards and call it "custom menu" or something else meaningful.

2) In a terminal type:
Code:
ln -s "/media/[SD Card ID]/custom menu" ./local/share/applications/[SD Card ID]
If your cards are still being identified as /media/mmcblk?p? then you might want to make the link in ./local/share/applications/[SD Card ID] something unique instead.

3) Paste .desktop files created as described in the first part of this guide into /media/[SD Card ID]/custom menu and they will automagically appear and disappear from the menu when you insert and remove the card.

4) Repeat this process for as many cards as you like.

Edit: fixed a syntax error, and an omission
 
Top