A launcher for programs, files, folders, web pages and other, using Emacs (supersedes anything-launcher)
Emacs Launcher is nothing more than some simple scripts and elisp files that uses Emacs and the Anything package as a launcher to launch programs, web pages, open common folders and what have you. The possibilities are almost endless (since the commands/sources are programmed using elisp) and Emacs Launcher comes with a couple of convenient example "sources" for most needs. By looking at the example sources and the helper functions they use, you should be able to create your own sources to "launch" pretty much everything. And launching does not just mean opening or starting things, you can of course add commands that does something silently. For example, there is an example command that creates a simple alarm using the operating system scheduler. After installation, Emacs Launcher is capable of doing many things from the start, but you probably want to extend it with your own commands, or command sources (see below for what sources that are available from start).
(some time back I blogged about this as well, and it might suit as more background as well: http://muublog.blogspot.se/2014/01/my-emacs-launcher-makes-me-happy.html)
Something like this, with my wonderful default colors:
- Get the files (duh)
- Start Emacs
- Press M-x load-file and then press enter
- Enter the path to the install.el file and press enter
- Answer the questions given in the installer.
This concludes the installation.
The installation mostly copies a lot of files from the source folder and creates two important script files:
- emacs-launcher.cmd
- runemacs.cmd
emacs-launcher.cmd is, in a sense, the launcher. It is the file you want to make your operating system open as fast as possible (see below for options).
runemacs.cmd is used by emacs-launcher.cmd when Emacs Launcher has not already started. After starting Emacs Launcher and executing a command/launching something, it will be minimized and the next time emacs-launcher.cmd is called, it will just restore Emacs Launcher and ask for new input.
Now you have some options on how to launch the launcher (haha!).
This is probably the most convenient option. Follow these steps:
- Make a shortcut on your Desktop to the file emacs-launcher.cmd in the installation directory.
- RMB -> Properties on the shortcut and set a keyboard shortcut in the Shortcut Key field (for example CTRL + ALT + P).
- Click OK.
- Make a shortcut on your Desktop to the file emacs-launcher.cmd in the installation directory.
- Place it somewhere. The options you have here depends on the operating system you use. In Windows XP and Windows 7 (I think), you can place the shortcut for easy access on the Start Menu. This way you can quickly reach it by pressing the Windows key on your keyboard and then the first letter in the shortcut name (adjust the name of the shortcut accordingly, even a number will work).
If the keyboard shortcuts available on shorcuts on the Desktop is not enough, there are plenty of third party tools that can solve the task. A favorite of mine, which I use to start the launcher is AutoHotkey. I actually also use it to hide Emacs Launcher completely, when a command has been executed. I chose however to leave it out since it makes the setup more complicated and it also increases the number of dependencies.
What sources that are used listed in the file emacs-launcher.el, so if you want to disable some or add your own, you should modify this file. The sources themselves are found in emacs-launcher-sources.el.
These are the special commands Cancel and Quit, used to either cancel the launcher (minimizing it) or quit the launcher.
The most complex of the sources uses the .commands file as input. The syntax of that file is quite complex and supports things like starting programs, launching web pages with clipboard content as input, executing Emacs functions or lambda expressions, etc. You can more or less do anything with this source, but with more typing than in other common cases (see below). The included .commands file contains some examples that should make you understand how to make your own. The commands are parsed and executed by the function run-command defined in emacs-functions.el. There is a command defined in .commands that let you add a new command to start programs and files. There is even a command to let you add files as commands using drag and drop.
Let you open Emacs bookmarks in the operating system (not in Emacs).
Search for named text snippets/clips and get the content put on the clipboard. Useful for pieces of text you don't want to type manually or which you forget easily.
Lists and let you open folders from the file .common-folders. You currently have to edit this file manually.
Similar to anything-c-source-common-folders, but for URLs / web pages. There is a command defined in .commands that let you add a URL easily to this file.
Well, it works for me and it has the capabilities that I need, which is to list different commands matching user input. Feel free to submit patches ;)
Well, I did not want to scrap it and decided I liked the name Emacs Launcher better and that maybe, in the future, I will, or others will, add other "launcher engines". Probably someome want to use Helm instead.
No, it's not. It's the most successful of all launcher hacks I have done. It might look funky and it might feel a bit strange to use "a text editor" (though long-time Emacs users knows that is not what it is), but oh is it powerful and easy to customize for people with a little elisp knowledge. In fact, I dare any developer of any launcher to try to writing new "plugins" faster than what people will be able to do in Emacs Launcher. YEAH!