Skip to content
This repository has been archived by the owner on Jul 14, 2024. It is now read-only.

Commit

Permalink
Fix installation info in docs
Browse files Browse the repository at this point in the history
  • Loading branch information
fido-node committed Dec 30, 2023
1 parent c4674d3 commit bf1eb2b
Show file tree
Hide file tree
Showing 6 changed files with 274 additions and 86 deletions.
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,18 @@ Client-server implementation of tmux statuses
- Weather info
- Battery status

# Install

```
cargo install rusty-belt
```

or

```
brew install fido-node/homebrew-barleywine/rusty-belt
```

# Further reading
[Documentation](https://rusty-belt.fidonode.me/)

Expand Down
20 changes: 20 additions & 0 deletions docs/docs/installation/Brew.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
sidebar_position: 2
sidebar_label: "Brew"
---
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';


## Install

Install from my personal tap.
You can validate it [here](https://github.com/fido-node/homebrew-barleywine/blob/main/Formula/rusty-belt.rb).

```
brew install fido-node/homebrew-barleywine/rusty-belt
```

Follow caveats from brew.
It will guide you how to setup default config.
After that you can use `brew services` to run rusty_belt_server
105 changes: 105 additions & 0 deletions docs/docs/installation/Cargo.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
---
sidebar_position: 2
sidebar_label: "Cargo"
---
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

import CodeBlock from '@theme/CodeBlock';
import ConfigExample from '!!raw-loader!./../../../examples/config.yaml';
import LogExample from '!!raw-loader!./../../../examples/log4rs.yaml';

import SystemctlUnit from '!!raw-loader!./../../../resources/rusty-belt.service'
import LaunchctlPlist from '!!raw-loader!./../../../resources/launched.dev.fidonode.me.rusty_belt_server.plist'


## Requirements

You need to install rustc and cargo. You can use **rustup** or your package manager for your system.
Also you need protobuf.

## Install

Install with cargo from **crates.io**

```
cargo install rusty-belt
```

## Configs

Use sample configs or go to [**configuration doc**](../category/configuration)

<Tabs groupId="operating-systems">
<TabItem value="linux" label="Linux" default>
Create folder for cofigs `mkdir -p ~/.config/rusty-belt`
Place these files to `~/.config/rusty-belt/`
</TabItem>
<TabItem value="apple" label="Apple">
Create folder for configs `mkdir -p ~/Library/Application\ Support/rusty-belt/`
Place these files to `~/Library/Application\ Support/rusty-belt/`
</TabItem>
</Tabs>



Sample app config:

<CodeBlock
language="yaml"
title="config.yaml"
showLineNumbers
>{ConfigExample}</CodeBlock>

Sample logging config:

<CodeBlock
language="yaml"
title="log4rs.yaml"
showLineNumbers
>{LogExample}</CodeBlock>

## Run as service

<Tabs groupId="operating-systems">
<TabItem value="linux" label="Linux" default>
You can use this file
[**rusty-belt.service**](https://github.com/fido-node/rusty-belt/blob/main/resources/rusty-belt.service) as example:

<CodeBlock
language="systemd"
title="~/.config/systemd/user/rusty-belt.service"
showLineNumbers
>{SystemctlUnit}</CodeBlock>

Place it to the `~/.config/systemd/user/`

Reload services, enable and start it.
```
systemctl daemon-reload --user
systemctl --user enable rusty-belt.service
systemctl --user start rusty-belt.service
```

</TabItem>
<TabItem value="apple" label="Apple">

You can use this file
[**launched.dev.fidonode.me.rusty_belt_server.plist**](https://github.com/fido-node/rusty-belt/blob/main/resources/launched.dev.fidonode.me.rusty_belt_server.plist) as example:

<CodeBlock
language="systemd"
title="~/Library/LaunchAgents/launched.dev.fidonode.me.rusty_belt_server.plist"
showLineNumbers
>{LaunchctlPlist}</CodeBlock>

Place it to the `~/Library/LaunchAgents/`

Load services.
```
launchctl load ~/Library/LaunchAgents/launched.dev.fidonode.me.rusty_belt_server.plist
```

</TabItem>
</Tabs>

86 changes: 0 additions & 86 deletions docs/docs/installation/Linux.mdx

This file was deleted.

121 changes: 121 additions & 0 deletions docs/docs/installation/Manual-installation.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
---
sidebar_position: 2
sidebar_label: "Manual Installation"
---
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

import CodeBlock from '@theme/CodeBlock';
import ConfigExample from '!!raw-loader!./../../../examples/config.yaml';
import LogExample from '!!raw-loader!./../../../examples/log4rs.yaml';

import SystemctlUnit from '!!raw-loader!./../../../resources/rusty-belt.service'
import LaunchctlPlist from '!!raw-loader!./../../../resources/launched.dev.fidonode.me.rusty_belt_server.plist'


## Requirements

You need to install rustc and cargo. You can use **rustup** or your package manager for your system.
Also you need protobuf.

## Build from source

Clone repository

```
git clone https://github.com/fido-node/rusty-belt.git
```

Build binaries with release flag

```
cargo build --release
```

Move binaries from `./target/release/` to some dir in your `PATH`

```
cp ./target/release/tmux_client ~/.local/bin
cp ./target/release/rusty_belt_server ~/.local/bin
```

## Configs

Use sample configs or go to [**configuration doc**](../category/configuration)

<Tabs groupId="operating-systems">
<TabItem value="linux" label="Linux" default>
Create folder for cofigs `mkdir -p ~/.config/rusty-belt`
Place these files to `~/.config/rusty-belt/`
</TabItem>
<TabItem value="apple" label="Apple">
Create folder for configs `mkdir -p ~/Library/Application\ Support/rusty-belt/`
Place these files to `~/Library/Application\ Support/rusty-belt/`
</TabItem>
</Tabs>



Sample app config:

<CodeBlock
language="yaml"
title="config.yaml"
showLineNumbers
>{ConfigExample}</CodeBlock>

Sample logging config:

<CodeBlock
language="yaml"
title="log4rs.yaml"
showLineNumbers
>{LogExample}</CodeBlock>

## Run as service

<Tabs groupId="operating-systems">
<TabItem value="linux" label="Linux" default>
You can use this file
[**rusty-belt.service**](https://github.com/fido-node/rusty-belt/blob/main/resources/rusty-belt.service) as example:


Fix 7th line acording to the way you've installed binaries.
F.e. use `/.local/bin/rusty_belt_server`.

<CodeBlock
language="systemd"
title="~/.config/systemd/user/rusty-belt.service"
showLineNumbers
>{SystemctlUnit}</CodeBlock>

Place it to the `~/.config/systemd/user/`

Reload services, enable and start it.
```
systemctl daemon-reload --user
systemctl --user enable rusty-belt.service
systemctl --user start rusty-belt.service
```

</TabItem>
<TabItem value="apple" label="Apple">

You can use this file
[**launched.dev.fidonode.me.rusty_belt_server.plist**](https://github.com/fido-node/rusty-belt/blob/main/resources/launched.dev.fidonode.me.rusty_belt_server.plist) as example:

<CodeBlock
language="systemd"
title="~/Library/LaunchAgents/launched.dev.fidonode.me.rusty_belt_server.plist"
showLineNumbers
>{LaunchctlPlist}</CodeBlock>

Place it to the `~/Library/LaunchAgents/`

Load services.
```
launchctl load ~/Library/LaunchAgents/launched.dev.fidonode.me.rusty_belt_server.plist
```

</TabItem>
</Tabs>
16 changes: 16 additions & 0 deletions docs/docs/installation/Setup-client.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
sidebar_position: 10
sidebar_label: "Setup Client"
---
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';


## Tmux


Set status variables in your tmux config.
```
set -g status-right "#(tmux_client --segment-name=right)"
set -g status-left "#(tmux_client --segment-name=left)"
```

0 comments on commit bf1eb2b

Please sign in to comment.