Update ranger

This commit is contained in:
Thomas Dehaeze 2022-02-06 21:47:30 +01:00
parent b38b5e3da1
commit a480eb56b0

View File

@ -11,6 +11,18 @@
%p the full paths of selected files
#+end_quote
After install, run:
#+begin_src bash :tangle no
ranger --copy-config=scope
#+end_src
To add =scope.sh=.
To have image preview:
#+begin_src bash :tangle no
sudo pip3 install ueberzug
#+end_src
* Config
:PROPERTIES:
:header-args: :tangle ~/.config/ranger/rc.conf
@ -217,7 +229,7 @@ map ,o shell nohup pcmanfm %d &
Print on Rnice:
#+BEGIN_SRC conf
map ,p shell print-rnice %f &
map ,p shell print-esrf %f &
#+END_SRC
Backup to NAS:
@ -258,7 +270,6 @@ else
fi
#+end_src
*** Copy File Content
:PROPERTIES:
:header-args: :tangle ~/.config/ranger/scripts/copy-content.sh
@ -266,24 +277,7 @@ fi
:header-args+: :shebang "#!/usr/bin/env bash"
:END:
#+begin_src bash
xclip -sel c < "$1" && dunstify "Ranger" "Copied to clipboard"
#+end_src
*** TODO [#B] 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 --inplace --info=progress2 --rsh='ssh ' "$@" homelab:/srv/storage/Backups/ && tmux select-pane -U
else
rsync -a --info=progress2 --inplace --rsh='ssh' "$@" homelab:/srv/storage/Backups/
fi
xclip -sel c < "$1" && notify-send "Ranger" "Copied to clipboard"
#+end_src
*** Paste with Rsync
@ -298,13 +292,12 @@ fi
#+begin_src bash
if [ $TMUX ]; then
tmux split -v -l 1 rsync -a --info=progress2 "${@:2}" "$1" && tmux select-pane -U
tmux split -v -l 1 rsync -a --info=progress2 --no-inc-recursive "${@:2}" "$1" && tmux select-pane -U
else
rsync -a --info=progress2 "${@:2}" "$1"
rsync -a --info=progress2 --no-inc-recursive "${@:2}" "$1"
fi
#+end_src
** Define keys for the browser
*** Basic
#+BEGIN_SRC conf
@ -421,7 +414,7 @@ map yn shell -f echo -n %f | xsel -i; xsel -o | xsel -i -b
*** Drag and Drop
#+BEGIN_SRC conf
map D shell dragon-drag-and-drop -a -x %p
map D shell dragon -a -x %p
#+END_SRC
*** Rename files
@ -666,20 +659,20 @@ ext x?html?, has w3m, terminal = w3m "$@"
** Word, Excel and Presentation files
#+BEGIN_SRC conf
ext docx?, has onlyoffice, X, flag f = onlyoffice "$@"
ext docx?, has onlyoffice-desktopeditors, X, flag f = onlyoffice-desktopeditors "$@"
ext docx?, has wps, X, flag f = wps "$@"
ext docx?, has libreoffice, X, flag f = libreoffice "$@"
#+END_SRC
#+begin_src conf
ext pptx?, has onlyoffice, X, flag f = onlyoffice "$@"
ext pptx?, has onlyoffice-desktopeditors, X, flag f = onlyoffice-desktopeditors "$@"
ext pptx?, has wps, X, flag f = wps "$@"
ext pptx?, has libreoffice, X, flag f = libreoffice "$@"
#+end_src
#+begin_src conf
ext csv|xlsx?, has sc-im = sc-im -- "$@"
ext csv|xlsx?, has onlyoffice, X, flag f = onlyoffice "$@"
ext csv|xlsx?, has onlyoffice-desktopeditors, X, flag f = onlyoffice-desktopeditors "$@"
ext csv|xlsx?, has wps, X, flag f = wps "$@"
ext csv|xlsx?, has libreoffice, X, flag f = libreoffice "$@"
#+end_src
@ -728,7 +721,7 @@ name ^[mM]akefile$ = make
!mime ^text, !ext xml|json|csv|tex|py|pl|rb|js|sh|php = ask
label editor, !mime ^text, !ext xml|json|csv|tex|py|pl|rb|js|sh|php = $EDITOR -- "$@"
label pager, !mime ^text, !ext xml|json|csv|tex|py|pl|rb|js|sh|php = "$PAGER" -- "$@"
has dragon-drag-and-drop, X, flag f = dragon-drag-and-drop -a -x "$@"
has dragon, X, flag f = dragon -a -x "$@"
#+END_SRC
* Ranger Commands