mirror of
https://github.com/kristoferssolo/traxor.git
synced 2026-01-14 12:36:14 +00:00
This commit is contained in:
parent
d0b8f8177b
commit
6675634391
2
.github/workflows/ci.yml
vendored
2
.github/workflows/ci.yml
vendored
@ -32,7 +32,7 @@ jobs:
|
|||||||
run: cargo fmt --all --check
|
run: cargo fmt --all --check
|
||||||
- name: Run Tests
|
- name: Run Tests
|
||||||
run: |
|
run: |
|
||||||
cargo nextest run --all-features --all-targets
|
cargo nextest run --locked --all-features --all-targets
|
||||||
cargo test --locked --workspace --all-features --doc
|
cargo test --locked --workspace --all-features --doc
|
||||||
- name: Check Documentation
|
- name: Check Documentation
|
||||||
run: cargo doc --locked --workspace --all-features --document-private-items --no-deps
|
run: cargo doc --locked --workspace --all-features --document-private-items --no-deps
|
||||||
|
|||||||
53
.github/workflows/publish.yml
vendored
Normal file
53
.github/workflows/publish.yml
vendored
Normal file
@ -0,0 +1,53 @@
|
|||||||
|
name: Publish
|
||||||
|
on:
|
||||||
|
# Trigger this workflow when a tag is pushed in the format `v1.2.3`.
|
||||||
|
push:
|
||||||
|
tags:
|
||||||
|
# Pattern syntax: https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#filter-pattern-cheat-sheet
|
||||||
|
- "v[0-9]+.[0-9]+.[0-9]+*"
|
||||||
|
# Trigger this workflow manually via workflow dispatch.
|
||||||
|
workflow_dispatch:
|
||||||
|
inputs:
|
||||||
|
version:
|
||||||
|
description: 'Version number in the format `v1.2.3`'
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
jobs:
|
||||||
|
audit:
|
||||||
|
name: Audit
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
timeout-minutes: 10
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- uses: actions-rust-lang/audit@v1
|
||||||
|
with:
|
||||||
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
crates_io_publish:
|
||||||
|
name: Publish (crates.io)
|
||||||
|
needs:
|
||||||
|
- audit
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
timeout-minutes: 25
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- uses: dtolnay/rust-toolchain@stable
|
||||||
|
- name: cargo-release Cache
|
||||||
|
id: cargo_release_cache
|
||||||
|
uses: actions/cache@v4
|
||||||
|
with:
|
||||||
|
path: ~/.cargo/bin/cargo-release
|
||||||
|
key: ${{ runner.os }}-cargo-release
|
||||||
|
- run: cargo install cargo-release
|
||||||
|
if: steps.cargo_release_cache.outputs.cache-hit != 'true'
|
||||||
|
- name: cargo login
|
||||||
|
run: cargo login ${{ secrets.CRATES_IO_API_TOKEN }}
|
||||||
|
- name: "cargo release publish"
|
||||||
|
run: |-
|
||||||
|
cargo release \
|
||||||
|
publish \
|
||||||
|
--workspace \
|
||||||
|
--all-features \
|
||||||
|
--allow-branch HEAD \
|
||||||
|
--no-confirm \
|
||||||
|
--no-verify \
|
||||||
|
--execute
|
||||||
885
Cargo.lock
generated
885
Cargo.lock
generated
File diff suppressed because it is too large
Load Diff
11
Cargo.toml
11
Cargo.toml
@ -2,8 +2,12 @@
|
|||||||
name = "traxor"
|
name = "traxor"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
authors = ["Kristofers Solo <dev@kristofers.xyz>"]
|
authors = ["Kristofers Solo <dev@kristofers.xyz>"]
|
||||||
license = "GPLv3"
|
description = "A terminal UI for managing Transmission torrents"
|
||||||
|
repository = "https://github.com/kristoferssolo/traxor"
|
||||||
|
license = "GPL-3.0"
|
||||||
edition = "2024"
|
edition = "2024"
|
||||||
|
keywords = ["torrent", "transmission", "tui", "terminal"]
|
||||||
|
categories = ["command-line-utilities"]
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
color-eyre = "0.6"
|
color-eyre = "0.6"
|
||||||
@ -23,7 +27,10 @@ tracing-subscriber = { version = "0.3", features = ["registry", "env-filter"] }
|
|||||||
transmission-rpc = "0.5"
|
transmission-rpc = "0.5"
|
||||||
url = "2.5"
|
url = "2.5"
|
||||||
|
|
||||||
|
[dev-dependencies]
|
||||||
|
claims = "0.8"
|
||||||
|
|
||||||
[lints.clippy]
|
[lints.clippy]
|
||||||
pedantic = "warn"
|
pedantic = "warn"
|
||||||
nursery = "warn"
|
nursery = "warn"
|
||||||
# unwrap_used = "warn" // ignore for now
|
unwrap_used = "warn"
|
||||||
|
|||||||
95
README.md
Normal file
95
README.md
Normal file
@ -0,0 +1,95 @@
|
|||||||
|
# Traxor
|
||||||
|
|
||||||
|
A terminal UI for managing Transmission torrents.
|
||||||
|
|
||||||
|
## Features
|
||||||
|
|
||||||
|
- Vim-style navigation (`hjkl`)
|
||||||
|
- Live fuzzy search/filter
|
||||||
|
- Custom tabs with configurable columns
|
||||||
|
- Multi-select for batch operations
|
||||||
|
- Move, rename, delete torrents
|
||||||
|
- Real-time transfer statistics
|
||||||
|
- Fully configurable keybinds and colors
|
||||||
|
|
||||||
|
## Installation
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cargo binstall traxor
|
||||||
|
```
|
||||||
|
|
||||||
|
Or build from source:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
git clone https://github.com/kristoferssolo/traxor
|
||||||
|
cd traxor
|
||||||
|
cargo build --release
|
||||||
|
```
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
|
||||||
|
Make sure Transmission daemon is running, then:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
traxor
|
||||||
|
```
|
||||||
|
|
||||||
|
### Keybinds
|
||||||
|
|
||||||
|
| Key | Action |
|
||||||
|
|-----|--------|
|
||||||
|
| `j/k` | Navigate up/down |
|
||||||
|
| `h/l` | Previous/next tab |
|
||||||
|
| `1-9, 0` | Switch to tab |
|
||||||
|
| `Enter` | Start/stop torrent |
|
||||||
|
| `a` | Start/stop all |
|
||||||
|
| `Space` | Multi-select |
|
||||||
|
| `m` | Move torrent |
|
||||||
|
| `r` | Rename torrent |
|
||||||
|
| `d` | Delete torrent |
|
||||||
|
| `D` | Delete with data |
|
||||||
|
| `/` | Search/filter |
|
||||||
|
| `Esc` | Close popup / clear filter |
|
||||||
|
| `?` | Toggle help |
|
||||||
|
| `q` | Quit |
|
||||||
|
|
||||||
|
## Configuration
|
||||||
|
|
||||||
|
Configuration file: `~/.config/traxor/config.toml`
|
||||||
|
|
||||||
|
Only specify values you want to override. See [config/default.toml](config/default.toml) for all options.
|
||||||
|
|
||||||
|
### Custom Tabs
|
||||||
|
|
||||||
|
```toml
|
||||||
|
[[tabs]]
|
||||||
|
name = "My Tab"
|
||||||
|
columns = ["status", "progress", "name", "size"]
|
||||||
|
```
|
||||||
|
|
||||||
|
Available columns: `name`, `status`, `size`, `downloaded`, `uploaded`, `ratio`, `progress`, `eta`, `peers`, `seeds`, `leeches`, `downspeed`, `upspeed`, `path`, `added`, `done`, `left`, `queue`, `error`, `labels`, `tracker`, `hash`, `private`, `stalled`, `finished`, `files`, `activity`
|
||||||
|
|
||||||
|
### Colors
|
||||||
|
|
||||||
|
```toml
|
||||||
|
[colors]
|
||||||
|
highlight_background = "#3a3a5a"
|
||||||
|
highlight_foreground = "white"
|
||||||
|
status_downloading = "cyan"
|
||||||
|
status_seeding = "white"
|
||||||
|
status_stopped = "dark_gray"
|
||||||
|
```
|
||||||
|
|
||||||
|
### Keybinds
|
||||||
|
|
||||||
|
```toml
|
||||||
|
[keybinds]
|
||||||
|
quit = "q"
|
||||||
|
next_torrent = "j"
|
||||||
|
prev_torrent = "k"
|
||||||
|
filter = "/"
|
||||||
|
```
|
||||||
|
|
||||||
|
## License
|
||||||
|
|
||||||
|
This project is licensed under the GPLv3 License - see the [LICENSE](./LICENSE) file for details.
|
||||||
29
tests/app.rs
29
tests/app.rs
@ -1,24 +1,25 @@
|
|||||||
|
use claims::assert_ok;
|
||||||
use traxor::{app::App, config::Config};
|
use traxor::{app::App, config::Config};
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_app_creation() {
|
fn test_app_creation() {
|
||||||
let config = Config::load().unwrap();
|
let config = assert_ok!(Config::load());
|
||||||
let app = App::new(config).unwrap();
|
let app = assert_ok!(App::new(config));
|
||||||
assert_eq!(app.tabs().len(), 5);
|
assert_eq!(app.tabs().len(), 5);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_app_quit() {
|
fn test_app_quit() {
|
||||||
let config = Config::load().unwrap();
|
let config = assert_ok!(Config::load());
|
||||||
let mut app = App::new(config).unwrap();
|
let mut app = assert_ok!(App::new(config));
|
||||||
app.quit();
|
app.quit();
|
||||||
assert!(!app.running);
|
assert!(!app.running);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_app_next_tab() {
|
fn test_app_next_tab() {
|
||||||
let config = Config::load().unwrap();
|
let config = assert_ok!(Config::load());
|
||||||
let mut app = App::new(config).unwrap();
|
let mut app = assert_ok!(App::new(config));
|
||||||
assert_eq!(app.index(), 0);
|
assert_eq!(app.index(), 0);
|
||||||
app.next_tab();
|
app.next_tab();
|
||||||
assert_eq!(app.index(), 1);
|
assert_eq!(app.index(), 1);
|
||||||
@ -34,8 +35,8 @@ fn test_app_next_tab() {
|
|||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_app_prev_tab() {
|
fn test_app_prev_tab() {
|
||||||
let config = Config::load().unwrap();
|
let config = assert_ok!(Config::load());
|
||||||
let mut app = App::new(config).unwrap();
|
let mut app = assert_ok!(App::new(config));
|
||||||
assert_eq!(app.index(), 0);
|
assert_eq!(app.index(), 0);
|
||||||
app.prev_tab();
|
app.prev_tab();
|
||||||
assert_eq!(app.index(), 4); // Wraps around
|
assert_eq!(app.index(), 4); // Wraps around
|
||||||
@ -45,8 +46,8 @@ fn test_app_prev_tab() {
|
|||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_app_switch_tab() {
|
fn test_app_switch_tab() {
|
||||||
let config = Config::load().unwrap();
|
let config = assert_ok!(Config::load());
|
||||||
let mut app = App::new(config).unwrap();
|
let mut app = assert_ok!(App::new(config));
|
||||||
assert_eq!(app.index(), 0);
|
assert_eq!(app.index(), 0);
|
||||||
app.switch_tab(2);
|
app.switch_tab(2);
|
||||||
assert_eq!(app.index(), 2);
|
assert_eq!(app.index(), 2);
|
||||||
@ -56,8 +57,8 @@ fn test_app_switch_tab() {
|
|||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_app_toggle_popup() {
|
fn test_app_toggle_popup() {
|
||||||
let config = Config::load().unwrap();
|
let config = assert_ok!(Config::load());
|
||||||
let mut app = App::new(config).unwrap();
|
let mut app = assert_ok!(App::new(config));
|
||||||
assert!(!app.show_help);
|
assert!(!app.show_help);
|
||||||
app.toggle_help();
|
app.toggle_help();
|
||||||
assert!(app.show_help);
|
assert!(app.show_help);
|
||||||
@ -67,8 +68,8 @@ fn test_app_toggle_popup() {
|
|||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_app_open_close_popup() {
|
fn test_app_open_close_popup() {
|
||||||
let config = Config::load().unwrap();
|
let config = assert_ok!(Config::load());
|
||||||
let mut app = App::new(config).unwrap();
|
let mut app = assert_ok!(App::new(config));
|
||||||
assert!(!app.show_help);
|
assert!(!app.show_help);
|
||||||
app.open_help();
|
app.open_help();
|
||||||
assert!(app.show_help);
|
assert!(app.show_help);
|
||||||
|
|||||||
@ -1,3 +1,4 @@
|
|||||||
|
#![allow(clippy::unwrap_used)]
|
||||||
use crossterm::event::{KeyCode, KeyEvent};
|
use crossterm::event::{KeyCode, KeyEvent};
|
||||||
use traxor::{app::App, app::InputMode, app::action::Action, config::Config, handler::get_action};
|
use traxor::{app::App, app::InputMode, app::action::Action, config::Config, handler::get_action};
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user