ratiogoblin is a simple tool designed for use with status bars such as i3-bar, Waybar, and Polybar to get your current torrent ratio from IPTorrents.
P.S. I made this in like 1 hour so don't expect too much from it :)
Starting with version 0.2.0, if there is an update available for ratiogoblin, you'll see a "*" appended to the output of ratiogoblin run. To update to the latest version, simply run:
ratiogoblin updateFor previous versions, you will need to repeat the installation steps to get the latest version.
You can install ratiogoblin by grabbing a pre-built binary or by building it from source.
-
Download the latest binary from the GitHub Releases page. Or use
curlto download it directly. ReplaceVERSIONwith the latest version number (e.g.,v0.1.0):export VERSION=v0.1.1 curl -Lo ratiogoblin.tar.gz https://github.com/1337jazz/ratio-goblin/releases/download/$VERSION/ratiogoblin_Linux_x86_64.tar.gz
-
Extract the binary:
tar -xvf ratiogoblin.tar.gz
-
Move the binary to a directory in your system's PATH (e.g.,
/usr/local/bin/):sudo mv ratiogoblin /usr/local/bin/
Now you can run the ratiogoblin command from anywhere in your terminal.
-
Clone the repository:
git clone https://github.com/1337jazz/ratio-goblin.git cd ratio-goblin -
Build the project:
make
This will create the binary at
bin/ratiogoblin. -
(Optional) Move the binary to a global directory to make it accessible system-wide:
sudo mv bin/ratiogoblin /usr/local/bin/
-
(Alternatively) Build with specific version information embedded:
make build-version version=1.0.0-test
To get started with ratiogoblin, follow these steps:
-
Run
ratiogoblin initto create a default configuration file - for most distros this will be at~/.config/ratiogoblin/config.json. -
Edit the configuration file to add your IPTorrents credentials (from your cookie). Note, the
passfield is not necessarily your account password, but thepasscookie value from IPTorrents.{ "uid": "your_uid", "pass": "your_pass" } -
Run
ratiogoblin runto see your current ratio. -
Integrate
ratiogoblinwith your status bar of choice by adding the appropriate command to your bar's configuration (some examples are provided below).
Add the following module to your Polybar configuration file (usually located at ~/.config/polybar/config):
[module/ratiogoblin]
type = custom/script
exec = ratiogoblin run
interval = 3600
label = "Ratio: %output%" # `output` will be your ratioThen, include the module in your bar where desired:
modules-right = ratiogoblin <other-modules>Add the following custom module to your Waybar configuration file (usually located at ~/.config/waybar/config):
"custom/ratiogoblin": {
"exec": "ratiogoblin run",
"interval": 3600,
"format": "Ratio: {text}" # `text` will be your ratio
}Then, add the custom module to Waybar’s modules-right (or other section):
"modules-right": [
"custom/ratiogoblin"
]This project uses goreleaser to automate the release process. Here’s how it works:
- You must have push access to the repository to make a release.
-
Bump the Version: Update the version number in
internal/version/version.gousing semantic versioning.package version const Version = "0.2.0" // Example of new version
-
Commit the Version Update:
git add internal/version/version.go git commit -m "bump version to 0.2.0" -
Tag the Release: Create a new Git tag that starts with
v, and push it to the repository.git tag v0.2.0 git push origin v0.2.0
-
Automated Workflow:
- Once the tag is pushed, the GitHub Actions workflow (
.github/workflows/release.yml) will trigger automatically. - Goreleaser will:
- Build the binaries for the project.
- Package the application into release-ready archives (e.g.,
.tar.gz). - Create a release on GitHub with the versioned tag.
- Generate a changelog from commit history.
- Once the tag is pushed, the GitHub Actions workflow (
-
Release Completed:
- Upon successful completion, the release will be available on the GitHub Releases page complete with downloadable binaries and changelogs.
Contributions are welcome! Please submit pull requests or open issues for any suggestions, bug reports, or improvements.