pmctl Examples
This page contains example commands for using the Power Manager management pmctl tool.
The examples below assume pmctl
is available in the current working directory. On macOS, change to the Power Manager tools directory following these steps:
Launch Terminal.app
Applications > Utilities > Terminal.app
Run the change directory (
cd
) command:cd /Applications/Power\ Manager.app/Contents/Tools
Export the Schedule
Export the local computer’s schedule to a file:
./pmctl eventstore.events > ~/Desktop/the-schedule.pm-schedule
Import a Schedule
Import a schedule to the local computer from a file:
./pmctl eventstore.store 'events=(plist:file:///Users/example/Desktop/the-schedule.pm-schedule)'
This assumes a file named the-schedule.pm-schedule
exists on the desktop of user example
.
Installer Package to Import a Schedule
Create a macOS installer package that installs the events from the-schedule.pm-schedule
:
./pmctl -to-file-configuration-package ~/Desktop/the-schedule.pkg eventstore.store 'events=(plist:file:///Users/example/Desktop/the-schedule.pm-schedule)'
The created installer package includes a copy of the-schedule.pm-schedule
.
Combining Schedules
Import multiple schedules to the local computer from a file:
./pmctl eventstore.store 'events=(plist:file:///Users/example/Desktop/the-schedule.pm-schedule)' eventstore.store 'events=(plist:file:///Users/example/Desktop/additional.pm-schedule)'
This assumes two files named the-schedule.pm-schedule
and additional.pm-schedule
exists on the desktop of user example
.
Replacing and Combining Schedules
Replacing existing events with the events from two schedules:
./pmctl eventstore.store 'events=(plist:file:///Users/example/Desktop/the-schedule.pm-schedule)' 'replace existing:boolean=true' eventstore.store 'events=(plist:file:///Users/example/Desktop/additional.pm-schedule)'
The first eventstore.store
request includes the parameter replace existing
; this parameter causes any existing events to be removed. The second eventstore.store
request does not replace existing, as this would also remove the events from the-schedule.pm-schedule
, leaving only the events in additional.pm-schedule
.
Setting the Notification Period
Set the notification period to 2 minutes (120 seconds):
./pmctl notifications.setnotifyperiod seconds:integer=120
Restoring the Default Notification Period
Restore the default notification period by omitting the seconds
paramater:
./pmctl notifications.setnotifyperiod
Installer Package Setting the Notification Period
Create a macOS installer package that sets the notification period to 2 minutes (120 seconds):
./pmctl -to-file-configuration-package ~/Desktop/two-minute-notification.pkg notifications.setnotifyperiod seconds:integer=120
This command does not affect the local computer’s settings.