Update ranger simple scripts to work with tmux
This commit is contained in:
parent
9877b248dc
commit
f46c0586aa
@ -225,14 +225,45 @@ alias travel scout -aefiklst
|
|||||||
** Some Custom Keybindings
|
** Some Custom Keybindings
|
||||||
*** Extract
|
*** Extract
|
||||||
#+BEGIN_SRC conf
|
#+BEGIN_SRC conf
|
||||||
map ,x shell atool -x %f
|
# map ,x shell atool -x %f
|
||||||
|
map ,x shell ~/.config/ranger/scripts/extract.sh %f
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
|
**** Extract Script
|
||||||
|
:PROPERTIES:
|
||||||
|
:header-args: :tangle ~/.config/ranger/scripts/extract.sh
|
||||||
|
:header-args+: :comments both :mkdirp yes
|
||||||
|
:header-args+: :shebang "#!/usr/bin/env bash"
|
||||||
|
:END:
|
||||||
|
#+begin_src bash
|
||||||
|
if [ $TMUX ]; then
|
||||||
|
tmux split -v -l 2 atool -x $1 && tmux select-pane -U
|
||||||
|
else
|
||||||
|
atool -x $1
|
||||||
|
fi
|
||||||
|
#+end_src
|
||||||
|
|
||||||
*** Compress
|
*** Compress
|
||||||
#+BEGIN_SRC conf
|
#+BEGIN_SRC conf
|
||||||
map ,z shell apack %f.zip %f
|
# map ,z shell apack %f.zip %f
|
||||||
|
map ,z shell ~/.config/ranger/scripts/compress.sh %f
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
|
**** Compress Script
|
||||||
|
:PROPERTIES:
|
||||||
|
:header-args: :tangle ~/.config/ranger/scripts/compress.sh
|
||||||
|
:header-args+: :comments both :mkdirp yes
|
||||||
|
:header-args+: :shebang "#!/usr/bin/env bash"
|
||||||
|
:END:
|
||||||
|
#+begin_src bash
|
||||||
|
if [ $TMUX ]; then
|
||||||
|
tmux split -v -l 2 apack ${1%.*}.zip $1 && tmux select-pane -U
|
||||||
|
else
|
||||||
|
apack ${1%.*}.zip $1
|
||||||
|
fi
|
||||||
|
#+end_src
|
||||||
|
|
||||||
|
|
||||||
*** Delete first page of pdf
|
*** Delete first page of pdf
|
||||||
#+BEGIN_SRC conf
|
#+BEGIN_SRC conf
|
||||||
map ,d shell ~/scripts/pdf-delete-first-page.sh %f
|
map ,d shell ~/scripts/pdf-delete-first-page.sh %f
|
||||||
@ -248,11 +279,26 @@ map ,z shell apack %f.zip %f
|
|||||||
map ,gs shell emacsclient -create-frame --alternate-editor="" -n --eval '(magit-status)'
|
map ,gs shell emacsclient -create-frame --alternate-editor="" -n --eval '(magit-status)'
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
*** Upload with Tansfer.sh
|
*** Upload with 0x0 (previously Tansfer.sh)
|
||||||
#+BEGIN_SRC conf
|
#+BEGIN_SRC conf
|
||||||
map ,t shell curl --progress-bar --upload-file %f https://transfer.sh/$(basename $1) | xclip -in -selection clipboard;
|
# map ,t shell curl --progress-bar --upload-file %f https://transfer.sh/$(basename $1) | xclip -in -selection clipboard;
|
||||||
|
map ,t shell ~/.config/ranger/scripts/upload.sh %f
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
|
**** Upload Script
|
||||||
|
:PROPERTIES:
|
||||||
|
:header-args: :tangle ~/.config/ranger/scripts/upload.sh
|
||||||
|
:header-args+: :comments both :mkdirp yes
|
||||||
|
:header-args+: :shebang "#!/usr/bin/env bash"
|
||||||
|
:END:
|
||||||
|
#+begin_src bash
|
||||||
|
if [ $TMUX ]; then
|
||||||
|
tmux split -v -l 1 curl --progress-bar -F"file=@$1" https://0x0.st | xclip -in -selection clipboard && tmux select-pane -U
|
||||||
|
else
|
||||||
|
curl --progress-bar -F"file=@$1" https://0x0.st | xclip -in -selection clipboard;
|
||||||
|
fi
|
||||||
|
#+end_src
|
||||||
|
|
||||||
*** Open current folder with PCManFM
|
*** Open current folder with PCManFM
|
||||||
#+begin_src conf
|
#+begin_src conf
|
||||||
map ,o shell nohup pcmanfm %d &
|
map ,o shell nohup pcmanfm %d &
|
||||||
@ -267,7 +313,7 @@ map ,z shell apack %f.zip %f
|
|||||||
*** Basic
|
*** Basic
|
||||||
#+BEGIN_SRC conf
|
#+BEGIN_SRC conf
|
||||||
map Q quit!
|
map Q quit!
|
||||||
map q quit
|
map q eval fm.execute_console("shell tmux detach") if 'TMUX' in os.environ.keys() else fm.execute_console("quit")
|
||||||
copymap q ZZ ZQ
|
copymap q ZZ ZQ
|
||||||
|
|
||||||
map R reload_cwd
|
map R reload_cwd
|
||||||
@ -360,6 +406,7 @@ map ,z shell apack %f.zip %f
|
|||||||
map ga cd ~/Cloud/administratif
|
map ga cd ~/Cloud/administratif
|
||||||
map gm cd ~/Cloud/thesis
|
map gm cd ~/Cloud/thesis
|
||||||
map gp cd ~/Pictures
|
map gp cd ~/Pictures
|
||||||
|
map gT cd ~/.local/share/Trash/files
|
||||||
map gd cd ~/Downloads
|
map gd cd ~/Downloads
|
||||||
map gc cd ~/.config/literate-dotfiles
|
map gc cd ~/.config/literate-dotfiles
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
@ -430,7 +477,7 @@ map = chmod
|
|||||||
|
|
||||||
*** Delete and move files
|
*** Delete and move files
|
||||||
#+BEGIN_SRC conf
|
#+BEGIN_SRC conf
|
||||||
map dD console delete
|
map dD shell -s trash-put %s
|
||||||
map dd cut
|
map dd cut
|
||||||
map ud uncut
|
map ud uncut
|
||||||
map da cut mode=add
|
map da cut mode=add
|
||||||
@ -481,7 +528,6 @@ map = chmod
|
|||||||
map <A-Right> tab_move 1
|
map <A-Right> tab_move 1
|
||||||
map <A-Left> tab_move -1
|
map <A-Left> tab_move -1
|
||||||
map gt tab_move 1
|
map gt tab_move 1
|
||||||
map gT tab_move -1
|
|
||||||
map gn tab_new ~
|
map gn tab_new ~
|
||||||
map uq tab_restore
|
map uq tab_restore
|
||||||
map <a-1> tab_open 1
|
map <a-1> tab_open 1
|
||||||
|
Loading…
Reference in New Issue
Block a user