From 7fea60675ae0efb75abb02b1b3b017a1a8c3dd4b Mon Sep 17 00:00:00 2001 From: Guido Cella Date: Wed, 15 Jul 2020 17:44:07 +0200 Subject: [PATCH] Add Transmission example --- Examples.md | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/Examples.md b/Examples.md index a7199f6..8a5369a 100644 --- a/Examples.md +++ b/Examples.md @@ -55,6 +55,7 @@ Table of Contents * [Python Behave BDD](#python-behave-bdd) * [fzf as dmenu replacement](#fzf-as-dmenu-replacement) * [dotfiles management](#dotfiles-management) +* [Transmission](#transmission) ### General @@ -1484,4 +1485,19 @@ you manage your dotfiles. It heavily utilises fzf for interactive user experience. It is inspired by forgit, but focuses on dotfiles rather than generic git. By default, it wraps around git bare repository but it could also be easily integrated with a symlink/GNU stow setup. -![dotbare screenshot](https://user-images.githubusercontent.com/43941510/82644470-b4a32c80-9c54-11ea-9601-d237eb98912e.gif) \ No newline at end of file +![dotbare screenshot](https://user-images.githubusercontent.com/43941510/82644470-b4a32c80-9c54-11ea-9601-d237eb98912e.gif) + +### Transmission + +zsh keybinding to select a torrent with transmission-remote. + +```zsh +pick_torrent() LBUFFER="transmission-remote -t ${$({ + for torrent in ${(f)"$(transmission-remote -l)"}; do + torrent_name=$torrent[73,-1] + [[ $torrent_name != (Name|) ]] && echo ${${${(s. .)torrent}[1]}%\*} $torrent_name + done +} | fzf)%% *} -" +zle -N pick_torrent +bindkey '^o' pick_torrent +``` \ No newline at end of file