Closed smhmd closed 8 months ago
You can use --category
(or simply -c
) parameter of the command. The category must already exist. For example,
qbt torrent add url 'magnet...' -c category_name
Yes, I agree that the command reference in far from perfect right now. Actually it is just the output of the command --help converted to markdown. It would be nice if we can enhance it.
I was thinking of autocompletion, but it is not so easy to implement in both bash and powershell, so I postponed it to uncertain time. If you know how to do it - PRs are always welcome :)
What I'm trying to do:
Have xdg-open
and dmenu
replace qbittorrent
's interface. (using mimi
, btw.)
x-scheme-handler/magnet: exec qbt torrent add url <xdg-open puts arg here>
ideally:
x-scheme-handler/magnet: exec qbt torrent add -c $(echo category list to dmenu, choose or add new) url <xdg-open puts arg here>
Challenges:
$ qbt category list --format list
does not list categories in an ideal way to feed them to dmenu
, which relies on line breaks, as this command outputs one big string with whitespace (and ruin my transparent terminal in the process hhh). could not awk
it as I'm not that familiar with the syntax.xdg-open
's arg placement is not flexible, and qbt
does allow url to be last argument. I'm still trying to find a way to circumvent this. Maybe some command exposes it's args to an env var. Let me know if you can think of anything.The category must already exist.
How to, instead of adding a torrent and setting a category to it using its hash, add a torrent with a category directly?
$ qbt torrent add url 'magnet...' && qbt torrent category torrent-hash --set cat
to$ qbt -tau 'magnet...' -cs cat
.An Aside: Also, I find the command reference to be a bit difficult to work with (I personally find it FOMO inducing, and miss a traditional man page--top to bottom try this and combine it with this). Shell completions would be very helpful in that regard, as well as examples of commands in the main README (that showcase most to be used commands and long niche ones to familiarize users with the syntax. e.g., how to list all categories' names only or something more complex). I'll gladly open a PR for examples once I know how to do stuff.