mirror of
https://github.com/m1ngsama/dotfiles.git
synced 2026-03-26 03:53:54 +00:00
Merge 7d4fd93387 into 0a344a6ab6
This commit is contained in:
commit
7307707b8d
4 changed files with 56 additions and 17 deletions
|
|
@ -2,9 +2,9 @@
|
||||||
|
|
||||||
“工欲善其事,必先利其器。”
|
“工欲善其事,必先利其器。”
|
||||||
|
|
||||||
> Dotfile of the tools what I use.
|
> Dotfiles for the tools I use.
|
||||||
|
|
||||||
## Including
|
## Includes
|
||||||
|
|
||||||
- [fish](https://github.com/fish-shell/fish-shell)
|
- [fish](https://github.com/fish-shell/fish-shell)
|
||||||
|
|
||||||
|
|
@ -12,5 +12,6 @@
|
||||||
|
|
||||||
- [tmux](https://github.com/tmux/tmux)
|
- [tmux](https://github.com/tmux/tmux)
|
||||||
|
|
||||||
- Customed Keymaps Files
|
- [ranger](https://github.com/ranger/ranger)
|
||||||
|
|
||||||
|
- Custom keymap files
|
||||||
|
|
|
||||||
23
ranger/README.md
Normal file
23
ranger/README.md
Normal file
|
|
@ -0,0 +1,23 @@
|
||||||
|
# ranger
|
||||||
|
|
||||||
|
This directory tracks the ranger setup I actually use instead of storing a
|
||||||
|
full copy of the packaged defaults.
|
||||||
|
|
||||||
|
## Files
|
||||||
|
|
||||||
|
- `rc.conf`: minimal overrides on top of ranger's built-in defaults
|
||||||
|
- `scope.sh`: richer previews for images, video, PDF, archives, and text
|
||||||
|
|
||||||
|
## Recommended packages on Arch Linux
|
||||||
|
|
||||||
|
```bash
|
||||||
|
sudo pacman -S --needed \
|
||||||
|
ranger ueberzugpp chafa ffmpegthumbnailer mediainfo highlight atool \
|
||||||
|
perl-image-exiftool w3m mpv trash-cli unrar poppler imagemagick bat jq file
|
||||||
|
```
|
||||||
|
|
||||||
|
## Notes
|
||||||
|
|
||||||
|
- `preview_images_method ueberzug` works well in X11 terminals such as Alacritty.
|
||||||
|
- `chafa` provides a readable fallback when graphical image previews are unavailable.
|
||||||
|
- `trash-cli` powers the `dt` and `dT` key bindings in `rc.conf`.
|
||||||
14
ranger/rc.conf
Normal file
14
ranger/rc.conf
Normal file
|
|
@ -0,0 +1,14 @@
|
||||||
|
# Minimal ranger overrides on top of the built-in defaults.
|
||||||
|
set use_preview_script true
|
||||||
|
set preview_script ~/.config/ranger/scope.sh
|
||||||
|
|
||||||
|
set vcs_aware true
|
||||||
|
set preview_images true
|
||||||
|
set preview_images_method ueberzug
|
||||||
|
set collapse_preview false
|
||||||
|
set wrap_plaintext_previews true
|
||||||
|
set draw_borders both
|
||||||
|
|
||||||
|
# Prefer trash over permanent deletion for routine cleanup.
|
||||||
|
map dt shell -w trash-put -- %s
|
||||||
|
map dT shell -w trash-restore
|
||||||
|
|
@ -162,20 +162,21 @@ handle_image() {
|
||||||
;;
|
;;
|
||||||
|
|
||||||
## Video
|
## Video
|
||||||
# video/*)
|
video/*)
|
||||||
# # Thumbnail
|
ffmpegthumbnailer -i "${FILE_PATH}" -o "${IMAGE_CACHE_PATH}" -s 0 && exit 6
|
||||||
# ffmpegthumbnailer -i "${FILE_PATH}" -o "${IMAGE_CACHE_PATH}" -s 0 && exit 6
|
exit 1
|
||||||
# exit 1;;
|
;;
|
||||||
|
|
||||||
## PDF
|
## PDF
|
||||||
# application/pdf)
|
application/pdf)
|
||||||
# pdftoppm -f 1 -l 1 \
|
pdftoppm -f 1 -l 1 \
|
||||||
# -scale-to-x "${DEFAULT_SIZE%x*}" \
|
-scale-to-x "${DEFAULT_SIZE%x*}" \
|
||||||
# -scale-to-y -1 \
|
-scale-to-y -1 \
|
||||||
# -singlefile \
|
-singlefile \
|
||||||
# -jpeg -tiffcompression jpeg \
|
-jpeg -tiffcompression jpeg \
|
||||||
# -- "${FILE_PATH}" "${IMAGE_CACHE_PATH%.*}" \
|
-- "${FILE_PATH}" "${IMAGE_CACHE_PATH%.*}" &&
|
||||||
# && exit 6 || exit 1;;
|
exit 6 || exit 1
|
||||||
|
;;
|
||||||
|
|
||||||
## ePub, MOBI, FB2 (using Calibre)
|
## ePub, MOBI, FB2 (using Calibre)
|
||||||
# application/epub+zip|application/x-mobipocket-ebook|\
|
# application/epub+zip|application/x-mobipocket-ebook|\
|
||||||
|
|
@ -331,8 +332,8 @@ handle_mime() {
|
||||||
|
|
||||||
## Image
|
## Image
|
||||||
image/*)
|
image/*)
|
||||||
## Preview as text conversion
|
chafa --animate=off --size="${PV_WIDTH}x${PV_HEIGHT}" \
|
||||||
# img2txt --gamma=0.6 --width="${PV_WIDTH}" -- "${FILE_PATH}" && exit 4
|
--symbols=block -- "${FILE_PATH}" && exit 4
|
||||||
exiftool "${FILE_PATH}" && exit 5
|
exiftool "${FILE_PATH}" && exit 5
|
||||||
exit 1
|
exit 1
|
||||||
;;
|
;;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue