From ca5adde5ba4c260961db3f3615a5630736e458df Mon Sep 17 00:00:00 2001 From: Thomas Dehaeze Date: Fri, 27 Mar 2020 15:38:04 +0100 Subject: [PATCH] Add torrent config --- dotfiles/applications.org | 12 +++++++ dotfiles/qutebrowser.org | 5 +++ dotfiles/scripts.org | 29 ++++++++--------- dotfiles/sxhkd.org | 4 +++ dotfiles/torrent.org | 66 +++++++++++++++++++++++++++++++++++++++ 5 files changed, 102 insertions(+), 14 deletions(-) create mode 100644 dotfiles/torrent.org diff --git a/dotfiles/applications.org b/dotfiles/applications.org index 12ff843..8f0533f 100644 --- a/dotfiles/applications.org +++ b/dotfiles/applications.org @@ -204,3 +204,15 @@ Terminal=false MimeType=x-scheme-handler/org-protocol; NoDisplay=true #+end_src + +* Torrent with Transmission +:PROPERTIES: +:header-args: :tangle ~/.local/share/applications/torrent.desktop +:header-args+: :comments both :mkdirp yes +:END: +#+begin_src conf +[Desktop Entry] +Type=Application +Name=Torrent +Exec=tremc %U +#+end_src diff --git a/dotfiles/qutebrowser.org b/dotfiles/qutebrowser.org index c9dfd5d..8f38bca 100644 --- a/dotfiles/qutebrowser.org +++ b/dotfiles/qutebrowser.org @@ -291,6 +291,11 @@ Org Capture config.bind(',R', 'hint links userscript ~/.config/qutebrowser/userscripts/org-capture.sh') #+end_src +Download a torrent +#+begin_src python + config.bind(',t', 'hint links spawn --userscript ~/scripts/torrent-add.sh {hint-url}') +#+end_src + Annotate with Hypothesis #+begin_src python config.bind(',a', "jseval javascript:(function(){window.hypothesisConfig=function(){return{showHighlights:true,appType:'bookmarklet'};};var d=document,s=d.createElement('script');s.setAttribute('src','https://hypothes.is/embed.js');d.body.appendChild(s)})();") diff --git a/dotfiles/scripts.org b/dotfiles/scripts.org index 6b3eaab..b268daf 100644 --- a/dotfiles/scripts.org +++ b/dotfiles/scripts.org @@ -15,13 +15,14 @@ #+HTML_HEAD: #+HTML_HEAD: #+HTML_HEAD: + +#+PROPERTY: header-args:bash :comments both :mkdirp yes +#+PROPERTY: header-args:bash+ :shebang "#!/usr/bin/env bash" :END: * Wallpapers :PROPERTIES: :header-args: :tangle ~/scripts/wallpapers.sh -:header-args+: :comments both :mkdirp yes -:header-args+: :shebang "#!/usr/bin/env bash" :END: #+begin_src bash @@ -34,8 +35,6 @@ * LockScreen :PROPERTIES: :header-args: :tangle ~/scripts/lockscreen.sh -:header-args+: :comments both :mkdirp yes -:header-args+: :shebang "#!/usr/bin/env bash" :END: First, turn off dunst @@ -103,8 +102,6 @@ Finally, lock the screen using =i3lock=. * Lock / Exit / Suspend / ... :PROPERTIES: :header-args: :tangle ~/scripts/quit.sh -:header-args+: :comments both :mkdirp yes -:header-args+: :shebang "#!/usr/bin/env bash" :END: #+begin_src bash @@ -131,8 +128,6 @@ Finally, lock the screen using =i3lock=. * NAS - Mount :PROPERTIES: :header-args: :tangle ~/scripts/nas.sh -:header-args+: :comments both :mkdirp yes -:header-args+: :shebang "#!/usr/bin/env bash" :END: #+begin_src bash @@ -151,11 +146,21 @@ Finally, lock the screen using =i3lock=. fi #+end_src +* Download Torrent +:PROPERTIES: +:header-args: :tangle ~/scripts/torrent-add.sh +:END: + +#+begin_src bash + transmission-remote ***REMOVED***:9091 --auth tdehaeze:$(pass nas/transmission | sed -n 1p) -a $1 && \ + dunstify 'Torrent' 'Successfully added' || \ + dunstify 'Torrent' 'Error' + +#+end_src + * Icons Unicode :PROPERTIES: :header-args: :tangle ~/scripts/icons.sh -:header-args+: :comments both :mkdirp yes -:header-args+: :shebang "#!/usr/bin/env bash" :END: #+begin_src bash @@ -180,8 +185,6 @@ Finally, lock the screen using =i3lock=. * Org-Protocol-Capture-HTML :PROPERTIES: :header-args: :tangle ~/scripts/org-protocol-capture-html.sh -:header-args+: :comments both :mkdirp yes -:header-args+: :shebang "#!/usr/bin/env bash" :END: Defaults @@ -311,8 +314,6 @@ Send to Emacs * Restart Mopidy :PROPERTIES: :header-args: :tangle ~/scripts/mopidy-restart.sh -:header-args+: :comments both :mkdirp yes -:header-args+: :shebang "#!/usr/bin/env bash" :END: #+begin_src bash diff --git a/dotfiles/sxhkd.org b/dotfiles/sxhkd.org index 63cedaa..2c6f7d7 100644 --- a/dotfiles/sxhkd.org +++ b/dotfiles/sxhkd.org @@ -189,6 +189,10 @@ XF86Display super + space ; i $BROWSER; + # Start Terminal Application + super + space ; t + $TERMINAL -e "tremc" + # Alternative Browser super + space ; shift + i brave; diff --git a/dotfiles/torrent.org b/dotfiles/torrent.org new file mode 100644 index 0000000..46b69bd --- /dev/null +++ b/dotfiles/torrent.org @@ -0,0 +1,66 @@ +#+TITLE: Torrent Configuration +:DRAWER: +#+STARTUP: overview + +#+LANGUAGE: en +#+EMAIL: dehaeze.thomas@gmail.com +#+AUTHOR: Dehaeze Thomas + +#+HTML_LINK_HOME: ./index.html +#+HTML_LINK_UP: ./index.html + +#+HTML_HEAD: +#+HTML_HEAD: +#+HTML_HEAD: +#+HTML_HEAD: +#+HTML_HEAD: +#+HTML_HEAD: +:END: + +* NAS Configuration + +* Tremc - Curses interface for Transmission +https://github.com/tremc/tremc + +#+begin_src conf :comments none :mkdirp yes :tangle ~/.config/tremc/settings.cfg :noweb no-export +[Connection] +password = <> +username = tdehaeze +port = 9091 +host = ***REMOVED*** +path = /transmission/rpc +ssl = False + +[Sorting] +order = name + +[Filtering] +filter = +invert = False + +[Misc] +compact_list = False +torrentname_is_progressbar = True +file_viewer = xdg-open %%s +file_open_in_terminal = True + +[Colors] +title_seed = bg:green,fg:black +title_download = bg:blue,fg:black +title_idle = bg:cyan,fg:black +title_verify = bg:magenta,fg:black +title_paused = bg:black,fg:white +title_error = bg:red,fg:white +download_rate = bg:black,fg:blue +upload_rate = bg:black,fg:red +eta+ratio = bg:black,fg:white +filter_status = bg:red,fg:black +dialog = bg:black,fg:white +dialog_important = bg:red,fg:black +button = bg:white,fg:black +button_focused = bg:black,fg:white +file_prio_high = bg:red,fg:black +file_prio_normal = bg:white,fg:black +file_prio_low = bg:yellow,fg:black +file_prio_off = bg:blue,fg:black +#+end_src