Skip to content

Commit

Permalink
readme
Browse files Browse the repository at this point in the history
  • Loading branch information
caarlos0 committed Aug 16, 2016
1 parent b470536 commit 34a3632
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,43 @@ hours later (and automate the sending of the report too).

To run it, you can simply `./am-i-working -d mycompany > work.log`, or
create a service in the OS level to keep it running forever.

### OSX Service

Create a file like this:

```xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>am-i-working</string>
<key>ProgramArguments</key>
<array>
<string>/path/to/am-i-working</string>
<string>--domain</string>
<string>mycompany</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>StandardOutPath</key>
<string>/path/to/am-i-working-out.log</string>
<key>StandardErrorPath</key>
<string>/path/to/am-i-working-err.log</string>
</dict>
</plist>
```

Changing the path to the `am-i-working` binary, domain argument and where to
save the logs (usually `/Users/USER/Library/Logs/`).

Save the file in `~/Library/LaunchAgents/am-i-working.plist`.

Then run:

```console
launchctl load ~/Library/LaunchAgents/am-i-working.plist
```

And you can check that the `am-i-working` process will be running on background.

0 comments on commit 34a3632

Please sign in to comment.