1
0
Fork 0
mirror of https://github.com/myned/watcher.git synced 2024-11-01 12:22:38 +00:00

Update readme

This commit is contained in:
Myned 2023-03-06 21:45:09 -06:00
parent 93ee34c49d
commit 7ae85f73c8
No known key found for this signature in database
GPG key ID: 28056631D2CF6B1B

View file

@ -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) [![ko-fi](https://ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/B0B1AUB66)
## Prerequisites ## 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 [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 ## Requirements
[Git](https://git-scm.com/downloads)\ [Git](https://git-scm.com/downloads)\
[Python](https://www.python.org) 3.10+\ [Python](https://www.python.org) 3.10+\
[Poetry](https://python-poetry.org/docs/master) [Poetry](https://python-poetry.org/docs/master)
## Installing ## Installing
Clone this repository 1. Clone repository
``` ```
git clone https://github.com/Myned/Watcher.git git clone https://github.com/Myned/Watcher.git
``` ```
Go to the project folder 2. Go to project folder
``` ```
cd Watcher cd Watcher
``` ```
Create a virtual environment and install dependencies 3. Create a virtual environment and install dependencies
``` ```
poetry install poetry install
``` ```
## Usage ## Usage
Go to the project folder 1. Go to project folder
``` ```
cd Watcher cd Watcher
``` ```
Run with optimizations 2. Run with optimizations
``` ```
poetry run python -OO run.py poetry run python -OO run.py
``` ```
@ -45,21 +45,57 @@ active = 0 # active role id
inactive = 0 # inactive role id inactive = 0 # inactive role id
duration = 0 # time in seconds before considered inactive duration = 0 # time in seconds before considered inactive
``` ```
## Updating ### systemd service
Go to the project folder 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 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 git pull
``` ```
Update the virtual environment 3. Update virtual environment
``` ```
poetry update poetry update
``` ```
## Uninstalling ## 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 rm -rf Watcher
``` ```