Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

An Emacs major mode for managing launchd jobs

License

NotificationsYou must be signed in to change notification settings

pekingduck/launchctl-el

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Introduction

Screenshot

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.

Installation

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)

Usage

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.

Commands

grefresh

Refresh the buffer.

qquit window

tsort list

Sort the buffer by service name.

ncreate a new service configuration file

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))

eedit configuration file.

vview configuration file in read-only mode.

lload service

Equivalent to

bash$ launchctl load<service-configuration-file>

uunload service

Equivalent to

bash$ launchctl unload<service-configuration-file>

rreload service

Unload and then reload.

ddisable service permanently

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>

penable service permanently

To start or load a disabled service, you must enable it first.

Equivalent to:

bash$ launchctl load -w<service-configuration-file>

sstart service

Equivalent to

bash$ launchctl start<service-name>

ostop service

Equivalent to

bash$ launchctl stop<service-name>

arestart service

Stop and then start the service.

mremove service

Equivalent to

bash$ launchctl remove<service-name>

idisplay service info

Display service info

Equivalent to:

bash$ launchctl list<service-name>

*filter by regex

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 environment variable

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 environment variable

Unset an environment variable. You will be prompted for the variable name.

Equivalent to:

bash$ launchctl unsetenv SOME_VAR

hdisplay help message

Display a help message in the mini-buffer.

Customization

You canM-x customize-group (group name:launchctl) tocustomizelaunchctl.

launchctl-search-path

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")

launchctl-configuration-template

When you choose to create (n) a new configuration file, the correspondingfile buffer will be populated by this template.

launchctl-filter-regex

This regular expression will be used bylaunchctl to filter results . Anempty string (default) or. means no filtering will be done.

launchctl-name-face

Customize the appearance of theName column.

launchctl-name-width,launchctl-pid-width,launchctl-status-width

Customize the widths of the columns

launchctl-use-header-line

Turn the header line on or off.

Reference

A launchd Tutorial

launchctl.plist(5) manpage

launchctl(1) manpage

launchd(8) manpage

About

An Emacs major mode for managing launchd jobs

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp