update theme

This commit is contained in:
2023-10-13 12:30:13 +02:00
parent 9346aee86d
commit f8070f6e51
37 changed files with 3017 additions and 3364 deletions

View File

@@ -18,6 +18,16 @@ ranger --copy-config=scope
To add =scope.sh=.
The following has been added to preview =xournalpp= file:
#+begin_src bash
case "${FILE_EXTENSION_LOWER}" in
## xournall file
xopp)
xournalpp-thumbnailer "${FILE_PATH}" "${IMAGE_CACHE_PATH}" && exit 6
;;
esac
#+end_src
To have image preview:
#+begin_src bash :tangle no
sudo pip3 install ueberzug
@@ -41,7 +51,7 @@ set viewmode miller
set column_ratios 1,1
# Which files should be hidden? (regular expression)
set hidden_filter ^\.|\.(?:pyc|vrb|pyo|lof|bak|swp|aux|log|nav|out|snm|toc|bcf|run\.xml|synctex\.gz|blg|bbl)$|^lost\+found$|^__(py)?cache__$
set hidden_filter ^\.|\.(?:pyc|vrb|pyo|lof|bak|swp|aux|log|nav|out|snm|toc|bcf|run\.xml|synctex\.gz|blg|bbl|xopp~)$|^lost\+found$|^__(py)?cache__$
# Show hidden files? You can toggle this by typing 'zh'
set show_hidden false
@@ -202,16 +212,16 @@ Compress:
map ,z shell ~/.config/ranger/scripts/compress.sh %f
#+END_SRC
Get Bibtex from PDF:
#+BEGIN_SRC conf
map ,b shell pdf2bib %f
#+END_SRC
Convert images/pdf/...:
#+BEGIN_SRC conf
map ,c shell convert-file %f
#+END_SRC
Extract BibTeX:
#+begin_src conf
map ,b shell ~/.config/ranger/scripts/add-reference.sh %d/%f
#+end_src
Open SXIV on current directory:
#+BEGIN_SRC conf
map ,s shell nohup sxiv -t %d &
@@ -242,6 +252,32 @@ map ,y shell ~/.config/ranger/scripts/copy-content.sh %s &
#+end_src
** Scripts
*** Extract DOI, create BibTeX and rename file
:PROPERTIES:
:header-args: :tangle ~/.config/ranger/scripts/add-reference.sh
:header-args+: :comments both :mkdirp yes
:header-args+: :shebang "#!/usr/bin/env bash"
:END:
#+begin_src bash
add_reference () {
doi=$(pdf2doi $1 | sed 's/^DOI *//' | sed 's/ \+.*//')
# If empty DOI, ask manually
if [ -z $doi ]; then
doi=$(rofi -dmenu -p "DOI")
fi
# If DOI, add it to Emacs
if [ ! -z $doi ]; then
emacsclient --eval "(tdh-org-ref-import-pdf \"$doi\" \"$1\")" && \
dunstify --replace=49496 "BibTeX" "File copied."
else
dunstify --replace=49496 "BibTeX" "Failed to get DOI"
fi
}
add_reference "$1"
#+end_src
*** Extract Script
:PROPERTIES:
:header-args: :tangle ~/.config/ranger/scripts/extract.sh
@@ -385,8 +421,9 @@ map cd console cd%space
#+BEGIN_SRC conf
map gh cd ~/
map gw cd ~/Cloud/work-projects
map gp cd ~/Pictures
map gp cd ~/Cloud/personnal
map gP cd ~/Cloud/pictures/phone
map gs cd ~/Cloud/pictures/screenshots
map gT cd ~/.local/share/Trash/files
map gd cd ~/Downloads
map gD cd ~/Cloud/documents
@@ -415,7 +452,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 -a -x %p
map D shell dragon-drop -a -x %p
#+END_SRC
*** Rename files
@@ -591,7 +628,27 @@ copycmap <end> <C-e>
# only running the current file even if you have marked multiple files.
#+END_SRC
** Websites
#+BEGIN_SRC conf
ext x?html?, has qutebrowser, X, flag f = qutebrowser -- "$@"
ext x?html?, has firefox, X, flag f = firefox -- "$@"
ext x?html?, has elinks, terminal = elinks "$@"
ext x?html?, has w3m, terminal = w3m "$@"
#+END_SRC
** Text Files
3D files (before the rest)
#+begin_src conf
ext stp, X, flag f = f3d -- "$@"
ext step, X, flag f = f3d -- "$@"
ext stl, X, flag f = f3d -- "$@"
#+end_src
Calendar files
#+begin_src conf
ext ics, X, flag f = ics-add "$@"
#+end_src
Define the =$EDITOR= for text files as first action:
#+BEGIN_SRC conf
mime ^text, label editor = $EDITOR -- "$@"
@@ -638,6 +695,11 @@ ext djvu, has evince, X, flag f = evince -- "$@"
ext djvu, has atril, X, flag f = atril -- "$@"
#+END_SRC
** Xournalpp
#+begin_src conf
ext xopp, X, flag f = xournalpp "$@"
#+end_src
** Archives
#+BEGIN_SRC conf
ext 7z|ace|ar|arc|bz2?|cab|cpio|cpt|deb|dgc|dmg|gz, has atool = atool -- "$@" | "$PAGER"
@@ -650,12 +712,9 @@ ext tar|gz, has tar = tar vvtf "$@" | "$PAGER"
ext tar|gz, has tar = tar vvxf "$@"
#+END_SRC
** Websites
** Torrent
#+BEGIN_SRC conf
ext x?html?, has qutebrowser, X, flag f = qutebrowser -- "$@"
ext x?html?, has firefox, X, flag f = firefox -- "$@"
ext x?html?, has elinks, terminal = elinks "$@"
ext x?html?, has w3m, terminal = w3m "$@"
ext torrent, X, flag f = stig add -- "$@"
#+END_SRC
** Word, Excel and Presentation files
@@ -722,7 +781,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, X, flag f = dragon -a -x "$@"
has dragon-drop, X, flag f = dragon-drop -a -x "$@"
#+END_SRC
* Ranger Commands