- Notifications
You must be signed in to change notification settings - Fork4
An Emacs major mode for managing launchd jobs
License
pekingduck/launchctl-el
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
launchctl is a major mode in Emacs that eases the loading and unloading ofservices (user agents and system daemons) managed bylaunchd on Mac OS X.
launchctl interfaces with the command line toollaunchctl
under the hood.
Launchctl is available fromMELPA.
This package requirestabulated-list-mode which is only available for Emacs 24and onwards.
If you install the package manually, put this in your dot emacs file:
(require'launchctl)
DoM-x launchctl
to enterlaunchctl mode.
Most commands are service-specific: you simply move the point to the correspondingservice and execute that command.
Note that some commands (namely edit, load, unload, enable and disable) requireusers to supply the path to the corresponding service configuration file(.plist).launchctl will first look for<service-name>.plistunder the directories defined inlaunchctl-search-path
, and if the filecan't be found, prompt you for the path.
SeeCustomization below on how to define your own search path.
Refresh the buffer.
Sort the buffer by service name.
You'll be prompted for a file name. Seecustomization on how to customize theconfiguration template.
Put the code below in your .emacs to have Emacs recognize plist files as XML files:
(add-to-list'auto-mode-alist '("\\.plist$". nxml-mode))
Equivalent to
bash$ launchctl load<service-configuration-file>
Equivalent to
bash$ launchctl unload<service-configuration-file>
Unload and then reload.
Once a service has been disabled, you won't be able to start or load it.
Equivalent to
bash$ launchctl unload -w<service-configuration-file>
To start or load a disabled service, you must enable it first.
Equivalent to:
bash$ launchctl load -w<service-configuration-file>
Equivalent to
bash$ launchctl start<service-name>
Equivalent to
bash$ launchctl stop<service-name>
Stop and then start the service.
Equivalent to
bash$ launchctl remove<service-name>
Display service info
Equivalent to:
bash$ launchctl list<service-name>
You will be prompted for a regular expression. Only services whose names matchthe expression will be shown. SeeCustomization below on how to set adefault value.
Set an environment variable. You will be prompted for the variable name and itsvalue (separated by space), e.g.SOME_VAR "SOME VALUE"
.
Equivalent to:
bash$ launchctl setenv SOME_VAR"SOME_VALUE"
Unset an environment variable. You will be prompted for the variable name.
Equivalent to:
bash$ launchctl unsetenv SOME_VAR
Display a help message in the mini-buffer.
You canM-x customize-group
(group name:launchctl
) tocustomizelaunchctl.
The directories to look for service configuration files. The default valueshould be good for most people.
;;; Default("~/Library/LaunchAgents""/System/Library/LaunchAgents""/System/Library/LaunchDaemons")
When you choose to create (n
) a new configuration file, the correspondingfile buffer will be populated by this template.
This regular expression will be used bylaunchctl to filter results . Anempty string (default) or.
means no filtering will be done.
Customize the appearance of theName column.
Customize the widths of the columns
Turn the header line on or off.