Personal Application Launchers
Application launchers are central to the Moksha window management system. The control, among other things, which menu (if any) lists an application, and how that application is to be run. Application launchers are also called ‘desktop configuration files’, and they have the extension .desktop. You can see these files at /usr/share/applications.
Personal application launchers are .desktop files that you create yourself. These are not stored in the above folder but in your Home directory at .local/share/applications. (Folders beginning with a ‘.’ are hidden folders; to see them, open your file manager and press Ctrl+H.)
Example 1: Disabling the touchpad at startup
Suppose you normally use your laptop computer with a mouse, and you wish to disable the touchpad. One way is to create a personal application launcher which runs the TouchPadOff command, and then to add that launcher to your list of startup applications. Here are the steps in detail:
1. Open the Personal Application Launcher dialog box (Main menu > Settings > Apps > Personal Application Launchers).
2. Click Add, and the Desktop Entry Editor opens. Make the entries shown in the screenshot below, i.e. enter a suitable name (e.g. Touchpad Off), and, in the Application field, the command which turns off the touchpad:
(Type in the command exactly as shown, or copy-and-paste it.)
3. Click on the General tab and in the Categories field enter Settings. (This will add your launcher to Applications > Preferences.)
4. There is no need to change anything in the Options section (i.e. leave the first time items unticked but Show in Menus ticked).
5. Click Apply, and your personal application launcher will be saved in the .local/share/applications folder.
6. Now check that your application works: go to Main menu > Applications > Preferences, click on its entry, and try the touchpad.
7. If this test is successful, you can close the dialog box, otherwise correct your entries as necessary.
8. To add this applcation to your Startup Applications, go to Main menu > Settings > All > Apps > Startup Applications. At the Startup Applications dialog box, click on the Applications tab, scroll down the list applications and highlight yours, click Add, then click OK.
(To turn the touchpad on again, press Alt+Esc to Run Everything, and enter the command synclient TouchPadOff=0)
Example 2: Launching a command-line application
Remastersys is a program which will backup your computer to an ISO file which you can then write as a live system to a USB stick or DVD. It does not appear in the menu system, so you have to run it from the command line. To add it to the menu:
1. Open the Personal Application Launcher dialog box, and make the entries shown below in the Basic section. Note that Remastersys must be run as Root, i.e. via eSudo.
2. Go to the Icon section of the dialog box and enter computer. An icon magically appears; it is from your icon set (i.e. the set selected at the Application Theme Settings dialog box, Icon section). If you click in the icon box you will go to a folder with more icons from that set, where you can select a more suitable icon, or navigate to a different folder of icons. (Other magic words to try here include image and clock, which will take you to other folders of icons. All these folders are at /usr/share/icons.)
3. Go to the General section, where you should enter System in the Categories field. This adds your launcher to the System Tools section of the menus.
4. You can leave the Options section at the default settings (i.e. Show in Menus is ticked, other options unticked).
5. Click Apply, and your launcher will be added to the menus. Go to Main menu > Applications > System Tools to run it. If it launches OK, you can close the Desktop Entry Editor dialog box.
Note that you can return to this dialog box at any time if you wish to amend these entries. To do so, simply launch the application, then right-click on the title bar and from the context menu choose the top option (the application name) then Edit Icon.
Application launcher arguments
If you examine the application launchers at /usr/share/applications (by opening them in a text editor such as ePad), you will see that many applications are launched with an argument, often %U or %f. These two arguments control the number of files that can be passed to the application – one, in the case of %f, multiple files in the case of %U.
Thus if you examine the Desktop Entry Editor for Leafpad (if you have installed that program), you will see that it is launched with the %f argument, whereas ePad, which has tabs and can therefore handle multiple files, is launched with the command epad %U.
For more information on these and other arguments see http://standards.freedesktop.org/desktop-entry-spec/latest/ar01s06.html.