Skip to content

Commit

Permalink
misc docs
Browse files Browse the repository at this point in the history
  • Loading branch information
mitnk committed Aug 9, 2022
1 parent 8c52ff3 commit a5c9877
Show file tree
Hide file tree
Showing 3 changed files with 75 additions and 32 deletions.
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ Cicada is a simple Unix shell written in Rust.
## Try out cicada with Docker

```
$ docker pull mitnk/cicada
$ docker run --rm -it mitnk/cicada
(in-cicada) $ cinfo
```
Expand Down Expand Up @@ -88,7 +87,6 @@ Read APIs here: [https://docs.rs/cicada/](https://docs.rs/cicada/).

## FAQs

- [Why another shell?](https://github.com/mitnk/cicada/blob/master/docs/faq.md#user-content-why-another-shell)
- [Compare to bash/zsh/etc?](https://github.com/mitnk/cicada/blob/master/docs/faq.md#user-content-compare-to-other-shells)
- [Is cicada POSIX-compatible?](https://github.com/mitnk/cicada/blob/master/docs/faq.md#user-content-is-cicada-posix-compatible)
- [Will my bash/zsh scripts continue work in cicada?](https://github.com/mitnk/cicada/blob/master/docs/faq.md#user-content-will-my-bashzsh-scripts-continue-work-in-cicada)
Expand Down
1 change: 0 additions & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ Cicada is a simple bash-like Unix shell.
### Try out Cicada Shell with Docker

```
$ docker pull mitnk/cicada
$ docker run --rm -it mitnk/cicada
(in-cicada) $ cinfo
```
104 changes: 75 additions & 29 deletions docs/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,45 @@

There are a few ways to install cicada into your system.

## 1) Install via Pre-built Binaries
## Install on Some Known Linux Distributions

### Alpine Linux

[https://pkgs.alpinelinux.org/package/edge/testing/x86_64/cicada](https://pkgs.alpinelinux.org/package/edge/testing/x86_64/cicada)

```
$ apk add cicada -X https://dl-cdn.alpinelinux.org/alpine/edge/testing/
```

### Arch Linux

[cicada shell on AUR](https://aur.archlinux.org/packages/cicada-shell)

> Note: `makepkg` will install [rust](https://www.rust-lang.org/) system and
> other packages.
```
$ git clone https://aur.archlinux.org/cicada-shell.git
$ cd cicada-shell/
$ makepkg -si
```

## Generic Install Options

### Option A: cargo

If [rust](https://rustup.rs/) installed on your system, you can
install cicada with:
```
$ cargo install -f cicada
```

Optionally, you can move the binary downloaded to a common place:
```
$ cp ~/.cargo/bin/cicada /usr/local/bin/cicada
```

### Option B: via Pre-built Binaries

First download the latest right binary for your system from
[Release Page](https://github.com/mitnk/cicada/releases).
Expand All @@ -17,15 +55,30 @@ $ mv cicada-mac-0.9.2 /usr/local/bin/cicada
$ mv cicada-linux-0.9.2 /usr/local/bin/cicada
$ chmod +x /usr/local/bin/cicada
```

> Due to too many existing CPU arch and different libc versions on same system,
> I tend to stop providing pre-built binaries. Please consider to use other
> options.
### Option C: via Source

# try it
$ cicada
(in-cicada) $ cinfo
Note: [Rust environment](https://rustup.rs/) (Rust stable or above) is required.

```
$ git clone https://github.com/mitnk/cicada
$ cd cicada
# try cicada without installing
$ make
$ make install
```

### Set cicada as your login shell
cicada will be installed under `/usr/local/bin`

## Set cicada as your login shell

**WARNING**: Please test cicada on your system before set it as default shell.
**WARNING**: Please test cicada on your system before setting it as default
shell.

In file `/etc/shells`, append the following line:

Expand All @@ -41,33 +94,26 @@ $ chsh -s /usr/local/bin/cicada

Next time you open a terminal window, cicada shell will be the default one.

## 2) Install via cargo crates
### default shell on GNOME Terminal

If you already have [Rust environment](https://rustup.rs/), you can install
cicada with `cargo`:
For GNOME Terminal on Ubuntu or other systems, you may need reboot after
running `chsh`. If failed, another way to config terminal to use cicada is
following:

```
$ cargo install -f cicada
```
Preferences --> Profiles (Unnamed) --> Tab Command:
- [checked] Run command as a login shell
- [checked] Run a custom command instead of my shell:
- Custom command: `cicada -l`

This will install cicada into `~/.cargo/bin/`.
## inputrc

```
$ mv ~/.cargo/bin/cicada /usr/local/bin/
$ cicada
```

## 3) Install via Source

Note: [Rust environment](https://rustup.rs/) (Rust stable or above) is required.
For better terminal use experience, I have following in my `~/.inputrc` file:

```
$ git clone https://github.com/mitnk/cicada
$ cd cicada
# try cicada without installing
$ make
# install cicada into /usr/local/bin/cicada
$ make install
$ cicada
"\e[1;3D": backward-word
"\e[1;3C": forward-word
"\e[1;9D": backward-word
"\e[1;9C": forward-word
"\e[A": history-search-backward
"\e[B": history-search-forward
```

0 comments on commit a5c9877

Please sign in to comment.