Add rsync to ranger

This commit is contained in:
Thomas Dehaeze 2020-05-26 10:35:01 +02:00
parent 8f39bb691a
commit 2385ab9b4a

View File

@ -17,6 +17,15 @@
#+HTML_HEAD: <script type="text/javascript" src="./js/readtheorg.js"></script>
:END:
#+begin_quote
%f the highlighted file
%d the path of the current directory
%s the selected files in the current directory
%t all tagged files in the current directory
%c the full paths of the currently copied/cut files
%p the full paths of selected files
#+end_quote
* Config
:PROPERTIES:
:header-args: :tangle ~/.config/ranger/rc.conf
@ -201,7 +210,6 @@ Get Bibtex from PDF
map ,b shell pdf2bib %f
#+END_SRC
Delete first page of pdf
#+BEGIN_SRC conf
map ,d shell pdf-delete-first-page %f
@ -237,6 +245,11 @@ Print on Rnice
map ,p shell print-rnice %f &
#+END_SRC
Backup to NAS
#+BEGIN_SRC conf
map ,B shell ~/.config/ranger/scripts/backup-to-nas.sh %s &
#+END_SRC
** Scripts
*** Extract Script
:PROPERTIES:
@ -267,6 +280,42 @@ Print on Rnice
#+end_src
*** Backup to NAS
:PROPERTIES:
:header-args: :tangle ~/.config/ranger/scripts/backup-to-nas.sh
:header-args+: :comments both :mkdirp yes
:header-args+: :shebang "#!/usr/bin/env bash"
:END:
- Arguments are the files to be backup to the NAS
#+begin_src bash
if [ $TMUX ]; then
tmux split -v -l 2 rsync -a --info=progress2 --rsh='ssh -p10022' "$@" nas:/volume1/Data/Downloads/Backup/ && tmux select-pane -U
else
rsync -a --info=progress2 --rsh='ssh -p10022' "$@" nas:/volume1/Data/Downloads/Backup/
fi
#+end_src
*** Paste with Rsync
:PROPERTIES:
:header-args: :tangle ~/.config/ranger/scripts/paste-rsync.sh
:header-args+: :comments both :mkdirp yes
:header-args+: :shebang "#!/usr/bin/env bash"
:END:
- First argument is the directory where to copy files
- All other arguments are files that are to be copied
#+begin_src bash
if [ $TMUX ]; then
tmux split -v -l 1 rsync -a --info=progress2 ${@:2} $1 && tmux select-pane -U
else
rsync -a --info=progress2 ${@:2} $1
fi
#+end_src
** Define keys for the browser
*** Basic
#+BEGIN_SRC conf
@ -406,6 +455,11 @@ Print on Rnice
map pht paste_hardlinked_subtree
#+END_SRC
Paste with Rsync
#+BEGIN_SRC conf
map pr shell ~/.config/ranger/scripts/paste-rsync.sh %d %c
#+END_SRC
*** Delete and move files
#+BEGIN_SRC conf
map dD shell -s trash-put %s