Personal Application Launchers
Revision for “Personal Application Launchers” created on May 1, 2023 @ 18:37:42
Title | Personal Application Launchers |
---|---|
Content | <h1>Personal Application Launchers</h1>
<strong>Application launchers</strong> are central to the <strong>Moksha</strong> <strong>window management system</strong>. They control which <strong>menu</strong> (<em>if any</em>) <em>lists</em> an <strong>application</strong>, and how that <strong>application</strong> is to be <em>run</em> (among other things). Application launchers are also called '<strong>desktop configuration files</strong>', and they have the extension <code>.desktop</code>. These files are in <code>/usr/share/applications</code>.
<strong>Personal application launchers</strong> are <code>.desktop</code> files that you <em>create.</em> These are <em>not stored</em> in the above folder but in your <code>Home</code> directory at <code>.local/share/applications</code>.
<em>Note: folders beginning with a '<code>.</code>' are hidden folders; to see them, open <a href="https://www.bodhilinux.com/a/thunar/">Thunar</a> and press Ctrl+H</em>
<h2>Example 1: Disabling Touchpad at Startup</h2>
Suppose you want to <em>disable</em> the touchpad on your laptop; one way is to create a <strong>personal application launcher</strong> which runs the TouchPadOff command then <em>adds</em> that launcher to your list of <strong>startup applications</strong>. Here are the steps in detail:
1. Open the <strong>Personal Application Launcher</strong> dialog box: <strong><em>Main menu > Settings > Settings Panel > Apps > Personal Application Launcher</em></strong>
2. <em>Click</em> <strong>Add</strong>, and the <strong>Desktop Entry Editor</strong> <em>opens</em>. <em>Make</em> the <strong>entries</strong> shown in the screenshot below - e<em>nter</em> a suitable <strong>Name</strong> (<em>e.g. Touchpad Off</em>), in the <strong>Application</strong> field the <strong>command</strong> which<em> turns off</em> the <strong>touchpad</strong>:
<pre>synclient TouchPadOff=1</pre>
<em>Tip: type the command exactly as shown...or copy-and-paste it!</em>
<a href="https://www.bodhilinux.com/trial/wp-content/uploads/2015/02/prsapplnchr.png"><img class="alignnone size-full wp-image-4944" src="https://www.bodhilinux.com/trial/wp-content/uploads/2015/02/prsapplnchr.png" alt="" width="481" height="441" /></a>
<p style="text-align: left;">3. <em>Click</em> on the <strong>General</strong> <strong>tab</strong> and in the <strong>Categories</strong> field <em>enter</em> <strong>Settings - t</strong>his will <em>add</em> your <strong>launcher</strong> to <strong><em>Applications > Preferences</em></strong></p>
<p style="text-align: left;">4. There is no need to change anything in the <strong>Options</strong> section (<em>i.e. leave the first two items un-ticked but Show in Menus ticked</em>)</p>
<p style="text-align: left;">5. <em>Click</em> <strong>Apply</strong> - your <strong>Personal Application Launcher</strong> will be <em>saved</em> in<code>.local/share/applications</code></p>
<p style="text-align: left;">6. Now <em>check</em> that your <strong>application</strong> works: <em>navigate</em> to <strong><em>Main menu > Applications > Preferences</em></strong>, <em>click</em> on its <strong>entry</strong>, and test the touchpad</p>
<p style="text-align: left;">7. If this test is successful, you can <em>close</em> the <strong>dialog box.</strong> Otherwise, <em>correct</em> your <strong>entries</strong> as necessary and <em>test</em> again</p>
<p style="text-align: left;">8. To <em>add</em> this <strong>application</strong> to your <strong>Startup Applications</strong>, <strong>navigate</strong> to the <em>Main menu > Settings > Settings Panel > Apps > Startup Applications</em>. At the <strong>Startup Applications</strong> dialog box, <em>click</em> on the <strong>Applications</strong> tab, <em>scroll</em> down the <strong>list of applications</strong>, <em>highlight</em> your <strong>application</strong>, <em>click</em> <strong>Add</strong>, then <em>click</em> <strong>OK</strong></p>
<p style="text-align: left;">To turn the <strong>touchpad</strong> <em>on</em> again, press <strong>Alt+Esc</strong> to open <strong>Quick Launcher</strong>, and <em>enter</em> the command <code>synclient TouchPadOff=0</code></p>
<h2 style="text-align: left;">Example 2: Now You Try - Launching <a href="https://www.bodhilinux.com/w/conky-full-guide/">Conky</a></h2>
For details see: <a href="https://www.bodhilinux.com/w/enlightenment-basics/#Create_Desktop_Icon_8211_For_an_Installed_App"><span id="Create_Desktop_Icon_8211_For_a_Folder">Create Desktop Icon – For an Installed App</span></a>, but try substituting <strong>Name</strong> with <strong>Conky</strong> and <strong>Application</strong> with <code>/usr/bin/conky</code>
In summary, <em>open</em> the <strong>Desktop Entry Editor</strong> (<em><strong>Main Menu > Settings > Settings Panel</strong></em>). <em>Maximize</em> the <strong>Settings</strong> window, then <em>select</em> <em><strong>Apps > Personal Application Launchers</strong></em>. From there, <em>click</em> <strong>Add</strong> and <em>enter</em> the <strong>details</strong> below:
<ul>
<li>Name: Conky System Monitor</li>
<li>Application: /usr/bin/conky</li>
</ul>
then <em>click</em> <strong>Apply</strong>, <strong>Close</strong>
The above will have created a new <strong>Application</strong> under <em><strong>Main Menu > Applications > Other > Conky System Monitor</strong></em>
<h2>Application launcher arguments</h2>
If you <em>examine</em> the <strong>application launchers</strong> at <code>/usr/share/applications</code> (by opening them in a text editor such as <a href="https://www.bodhilinux.com/a/leafpad/"><strong>Leafpad</strong></a>), you will see many applications are <em>launched</em> with an <strong>argument</strong>, often <code>%f</code> or <code>%U</code>. These two <strong>arguments</strong> <em>control</em> the number of <strong>files</strong> which can be <em>passed</em> to the <strong>application</strong> - <strong>one</strong> in the case of <code>%f</code>, <strong>multiple</strong> <strong>files</strong> in the case of <code>%U</code>.
If you <em>examine</em> the <strong>Desktop Entry Editor</strong> for <a href="https://www.bodhilinux.com/a/leafpad/"><strong>Leafpad</strong></a>, you will see it is <em>launched</em> with the <code>%f</code> argument, whereas <strong>gedit</strong>, which has <strong>tabs</strong> and can therefore handle <strong>multiple</strong> <strong>files</strong>, is <em>launched</em> with the command <code>gedit %U</code>.
<em>For more information on these and other arguments see <a href="https://standards.freedesktop.org/desktop-entry-spec/latest/ar01s06.html">https://standards.freedesktop.org/desktop-entry-spec/latest/ar01s06.html</a></em>
<a href="https://www.bodhilinux.com/">Bodhi Linux Home</a>
<a href="https://www.bodhilinux.com/w/wiki/">Bodhi Linux – Wiki Home Page</a>
<a href="https://www.bodhilinux.com/w/bodhi-linux-how-to/">Bodhi Linux – Wiki Table of Contents</a> |
Excerpt |