mirror of
https://github.com/myned/watcher.git
synced 2024-11-01 12:22:38 +00:00
Update readme
This commit is contained in:
parent
93ee34c49d
commit
7ae85f73c8
1 changed files with 47 additions and 11 deletions
58
README.md
58
README.md
|
@ -4,31 +4,31 @@ An experimental [Hikari](https://www.hikari-py.dev) Discord bot for assigning ac
|
|||
[![ko-fi](https://ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/B0B1AUB66)
|
||||
|
||||
## Prerequisites
|
||||
A Unix-based operating system is used for the following commands\
|
||||
Linux is used for the following commands\
|
||||
[WSL](https://docs.microsoft.com/en-us/windows/wsl) can be used to run Linux on Windows, but is not required to run the bot
|
||||
## Requirements
|
||||
[Git](https://git-scm.com/downloads)\
|
||||
[Python](https://www.python.org) 3.10+\
|
||||
[Poetry](https://python-poetry.org/docs/master)
|
||||
## Installing
|
||||
Clone this repository
|
||||
1. Clone repository
|
||||
```
|
||||
git clone https://github.com/Myned/Watcher.git
|
||||
```
|
||||
Go to the project folder
|
||||
2. Go to project folder
|
||||
```
|
||||
cd Watcher
|
||||
```
|
||||
Create a virtual environment and install dependencies
|
||||
3. Create a virtual environment and install dependencies
|
||||
```
|
||||
poetry install
|
||||
```
|
||||
## Usage
|
||||
Go to the project folder
|
||||
1. Go to project folder
|
||||
```
|
||||
cd Watcher
|
||||
```
|
||||
Run with optimizations
|
||||
2. Run with optimizations
|
||||
```
|
||||
poetry run python -OO run.py
|
||||
```
|
||||
|
@ -45,21 +45,57 @@ active = 0 # active role id
|
|||
inactive = 0 # inactive role id
|
||||
duration = 0 # time in seconds before considered inactive
|
||||
```
|
||||
## Updating
|
||||
Go to the project folder
|
||||
### systemd service
|
||||
Run in the background on most Linux machines\
|
||||
This assumes that the project folder is located at `~/.git/Watcher`\
|
||||
Change the `WorkingDirectory` path in `watcher.service` if this is not the case
|
||||
1. Go to project folder
|
||||
```
|
||||
cd Watcher
|
||||
```
|
||||
Pull changes from the repository
|
||||
2. Copy user service file
|
||||
```
|
||||
cp watcher.service ~/.config/systemd/user
|
||||
```
|
||||
3. Reload user daemon
|
||||
```
|
||||
systemctl --user daemon-reload
|
||||
```
|
||||
4. Start and enable service on login
|
||||
```
|
||||
systemctl --user enable --now watcher
|
||||
```
|
||||
5. Enable lingering to start user services on boot
|
||||
```
|
||||
sudo loginctl enable-linger username
|
||||
```
|
||||
## Updating
|
||||
1. Go to project folder
|
||||
```
|
||||
cd Watcher
|
||||
```
|
||||
2. Pull changes from repository
|
||||
```
|
||||
git pull
|
||||
```
|
||||
Update the virtual environment
|
||||
3. Update virtual environment
|
||||
```
|
||||
poetry update
|
||||
```
|
||||
## Uninstalling
|
||||
Remove the project folder
|
||||
1. Stop and disable systemd user service
|
||||
```
|
||||
systemctl --user disable --now watcher
|
||||
```
|
||||
2. Remove systemd user service file
|
||||
```
|
||||
rm ~/.config/systemd/user/watcher.service
|
||||
```
|
||||
3. Optionally disable lingering
|
||||
```
|
||||
sudo loginctl disable-linger username
|
||||
```
|
||||
4. Remove project folder
|
||||
```
|
||||
rm -rf Watcher
|
||||
```
|
||||
|
|
Loading…
Reference in a new issue