From 0382396b67bb7abbfb320aa3965b6e216cd160c6 Mon Sep 17 00:00:00 2001 From: Marco Date: Fri, 30 May 2025 15:47:57 +0200 Subject: [PATCH] remove joshuto --- joshuto/.config/joshuto/joshuto.toml | 60 ------- joshuto/.config/joshuto/keymap.toml | 179 ------------------- joshuto/.config/joshuto/preview_file.sh | 218 ------------------------ 3 files changed, 457 deletions(-) delete mode 100644 joshuto/.config/joshuto/joshuto.toml delete mode 100644 joshuto/.config/joshuto/keymap.toml delete mode 100755 joshuto/.config/joshuto/preview_file.sh diff --git a/joshuto/.config/joshuto/joshuto.toml b/joshuto/.config/joshuto/joshuto.toml deleted file mode 100644 index f1181d8..0000000 --- a/joshuto/.config/joshuto/joshuto.toml +++ /dev/null @@ -1,60 +0,0 @@ -numbered_command = false - -mouse_support = true -focus_on_create = true -use_trash = false -watch_files = true -xdg_open = true -xdg_open_fork = true -case_insensitive_ext = false -zoxide_update = false - -custom_commands = [] - -[display] -# default, hsplit -mode = "default" - -automatically_count_files = true -collapse_preview = true -# ratios for parent view (optional), current view and preview -column_ratio = [1, 3, 4] -scroll_offset = 6 -show_borders = false -show_hidden = false -show_icons = false -# none, absolute, relative -line_number_style = "none" - -# size, mtime, user, gourp, perm. can be combined with |. -# `none` to disable, `all` to enable all -# all and none can't be combined with other options -linemode = "size" - -[display.sort] -# lexical, mtime, natural, size, ext -sort_method = "natural" -case_sensitive = false -directories_first = true -reverse = false - -[preview] -max_preview_size = 10490000 -preview_script = "~/.config/joshuto/preview_file.sh" # make sure it's marked as executable -use_xdg_thumbs = true -xdg_thumb_size = "large" - -[search] -# insensitive, sensitive, smart -string_case_sensitivity = "insensitive" -# see above -glob_case_sensitivity = "sensitive" -# see above -regex_case_sensitivity = "sensitive" -# see above -fzf_case_sensitivity = "insensitive" - -[tab] -# inherit, home, root -home_page = "home" - diff --git a/joshuto/.config/joshuto/keymap.toml b/joshuto/.config/joshuto/keymap.toml deleted file mode 100644 index 943b33b..0000000 --- a/joshuto/.config/joshuto/keymap.toml +++ /dev/null @@ -1,179 +0,0 @@ -[default_view] - -keymap = [ - { keys = ["escape"], commands = ["escape"] }, - { keys = ["ctrl+t"], commands = ["new_tab"] }, - { keys = ["g", "n"], commands = ["new_tab"] }, - { keys = ["ctrl+T"], commands = ["new_tab --current"] }, - { keys = ["g", "N"], commands = ["new_tab --current"] }, - { keys = ["ctrl+w"], commands = ["close_tab"] }, - { keys = ["g", "c"], commands = ["close_tab"] }, - { keys = ["q"], commands = ["close_tab"] }, - { keys = ["ctrl+c"], commands = ["quit"] }, - { keys = ["Q"], commands = ["quit --output-current-directory"] }, - - { keys = ["R"], commands = ["reload_dirlist"] }, - { keys = ["z", "h"], commands = ["toggle_hidden"] }, - { keys = ["ctrl+h"], commands = ["toggle_hidden"] }, - { keys = ["\t"], commands = ["tab_switch 1"] }, - { keys = ["g", "t"], commands = ["tab_switch 1"] }, - { keys = ["backtab"], commands = ["tab_switch -1"] }, - { keys = ["g", "T"], commands = ["tab_switch -1"] }, - - { keys = ["alt+1"], commands = ["tab_switch_index 1"] }, - { keys = ["alt+2"], commands = ["tab_switch_index 2"] }, - { keys = ["alt+3"], commands = ["tab_switch_index 3"] }, - { keys = ["alt+4"], commands = ["tab_switch_index 4"] }, - { keys = ["alt+5"], commands = ["tab_switch_index 5"] }, - { keys = ["alt+6"], commands = ["tab_switch_index 6"] }, - { keys = ["alt+7"], commands = ["tab_switch_index 7"] }, - { keys = ["alt+8"], commands = ["tab_switch_index 8"] }, - { keys = ["alt+9"], commands = ["tab_switch_index 9"] }, - - { keys = ["1"], commands = ["numbered_command 1"] }, - { keys = ["2"], commands = ["numbered_command 2"] }, - { keys = ["3"], commands = ["numbered_command 3"] }, - { keys = ["4"], commands = ["numbered_command 4"] }, - { keys = ["5"], commands = ["numbered_command 5"] }, - { keys = ["6"], commands = ["numbered_command 6"] }, - { keys = ["7"], commands = ["numbered_command 7"] }, - { keys = ["8"], commands = ["numbered_command 8"] }, - { keys = ["9"], commands = ["numbered_command 9"] }, - - # arrow keys - { keys = ["arrow_up"], commands = ["cursor_move_up"] }, - { keys = ["arrow_down"], commands = ["cursor_move_down"] }, - { keys = ["arrow_left"], commands = ["cd .."] }, - { keys = ["arrow_right"], commands = ["open"] }, - { keys = ["\n"], commands = ["open"] }, - { keys = ["home"], commands = ["cursor_move_home"] }, - { keys = ["end"], commands = ["cursor_move_end"] }, - { keys = ["page_up"], commands = ["cursor_move_page_up"] }, - { keys = ["page_down"], commands = ["cursor_move_page_down"] }, - { keys = ["ctrl+u"], commands = ["cursor_move_page_up 0.5"] }, - { keys = ["ctrl+d"], commands = ["cursor_move_page_down 0.5"] }, - { keys = ["ctrl+b"], commands = ["cursor_move_page_up"] }, - { keys = ["ctrl+f"], commands = ["cursor_move_page_down"] }, - - # vim-like keybindings - { keys = ["j"], commands = ["cursor_move_down"] }, - { keys = ["k"], commands = ["cursor_move_up"] }, - { keys = ["h"], commands = ["cd .."] }, - { keys = ["l"], commands = ["open"] }, - { keys = ["g", "g"], commands = ["cursor_move_home"] }, - { keys = ["G"], commands = ["cursor_move_end"] }, - { keys = ["r"], commands = ["open_with"] }, - - { keys = ["H"], commands = ["cursor_move_page_home"] }, - { keys = ["L"], commands = ["cursor_move_page_middle"] }, - { keys = ["M"], commands = ["cursor_move_page_end"] }, - - { keys = ["["], commands = ["parent_cursor_move_up"] }, - { keys = ["]"], commands = ["parent_cursor_move_down"] }, - - { keys = ["c", "d"], commands = [":cd "] }, - { keys = ["d", "d"], commands = ["cut_files"] }, - { keys = ["y", "y"], commands = ["copy_files"] }, - { keys = ["y", "n"], commands = ["copy_filename"] }, - { keys = ["y", "."], commands = ["copy_filename_without_extension"] }, - { keys = ["y", "p"], commands = ["copy_filepath"] }, - { keys = ["y", "a"], commands = ["copy_filepath --all-selected=true"] }, - { keys = ["y", "d"], commands = ["copy_dirpath"] }, - - { keys = ["p", "l"], commands = ["symlink_files --relative=false"] }, - { keys = ["p", "L"], commands = ["symlink_files --relative=true"] }, - - { keys = ["delete"], commands = ["delete_files"] }, - { keys = ["d", "D"], commands = ["delete_files"] }, - - { keys = ["p", "p"], commands = ["paste_files"] }, - { keys = ["p", "o"], commands = ["paste_files --overwrite=true"] }, - - { keys = ["a"], commands = ["rename_append"] }, - { keys = ["A"], commands = ["rename_prepend"] }, - - { keys = ["f", "t"], commands = [":touch "] }, - - { keys = [" "], commands = ["select --toggle=true"] }, - { keys = ["t"], commands = ["select --all=true --toggle=true"] }, - { keys = ["V"], commands = ["toggle_visual"] }, - - { keys = ["w"], commands = ["show_tasks --exit-key=w"] }, - { keys = ["b", "b"], commands = ["bulk_rename"] }, - { keys = ["="], commands = ["set_mode"] }, - - { keys = [":"], commands = [":"] }, - { keys = [";"], commands = [":"] }, - - { keys = ["s"], commands = [":shell "] }, - { keys = ["S"], commands = ["shell sh -c \"$SHELL\""] }, - { keys = ["m", "k"], commands = [":mkdir "] }, - { keys = ["c", "w"], commands = [":rename "] }, - - { keys = ["/"], commands = [":search "] }, - { keys = ["|"], commands = [":search_inc "] }, - { keys = ["\\"], commands = [":search_glob "] }, - - { keys = ["n"], commands = ["search_next"] }, - { keys = ["N"], commands = ["search_prev"] }, - - { keys = ["o", "r"], commands = ["sort reverse"] }, - { keys = ["o", "l"], commands = ["sort lexical"] }, - { keys = ["o", "m"], commands = ["sort mtime"] }, - { keys = ["o", "n"], commands = ["sort natural"] }, - { keys = ["o", "s"], commands = ["sort size"] }, - { keys = ["o", "e"], commands = ["sort ext"] }, - - { keys = ["m", "s"], commands = ["linemode size"] }, - { keys = ["m", "m"], commands = ["linemode mtime"] }, - { keys = ["m", "M"], commands = ["linemode size | mtime"] }, - { keys = ["m", "u"], commands = ["linemode user"] }, - { keys = ["m", "U"], commands = ["linemode user | group"] }, - { keys = ["m", "p"], commands = ["linemode perm"] }, - - { keys = ["g", "r"], commands = ["cd /"] }, - { keys = ["g", "/"], commands = ["cd /"] }, - { keys = ["g", "e"], commands = ["cd /etc"] }, - { keys = ["g", "v"], commands = ["cd /var"] }, - { keys = ["g", "h"], commands = ["cd ~/"] }, - { keys = ["g", "d"], commands = ["cd ~/Downloads"] }, - { keys = ["?"], commands = ["help"] }, -] - -[task_view] - -keymap = [ - # arrow keys - { keys = ["arrow_up"], commands = ["cursor_move_up"] }, - { keys = ["arrow_down"], commands = ["cursor_move_down"] }, - { keys = ["home"], commands = ["cursor_move_home"] }, - { keys = ["end"], commands = ["cursor_move_end"] }, - - # vim-like keybindings - { keys = ["j"], commands = ["cursor_move_down"] }, - { keys = ["k"], commands = ["cursor_move_up"] }, - { keys = ["g", "g"], commands = ["cursor_move_home"] }, - { keys = ["G"], commands = ["cursor_move_end"] }, - - { keys = ["w"], commands = ["show_tasks"] }, - { keys = ["escape"], commands = ["show_tasks"] }, -] - -[help_view] - -keymap = [ - # arrow keys - { keys = ["arrow_up"], commands = ["cursor_move_up"] }, - { keys = ["arrow_down"], commands = ["cursor_move_down"] }, - { keys = ["home"], commands = ["cursor_move_home"] }, - { keys = ["end"], commands = ["cursor_move_end"] }, - - # vim-like keybindings - { keys = ["j"], commands = ["cursor_move_down"] }, - { keys = ["k"], commands = ["cursor_move_up"] }, - { keys = ["g", "g"], commands = ["cursor_move_home"] }, - { keys = ["G"], commands = ["cursor_move_end"] }, - - { keys = ["w"], commands = ["show_tasks"] }, - { keys = ["escape"], commands = ["show_tasks"] }, -] diff --git a/joshuto/.config/joshuto/preview_file.sh b/joshuto/.config/joshuto/preview_file.sh deleted file mode 100755 index ed06b75..0000000 --- a/joshuto/.config/joshuto/preview_file.sh +++ /dev/null @@ -1,218 +0,0 @@ -#!/usr/bin/env bash - -## This script is a template script for creating textual file previews in Joshuto. -## -## Copy this script to your Joshuto configuration directory and refer to this -## script in `joshuto.toml` in the `[preview]` section like -## ``` -## preview_script = "~/.config/joshuto/preview_file.sh" -## ``` -## Make sure the file is marked as executable: -## ```sh -## chmod +x ~/.config/joshuto/preview_file.sh -## ``` -## Joshuto will call this script for each file when first hovered by the cursor. -## If this script returns with an exit code 0, the stdout of this script will be -## the file's preview text in Joshuto's right panel. -## The preview text will be cached by Joshuto and only renewed on reload. -## ANSI color codes are supported if Joshuto is build with the `syntax_highlight` -## feature. -## -## This script is considered a configuration file and must be updated manually. -## It will be left untouched if you upgrade Joshuto. -## -## Meanings of exit codes: -## -## code | meaning | action of ranger -## -----+------------+------------------------------------------- -## 0 | success | Display stdout as preview -## 1 | no preview | Display no preview at all -## -## This script is used only as a provider for textual previews. -## Image previews are independent from this script. -## - -IFS=$'\n' - -# Security measures: -# * noclobber prevents you from overwriting a file with `>` -# * noglob prevents expansion of wild cards -# * nounset causes bash to fail if an undeclared variable is used (e.g. typos) -# * pipefail causes a pipeline to fail also if a command other than the last one fails -set -o noclobber -o noglob -o nounset -o pipefail - -# Enable exiftool large file support -shopt -s expand_aliases -alias exiftool='exiftool -api largefilesupport=1' - -FILE_PATH="" -PREVIEW_WIDTH=10 -PREVIEW_HEIGHT=10 - -while [ "$#" -gt 0 ]; do - case "$1" in - "--path") - shift - FILE_PATH="$1" - ;; - "--preview-width") - shift - PREVIEW_WIDTH="$1" - ;; - "--preview-height") - shift - PREVIEW_HEIGHT="$1" - ;; - esac - shift -done - -handle_extension() { - case "${FILE_EXTENSION_LOWER}" in - ## Archive - a|ace|alz|arc|arj|bz|bz2|cab|cpio|deb|gz|jar|lha|lz|lzh|lzma|lzo|\ - rpm|rz|t7z|tar|tbz|tbz2|tgz|tlz|txz|tZ|tzo|war|xpi|xz|Z|zip) - atool --list -- "${FILE_PATH}" && exit 0 - bsdtar --list --file "${FILE_PATH}" && exit 0 - exit 1 ;; - rar) - ## Avoid password prompt by providing empty password - unrar lt -p- -- "${FILE_PATH}" && exit 0 - exit 1 ;; - 7z) - ## Avoid password prompt by providing empty password - 7z l -p -- "${FILE_PATH}" && exit 0 - exit 1 ;; - - ## PDF - pdf) - ## Preview as text conversion - pdftotext -l 10 -nopgbrk -q -- "${FILE_PATH}" - | \ - fmt -w "${PREVIEW_WIDTH}" && exit 0 - mutool draw -F txt -i -- "${FILE_PATH}" 1-10 | \ - fmt -w "${PREVIEW_WIDTH}" && exit 0 - exiftool "${FILE_PATH}" && exit 0 - exit 1 ;; - - ## BitTorrent - torrent) - transmission-show -- "${FILE_PATH}" && exit 0 - exit 1 ;; - - ## OpenDocument - odt|sxw) - ## Preview as text conversion - odt2txt "${FILE_PATH}" && exit 0 - ## Preview as markdown conversion - pandoc -s -t markdown -- "${FILE_PATH}" && exit 0 - exit 1 ;; - ods|odp) - ## Preview as text conversion (unsupported by pandoc for markdown) - odt2txt "${FILE_PATH}" && exit 0 - exit 1 ;; - - ## XLSX - xlsx) - ## Preview as csv conversion - ## Uses: https://github.com/dilshod/xlsx2csv - xlsx2csv -- "${FILE_PATH}" && exit 0 - exit 1 ;; - - ## HTML - htm|html|xhtml) - ## Preview as text conversion - w3m -dump "${FILE_PATH}" && exit 0 - lynx -dump -- "${FILE_PATH}" && exit 0 - elinks -dump "${FILE_PATH}" && exit 0 - pandoc -s -t markdown -- "${FILE_PATH}" && exit 0 - ;; - - ## JSON - json|ipynb) - jq --color-output . "${FILE_PATH}" && exit 0 - python -m json.tool -- "${FILE_PATH}" && exit 0 - ;; - - ## Direct Stream Digital/Transfer (DSDIFF) and wavpack aren't detected - ## by file(1). - dff|dsf|wv|wvc) - mediainfo "${FILE_PATH}" && exit 0 - exiftool "${FILE_PATH}" && exit 0 - ;; # Continue with next handler on failure - esac -} - -handle_mime() { - local mimetype="${1}" - - case "${mimetype}" in - ## RTF and DOC - text/rtf|*msword) - ## Preview as text conversion - ## note: catdoc does not always work for .doc files - ## catdoc: http://www.wagner.pp.ru/~vitus/software/catdoc/ - catdoc -- "${FILE_PATH}" && exit 0 - exit 1 ;; - - ## DOCX, ePub, FB2 (using markdown) - ## You might want to remove "|epub" and/or "|fb2" below if you have - ## uncommented other methods to preview those formats - *wordprocessingml.document|*/epub+zip|*/x-fictionbook+xml) - ## Preview as markdown conversion - pandoc -s -t markdown -- "${FILE_PATH}" | bat -l markdown \ - --color=always --paging=never \ - --style=plain \ - --terminal-width="${PREVIEW_WIDTH}" && exit 0 - exit 1 ;; - - ## E-mails - message/rfc822) - ## Parsing performed by mu: https://github.com/djcb/mu - mu view -- "${FILE_PATH}" && exit 0 - exit 1 ;; - - ## XLS - *ms-excel) - ## Preview as csv conversion - ## xls2csv comes with catdoc: - ## http://www.wagner.pp.ru/~vitus/software/catdoc/ - xls2csv -- "${FILE_PATH}" && exit 0 - exit 1 ;; - - ## Text - text/* | */xml) - bat --color=always --paging=never \ - --style=plain \ - --terminal-width="${PREVIEW_WIDTH}" \ - "${FILE_PATH}" && exit 0 - cat "${FILE_PATH}" && exit 0 - exit 1 ;; - - ## DjVu - image/vnd.djvu) - ## Preview as text conversion (requires djvulibre) - djvutxt "${FILE_PATH}" | fmt -w "${PREVIEW_WIDTH}" && exit 0 - exiftool "${FILE_PATH}" && exit 0 - exit 1 ;; - - ## Image - image/*) - ## Preview as text conversion - exiftool "${FILE_PATH}" && exit 0 - exit 1 ;; - - ## Video and audio - video/* | audio/*) - mediainfo "${FILE_PATH}" && exit 0 - exiftool "${FILE_PATH}" && exit 0 - exit 1 ;; - esac -} - -FILE_EXTENSION="${FILE_PATH##*.}" -FILE_EXTENSION_LOWER="$(printf "%s" "${FILE_EXTENSION}" | tr '[:upper:]' '[:lower:]')" -handle_extension -MIMETYPE="$( file --dereference --brief --mime-type -- "${FILE_PATH}" )" -handle_mime "${MIMETYPE}" - -exit 1