Update README

This commit is contained in:
erroneousboat 2017-08-26 10:50:19 +02:00
parent c06d57a67c
commit 516b880e08

152
README.md
View File

@ -5,87 +5,113 @@ A [Slack](https://slack.com) client for your terminal.
![Screenshot](/screenshot.png?raw=true)
Getting started
---------------
Installation
------------
1. [Download](https://github.com/erroneousboat/slack-term/releases) a
compatible version for your system, and place where you can access it from
the command line like, `~/bin`, `/usr/local/bin`, or `/usr/local/sbin`. Or
get it via Go:
#### Binary installation
[Download](https://github.com/erroneousboat/slack-term/releases) a
compatible binary for your system. For convenience place `slack-term` in a
directory where you can access it from the command line. Usually this is
`/usr/local/bin`.
```bash
$ go get -u github.com/erroneousboat/slack-term
```
```bash
$ mv slack-term /usr/local/bin
```
2. Get a slack token, click [here](https://api.slack.com/docs/oauth-test-tokens)
#### Via Go
3. Create a `slack-term.json` file, place it in your home directory. The file
should resemble the following structure (don't forget to remove the comments):
If you want you can also get `slack-term` via Go:
```javascript
{
"slack_token": "yourslacktokenhere",
```bash
$ go get -u github.com/erroneousboat/slack-term
```
// OPTIONAL: add the following to use light theme, default is dark
"theme": "light",
Setup
-----
// OPTIONAL: set the width of the sidebar (between 1 and 11), default is 1
"sidebar_width": 3,
1. Get a slack token, click [here](https://api.slack.com/docs/oauth-test-tokens)
// OPTIONAL: define custom key mappings, defaults are:
"key_map": {
"command": {
"i": "mode-insert",
"k": "channel-up",
"j": "channel-down",
"g": "channel-top",
"G": "channel-bottom",
"<previous>": "chat-up",
"C-b": "chat-up",
"C-u": "chat-up",
"<next>": "chat-down",
"C-f": "chat-down",
"C-d": "chat-down",
"q": "quit",
"<f1>": "help"
},
"insert": {
"<left>": "cursor-left",
"<right>": "cursor-right",
"<enter>": "send",
"<escape>": "mode-command",
"<backspace>": "backspace",
"C-8": "backspace",
"<delete>": "delete",
"<space>": "space"
},
"search": {
"<left>": "cursor-left",
"<right>": "cursor-right",
"<escape>": "clear-input",
"<enter>": "clear-input",
"<backspace>": "backspace",
"C-8": "backspace",
"<delete>": "delete",
"<space>": "space"
}
2. Create a `slack-term.json` file, place it in your home directory. Below is
an an example file, you can leave out the `OPTIONAL` parts, you are only
required to specify a `slack_token`. Remember that your file should be
a valid json file so don't forget to remove the comments.
```javascript
{
"slack_token": "yourslacktokenhere",
// OPTIONAL: add the following to use light theme, default is dark
"theme": "light",
// OPTIONAL: set the width of the sidebar (between 1 and 11), default is 1
"sidebar_width": 3,
// OPTIONAL: define custom key mappings, defaults are:
"key_map": {
"command": {
"i": "mode-insert",
"k": "channel-up",
"j": "channel-down",
"g": "channel-top",
"G": "channel-bottom",
"<previous>": "chat-up",
"C-b": "chat-up",
"C-u": "chat-up",
"<next>": "chat-down",
"C-f": "chat-down",
"C-d": "chat-down",
"q": "quit",
"<f1>": "help"
},
"insert": {
"<left>": "cursor-left",
"<right>": "cursor-right",
"<enter>": "send",
"<escape>": "mode-command",
"<backspace>": "backspace",
"C-8": "backspace",
"<delete>": "delete",
"<space>": "space"
},
"search": {
"<left>": "cursor-left",
"<right>": "cursor-right",
"<escape>": "clear-input",
"<enter>": "clear-input",
"<backspace>": "backspace",
"C-8": "backspace",
"<delete>": "delete",
"<space>": "space"
}
}
```
}
```
4. Run `slack-term`:
Usage
-----
```bash
$ slack-term
When everything is setup correctly you can run `slack-term` with the following
command:
// or specify the location of the config file
$ slack-term -config [path-to-config-file]
```
```bash
$ slack-term
```
You can also specify the location of the config file, this will give you
the possibility to run several instances of `slack-term` with different
accounts.
```bash
$ slack-term -config [path-to-config-file]
```
Default Key Mapping
-------------------
Below are the default key-mapping for `slack-term`, you can change them
in your `slack-term.json` file.
| mode | key | action |
|---------|-----------|----------------------------|
| command | `i` | insert mode |