From bf1eb2b3916111253f1a74fd378bd77fc14e171b Mon Sep 17 00:00:00 2001 From: Aleksandr Mikhailov Date: Sat, 30 Dec 2023 13:52:46 +0100 Subject: [PATCH] Fix installation info in docs --- README.md | 12 ++ docs/docs/installation/Brew.mdx | 20 +++ docs/docs/installation/Cargo.mdx | 105 +++++++++++++++ docs/docs/installation/Linux.mdx | 86 ------------- .../docs/installation/Manual-installation.mdx | 121 ++++++++++++++++++ docs/docs/installation/Setup-client.mdx | 16 +++ 6 files changed, 274 insertions(+), 86 deletions(-) create mode 100644 docs/docs/installation/Brew.mdx create mode 100644 docs/docs/installation/Cargo.mdx delete mode 100644 docs/docs/installation/Linux.mdx create mode 100644 docs/docs/installation/Manual-installation.mdx create mode 100644 docs/docs/installation/Setup-client.mdx diff --git a/README.md b/README.md index 3afe8ec..9e51d1d 100644 --- a/README.md +++ b/README.md @@ -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/) diff --git a/docs/docs/installation/Brew.mdx b/docs/docs/installation/Brew.mdx new file mode 100644 index 0000000..0ee2a07 --- /dev/null +++ b/docs/docs/installation/Brew.mdx @@ -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 diff --git a/docs/docs/installation/Cargo.mdx b/docs/docs/installation/Cargo.mdx new file mode 100644 index 0000000..4811591 --- /dev/null +++ b/docs/docs/installation/Cargo.mdx @@ -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) + + + + Create folder for cofigs `mkdir -p ~/.config/rusty-belt` + Place these files to `~/.config/rusty-belt/` + + + Create folder for configs `mkdir -p ~/Library/Application\ Support/rusty-belt/` + Place these files to `~/Library/Application\ Support/rusty-belt/` + + + + + +Sample app config: + +{ConfigExample} + +Sample logging config: + +{LogExample} + +## Run as service + + + + You can use this file + [**rusty-belt.service**](https://github.com/fido-node/rusty-belt/blob/main/resources/rusty-belt.service) as example: + + {SystemctlUnit} + + 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 + ``` + + + + + 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: + + {LaunchctlPlist} + + Place it to the `~/Library/LaunchAgents/` + + Load services. + ``` + launchctl load ~/Library/LaunchAgents/launched.dev.fidonode.me.rusty_belt_server.plist + ``` + + + + diff --git a/docs/docs/installation/Linux.mdx b/docs/docs/installation/Linux.mdx deleted file mode 100644 index b3e7b2a..0000000 --- a/docs/docs/installation/Linux.mdx +++ /dev/null @@ -1,86 +0,0 @@ ---- -sidebar_position: 2 -sidebar_label: "Linux" ---- -import CodeBlock from '@theme/CodeBlock'; -import ServiceSource from '!!raw-loader!./../../../resources/rusty-belt.service'; -import ConfigExample from '!!raw-loader!./../../../examples/config.yaml'; -import LogExample from '!!raw-loader!./../../../examples/log4rs.yaml'; - -## Requirements - -You need to install rustc and cargo. Yo can use **rustup** or your package manager for your system. - -### Cargo - -Install with cargo from **crates.io** - -``` -cargo install rusty-belt -``` - -### 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 -``` - -### Run as a service - -You can use this file [**rusty-belt.service**](https://github.com/fido-node/rusty-belt/blob/main/resources/rusty-belt.service) for example: - -Fix 7th line acording to the way you've installed binaries. -Use `/.cargo/bin/rusty_belt_server` if you choose cargo as source of binaries. -Use `/.local/bin/rusty_belt_server` if you build it from sources. - -{ServiceSource} - -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 -``` - -### Use sample configs - -Use sample configs or go to [**configuration doc**](../category/configuration) - -Place these files to `~/.config/rusty-belt/` - -Sample app config: - -{ConfigExample} - -Sample logging config: - -{LogExample} diff --git a/docs/docs/installation/Manual-installation.mdx b/docs/docs/installation/Manual-installation.mdx new file mode 100644 index 0000000..b7af84d --- /dev/null +++ b/docs/docs/installation/Manual-installation.mdx @@ -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) + + + + Create folder for cofigs `mkdir -p ~/.config/rusty-belt` + Place these files to `~/.config/rusty-belt/` + + + Create folder for configs `mkdir -p ~/Library/Application\ Support/rusty-belt/` + Place these files to `~/Library/Application\ Support/rusty-belt/` + + + + + +Sample app config: + +{ConfigExample} + +Sample logging config: + +{LogExample} + +## Run as service + + + + 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`. + + {SystemctlUnit} + + 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 + ``` + + + + + 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: + + {LaunchctlPlist} + + Place it to the `~/Library/LaunchAgents/` + + Load services. + ``` + launchctl load ~/Library/LaunchAgents/launched.dev.fidonode.me.rusty_belt_server.plist + ``` + + + diff --git a/docs/docs/installation/Setup-client.mdx b/docs/docs/installation/Setup-client.mdx new file mode 100644 index 0000000..b85f789 --- /dev/null +++ b/docs/docs/installation/Setup-client.mdx @@ -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)" +```