Skip to content

Commit 00c3825

Browse files
authored
Merge pull request #5 from murtaza-u/nightly
V1.0
2 parents a643f4f + 4b3b999 commit 00c3825

29 files changed

+1559
-1352
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ BINDIR ?= $(PREFIX)/bin
44
all: trt
55

66
trt:
7-
go build
7+
CGO_ENABLED=1 go build
88

99
install: all
1010
install -d $(DESTDIR)$(BINDIR)

PKGBUILD

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,28 @@
1-
# Maintainer: Murtaza Udaipurwala <murtaza.u6e24@gmail.com>
1+
# Maintainer: Murtaza Udaipurwala <murtaza@murtazau.xyz>
22
pkgname=transmission-remote-tui-git
33
_gitname=${pkgname%-git}
44
pkgver=0.0
55
pkgrel=1
66
pkgdesc="A TUI for BitTorrent client Transmission"
77
arch=('any')
8-
url="https://github.com/Murtaza-Udaipurwala/transmission-remote-tui"
8+
url="https://github.com/murtaza-u/transmission-remote-tui"
99
license=('GPL3')
10-
depends=("transmission-cli")
11-
makedepends=("make" "git" "go")
10+
makedepends=("git" "go" "make")
1211
provides=("trt")
1312
source=("git+$url")
1413
md5sums=('SKIP')
1514

1615
pkgver() {
1716
cd "$_gitname"
18-
printf "0.0.r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
17+
printf "0.1r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
1918
}
2019

2120
build() {
22-
cd "$_gitname"
23-
make
21+
cd "$_gitname"
22+
make
2423
}
2524

2625
package() {
27-
cd "$_gitname"
26+
cd "$_gitname"
2827
make PREFIX=/usr DESTDIR="$pkgdir" install
2928
}

README.md

Lines changed: 61 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -1,72 +1,77 @@
1-
# Transmission Remote TUI (trt)
2-
> A TUI for BitTorrent client transmission
1+
# Transmission Remote TUI (`trt`)
32

3+
> A TUI for BitTorrent client transmission
44
5-
![torrent list](assets/torrents.png)
5+
![torrent list](./look/torrents.jpg)
6+
![files](./look/details.jpg)
67

7-
![peers](assets/peers.png)
8+
## Installation
89

9-
![overview](assets/overview.png)
10-
<figcaption align = "center"><b><sup>**</sup>Yes! I am torrenting linux/bsd iso to evade legal issues</b></figcaption>
10+
### Arch Linux
1111

12-
## Installation
12+
* `trt` is available in the `AUR` (packaged by the developer himself)
1313

14-
#### Arch Linux
15-
- `trt` is available in the AUR(packaged by the developer himself)
1614
```bash
17-
$ yay -S transmission-remote-tui-git
15+
yay -S transmission-remote-tui-git
1816
```
1917

20-
#### From source
21-
- Build dependencies: `go`
18+
### From source
19+
20+
* Build dependencies: `go`
2221

2322
```bash
24-
$ git clone https://github.com/Murtaza-Udaipurwala/transmission-remote-tui
25-
$ cd transmission-remote-tui
26-
$ make
27-
$ sudo make clean install
23+
make && sudo make install clean
2824
```
2925

3026
## Usage
31-
- The actual binary is called `trt`
3227

33-
- Transmission daemon must be running
28+
* The actual binary is called `trt`
29+
* Transmission daemon must be running
30+
3431
```bash
35-
$ transmission-daemon &
32+
transmission-daemon &
3633
```
3734

38-
- In case you have changed the default transmission rpc port(9091), specify the new port
35+
* Remote `RPC` URL
36+
3937
```bash
40-
$ trt --port <new port>
38+
trt --url http://203.12.65.10:9091/transmission/rpc
4139
```
4240

43-
- In case you enabled authentication, specify the username and password
41+
* Authenticate, if required
42+
4443
```bash
45-
$ trt --username <username> --password <password>
44+
trt --username <username> --password <password>
4645
```
4746

48-
- Navigation
47+
* Version
4948

50-
| keybinding | Action |
51-
|------------|---------------------------------------------|
52-
| h, j, k, l | move around |
53-
| g | scroll the to top of the page |
54-
| G | scroll the to bottom of the page |
55-
| q | quit / go back |
56-
| Q | kill the transmission daemon |
57-
| l, enter | show more details about a torrent |
58-
| K | move torrent up the queue |
59-
| J | move torrent down the queue |
60-
| U | move torrent at the top of the queue |
61-
| D | move torrent at the bottom of the queue |
62-
| p | pause/start torrent |
63-
| r | remove torrent |
64-
| R | remove torrent and delete all the files |
65-
| v | verify torrent |
66-
| t | ask trackers for more peers |
67-
| m | copy magnet link to clipboard |
68-
69-
- Changing file's priority
49+
```bash
50+
trt --version
51+
```
52+
53+
* Navigation
54+
55+
| keybinding | Action |
56+
|------------|----------------------------------------------------|
57+
| h, j, k, l | move around |
58+
| g | scroll to the top of the page |
59+
| G | scroll to the bottom of the page |
60+
| q | quit / go back |
61+
| Q | kill the transmission daemon |
62+
| l, enter | show more details about a torrent |
63+
| K | move torrent up the queue |
64+
| J | move torrent down the queue |
65+
| U | move torrent at the top of the queue |
66+
| D | move torrent at the bottom of the queue |
67+
| p | pause/start torrent |
68+
| r | remove torrent |
69+
| R | remove torrent and delete corresponding local data |
70+
| v | verify torrent |
71+
| t | ask trackers for more peers |
72+
| m | copy magnet link to clipboard |
73+
74+
* Changing file's priority
7075

7176
| keybinding | Action |
7277
|------------|---------------------------------------------|
@@ -80,57 +85,33 @@ $ trt --username <username> --password <password>
8085
| N | change priority of all files to 'normal' |
8186
| H | change priority of all files to 'high' |
8287

83-
## Uninstalling
88+
## Uninstall
89+
8490
```bash
85-
$ sudo make uninstall
91+
sudo make uninstall
8692
```
8793

8894
## Further reading
8995

90-
### Setting up mimeapp entry
91-
- `trt` does not have the ability to read/add torrent files/magnet
92-
links(however, it can be added rather easily). This is because you don't
93-
really need this feature.
94-
95-
- Simply create a mimeapp entry, telling it what to do when it finds a torrent file/magnet link
96-
```bash
97-
# File: ~/.config/mimeapps.list
98-
# xdg-open will use these settings to determine how to open filetypes.
99-
100-
[Default Applications]
96+
* `trt` does not have the ability to read new torrent files/magnet links.
97+
Use [transmission-remote](https://linux.die.net/man/1/transmission-remote)
98+
for that.
10199

102-
# These .desktop entries can also be seen and changed in ~/.local/share/applications/
103-
x-scheme-handler/magnet=torrent.desktop;
104-
application/x-bittorrent=torrent.desktop;
105-
```
100+
* Adding `mimeapp` entry
106101

107-
- Now we must create torrent.desktop file under `~/.local/share/applications/`
108102
```bash
109103
# File: ~/.local/share/applications/torrent.desktop
110104

111105
[Desktop Entry]
112106
Type=Application
113107
Name=Torrent
114-
Exec=/usr/bin/env transadd %U
108+
Exec=/usr/bin/env transmission-remote -a %U
115109
```
116110

117-
- `transadd` is a shell script in my `PATH`. This is the script that tells
118-
`transmission daemon` to add our torrent
119111
```bash
120-
#!/bin/sh
121-
122-
# Mimeapp script for adding torrent to transmission-daemon, but will also start
123-
# the daemon first if not running. transmission-daemon sometimes fails to take
124-
# remote requests in its first moments, hence the sleep.
112+
# File: ~/.config/mimeapps.list
125113

126-
pidof transmission-daemon >/dev/null || transmission-daemon &
127-
sleep 3
128-
# notify-send "🔽 Adding Torrent"
129-
exec transmission-remote -a "$@"
114+
[Default Applications]
115+
x-scheme-handler/magnet=torrent.desktop;
116+
application/x-bittorrent=torrent.desktop;
130117
```
131-
132-
[Video tutorial on setting up mimeapp entry](https://odysee.com/@Luke:7/torrenting-setup-with-transmission:1)(the TUI program used is `transmission-remote-cli` instead of `trt`)
133-
134-
135-
#### All pull requests are welcomed
136-
#### Open issues for discussion/bug report

assets/overview.png

-134 KB
Binary file not shown.

assets/peers.png

-318 KB
Binary file not shown.

assets/torrents.png

-96.8 KB
Binary file not shown.

cli/cli.go

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,19 @@ package cli
22

33
import "flag"
44

5-
func ParseArgs() (username, password, url string, port int) {
6-
flag.IntVar(&port, "port", 9091, "rpc port")
7-
flag.StringVar(&username, "username", "", "username")
8-
flag.StringVar(&password, "password", "", "password")
9-
flag.StringVar(&url, "url", "http://localhost", "rpc url")
5+
type Flags struct {
6+
Username string
7+
Password string
8+
URL string
9+
Version bool
10+
}
11+
12+
const defaultURL = "http://localhost:9091/transmission/rpc"
13+
14+
func (f *Flags) Parse() {
15+
flag.StringVar(&f.URL, "url", defaultURL, "RPC url")
16+
flag.StringVar(&f.Username, "username", "", "username")
17+
flag.StringVar(&f.Password, "password", "", "password")
18+
flag.BoolVar(&f.Version, "version", false, "version")
1019
flag.Parse()
11-
return
1220
}

core/communication.go

Lines changed: 0 additions & 66 deletions
This file was deleted.

0 commit comments

Comments
 (0)