summaryrefslogtreecommitdiffstats
path: root/config
diff options
context:
space:
mode:
authorRuixi-rebirth <ruixirebirth@gmail.com>2023-05-27 20:49:55 -0600
committerGitHub <noreply@github.com>2023-05-27 22:49:55 -0400
commit20d51cf17a5e93cc20373423efeca72fd7c100d5 (patch)
treedca1d1be6cc5a31192c8a8acccef974649e1acce /config
parent493af3185092036cbbae81ae620b101f66cf4e9a (diff)
Add flake support (#297)
Add flake support
Diffstat (limited to 'config')
-rw-r--r--config/bookmarks.toml6
-rw-r--r--config/joshuto.toml2
-rw-r--r--config/keymap.toml304
-rw-r--r--config/mimetype.toml336
-rwxr-xr-xconfig/preview_file.sh124
-rw-r--r--config/theme.toml64
6 files changed, 434 insertions, 402 deletions
diff --git a/config/bookmarks.toml b/config/bookmarks.toml
index 662f39e..a0764e2 100644
--- a/config/bookmarks.toml
+++ b/config/bookmarks.toml
@@ -1,6 +1,6 @@
bookmark = [
- { key = "r", path = "/" },
- { key = "e", path = "/etc" },
+ { key = "r", path = "/" },
+ { key = "e", path = "/etc" },
- { key = "h", path = "~/" },
+ { key = "h", path = "~/" },
]
diff --git a/config/joshuto.toml b/config/joshuto.toml
index 7fa9006..d1f2439 100644
--- a/config/joshuto.toml
+++ b/config/joshuto.toml
@@ -30,7 +30,7 @@ directories_first = true
reverse = false
[preview]
-max_preview_size = 2097152 # 2MB
+max_preview_size = 2097152 # 2MB
preview_script = "~/.config/joshuto/preview_file.sh"
[tab]
diff --git a/config/keymap.toml b/config/keymap.toml
index 7076cf9..2d522c2 100644
--- a/config/keymap.toml
+++ b/config/keymap.toml
@@ -1,166 +1,166 @@
[default_view]
keymap = [
- { keys = [ "escape" ], command = "escape" },
- { keys = [ "ctrl+t" ], command = "new_tab" },
- { keys = [ "alt+t" ], command = "new_tab --cursor" },
- { keys = [ "T" ], command = "new_tab --current" },
- { keys = [ "W" ], command = "close_tab" },
- { keys = [ "ctrl+w" ], command = "close_tab" },
- { keys = [ "q" ], command = "close_tab" },
- { keys = [ "ctrl+c" ], command = "quit" },
- { keys = [ "Q" ], command = "quit --output-current-directory" },
-
- { keys = [ "R" ], command = "reload_dirlist" },
- { keys = [ "z", "h" ], command = "toggle_hidden" },
- { keys = [ "ctrl+h" ], command = "toggle_hidden" },
- { keys = [ "\t" ], command = "tab_switch 1" },
- { keys = [ "backtab" ], command = "tab_switch -1" },
-
- { keys = [ "alt+1" ], command = "tab_switch_index 1" },
- { keys = [ "alt+2" ], command = "tab_switch_index 2" },
- { keys = [ "alt+3" ], command = "tab_switch_index 3" },
- { keys = [ "alt+4" ], command = "tab_switch_index 4" },
- { keys = [ "alt+5" ], command = "tab_switch_index 5" },
-
- { keys = [ "1" ], command = "numbered_command 1" },
- { keys = [ "2" ], command = "numbered_command 2" },
- { keys = [ "3" ], command = "numbered_command 3" },
- { keys = [ "4" ], command = "numbered_command 4" },
- { keys = [ "5" ], command = "numbered_command 5" },
- { keys = [ "6" ], command = "numbered_command 6" },
- { keys = [ "7" ], command = "numbered_command 7" },
- { keys = [ "8" ], command = "numbered_command 8" },
- { keys = [ "9" ], command = "numbered_command 9" },
-
- # arrow keys
- { keys = [ "arrow_up" ], command = "cursor_move_up" },
- { keys = [ "arrow_down" ], command = "cursor_move_down" },
- { keys = [ "arrow_left" ], command = "cd .." },
- { keys = [ "arrow_right" ], command = "open" },
- { keys = [ "\n" ], command = "open" },
- { keys = [ "home" ], command = "cursor_move_home" },
- { keys = [ "end" ], command = "cursor_move_end" },
- { keys = [ "page_up" ], command = "cursor_move_page_up" },
- { keys = [ "page_down" ], command = "cursor_move_page_down" },
- { keys = [ "ctrl+u" ], command = "cursor_move_page_up 0.5" },
- { keys = [ "ctrl+d" ], command = "cursor_move_page_down 0.5" },
-
- # vim-like keybindings
- { keys = [ "j" ], command = "cursor_move_down" },
- { keys = [ "k" ], command = "cursor_move_up" },
- { keys = [ "h" ], command = "cd .." },
- { keys = [ "l" ], command = "open" },
- { keys = [ "g", "g" ], command = "cursor_move_home" },
- { keys = [ "G" ], command = "cursor_move_end" },
- { keys = [ "r" ], command = "open_with" },
-
- { keys = [ "H" ], command = "cursor_move_page_home" },
- { keys = [ "L" ], command = "cursor_move_page_middle" },
- { keys = [ "M" ], command = "cursor_move_page_end" },
-
- { keys = [ "[" ], command = "parent_cursor_move_up" },
- { keys = [ "]" ], command = "parent_cursor_move_down" },
-
- { keys = [ "c", "d" ], command = ":cd " },
- { keys = [ "d", "d" ], command = "cut_files" },
- { keys = [ "y", "y" ], command = "copy_files" },
- { keys = [ "y", "n" ], command = "copy_filename" },
- { keys = [ "y", "." ], command = "copy_filename_without_extension" },
- { keys = [ "y", "p" ], command = "copy_filepath" },
- { keys = [ "y", "d" ], command = "copy_dirpath" },
-
- { keys = [ "p", "l" ], command = "symlink_files --relative=false" },
- { keys = [ "p", "L" ], command = "symlink_files --relative=true" },
-
- { keys = [ "delete" ], command = "delete_files" },
- { keys = [ "d", "D" ], command = "delete_files" },
-
- { keys = [ "p", "p" ], command = "paste_files" },
- { keys = [ "p", "o" ], command = "paste_files --overwrite=true" },
-
- { keys = [ "a" ], command = "rename_append" },
- { keys = [ "A" ], command = "rename_prepend" },
-
- { keys = [ "f", "t" ], command = ":touch " },
-
- { keys = [ " " ], command = "select --toggle=true" },
- { keys = [ "t" ], command = "select --all=true --toggle=true" },
- { keys = [ "V" ], command = "toggle_visual"},
-
- { keys = [ "w" ], command = "show_tasks --exit-key=w" },
- { keys = [ "b", "b" ], command = "bulk_rename" },
- { keys = [ "=" ], command = "set_mode" },
-
- { keys = [ ":" ], command = ":" },
- { keys = [ ";" ], command = ":" },
-
- { keys = [ "'" ], command = ":shell " },
- { keys = [ "m", "k" ], command = ":mkdir " },
- { keys = [ "c", "w" ], command = ":rename " },
-
- { keys = [ "/" ], command = ":search " },
- { keys = [ "|" ], command = ":search_inc " },
- { keys = [ "\\" ], command = ":search_glob " },
- { keys = [ "S" ], command = "search_fzf" },
- { keys = [ "C" ], command = "subdir_fzf" },
-
- { keys = [ "n" ], command = "search_next" },
- { keys = [ "N" ], command = "search_prev" },
-
- { keys = [ "s", "r" ], command = "sort reverse" },
- { keys = [ "s", "l" ], command = "sort lexical" },
- { keys = [ "s", "m" ], command = "sort mtime" },
- { keys = [ "s", "n" ], command = "sort natural" },
- { keys = [ "s", "s" ], command = "sort size" },
- { keys = [ "s", "e" ], command = "sort ext" },
-
- { keys = [ "m", "s" ], command = "linemode size" },
- { keys = [ "m", "m" ], command = "linemode mtime" },
- { keys = [ "m", "M" ], command = "linemode sizemtime" },
-
- { keys = [ "g", "r" ], command = "cd /" },
- { keys = [ "g", "c" ], command = "cd ~/.config" },
- { keys = [ "g", "d" ], command = "cd ~/Downloads" },
- { keys = [ "g", "e" ], command = "cd /etc" },
- { keys = [ "g", "h" ], command = "cd ~/" },
- { keys = [ "?" ], command = "help" }
+ { keys = ["escape"], command = "escape" },
+ { keys = ["ctrl+t"], command = "new_tab" },
+ { keys = ["alt+t"], command = "new_tab --cursor" },
+ { keys = ["T"], command = "new_tab --current" },
+ { keys = ["W"], command = "close_tab" },
+ { keys = ["ctrl+w"], command = "close_tab" },
+ { keys = ["q"], command = "close_tab" },
+ { keys = ["ctrl+c"], command = "quit" },
+ { keys = ["Q"], command = "quit --output-current-directory" },
+
+ { keys = ["R"], command = "reload_dirlist" },
+ { keys = ["z", "h"], command = "toggle_hidden" },
+ { keys = ["ctrl+h"], command = "toggle_hidden" },
+ { keys = ["\t"], command = "tab_switch 1" },
+ { keys = ["backtab"], command = "tab_switch -1" },
+
+ { keys = ["alt+1"], command = "tab_switch_index 1" },
+ { keys = ["alt+2"], command = "tab_switch_index 2" },
+ { keys = ["alt+3"], command = "tab_switch_index 3" },
+ { keys = ["alt+4"], command = "tab_switch_index 4" },
+ { keys = ["alt+5"], command = "tab_switch_index 5" },
+
+ { keys = ["1"], command = "numbered_command 1" },
+ { keys = ["2"], command = "numbered_command 2" },
+ { keys = ["3"], command = "numbered_command 3" },
+ { keys = ["4"], command = "numbered_command 4" },
+ { keys = ["5"], command = "numbered_command 5" },
+ { keys = ["6"], command = "numbered_command 6" },
+ { keys = ["7"], command = "numbered_command 7" },
+ { keys = ["8"], command = "numbered_command 8" },
+ { keys = ["9"], command = "numbered_command 9" },
+
+ # arrow keys
+ { keys = ["arrow_up"], command = "cursor_move_up" },
+ { keys = ["arrow_down"], command = "cursor_move_down" },
+ { keys = ["arrow_left"], command = "cd .." },
+ { keys = ["arrow_right"], command = "open" },
+ { keys = ["\n"], command = "open" },
+ { keys = ["home"], command = "cursor_move_home" },
+ { keys = ["end"], command = "cursor_move_end" },
+ { keys = ["page_up"], command = "cursor_move_page_up" },
+ { keys = ["page_down"], command = "cursor_move_page_down" },
+ { keys = ["ctrl+u"], command = "cursor_move_page_up 0.5" },
+ { keys = ["ctrl+d"], command = "cursor_move_page_down 0.5" },
+
+ # vim-like keybindings
+ { keys = ["j"], command = "cursor_move_down" },
+ { keys = ["k"], command = "cursor_move_up" },
+ { keys = ["h"], command = "cd .." },
+ { keys = ["l"], command = "open" },
+ { keys = ["g", "g"], command = "cursor_move_home" },
+ { keys = ["G"], command = "cursor_move_end" },
+ { keys = ["r"], command = "open_with" },
+
+ { keys = ["H"], command = "cursor_move_page_home" },
+ { keys = ["L"], command = "cursor_move_page_middle" },
+ { keys = ["M"], command = "cursor_move_page_end" },
+
+ { keys = ["["], command = "parent_cursor_move_up" },
+ { keys = ["]"], command = "parent_cursor_move_down" },
+
+ { keys = ["c", "d"], command = ":cd " },
+ { keys = ["d", "d"], command = "cut_files" },
+ { keys = ["y", "y"], command = "copy_files" },
+ { keys = ["y", "n"], command = "copy_filename" },
+ { keys = ["y", "."], command = "copy_filename_without_extension" },
+ { keys = ["y", "p"], command = "copy_filepath" },
+ { keys = ["y", "d"], command = "copy_dirpath" },
+
+ { keys = ["p", "l"], command = "symlink_files --relative=false" },
+ { keys = ["p", "L"], command = "symlink_files --relative=true" },
+
+ { keys = ["delete"], command = "delete_files" },
+ { keys = ["d", "D"], command = "delete_files" },
+
+ { keys = ["p", "p"], command = "paste_files" },
+ { keys = ["p", "o"], command = "paste_files --overwrite=true" },
+
+ { keys = ["a"], command = "rename_append" },
+ { keys = ["A"], command = "rename_prepend" },
+
+ { keys = ["f", "t"], command = ":touch " },
+
+ { keys = [" "], command = "select --toggle=true" },
+ { keys = ["t"], command = "select --all=true --toggle=true" },
+ { keys = ["V"], command = "toggle_visual" },
+
+ { keys = ["w"], command = "show_tasks --exit-key=w" },
+ { keys = ["b", "b"], command = "bulk_rename" },
+ { keys = ["="], command = "set_mode" },
+
+ { keys = [":"], command = ":" },
+ { keys = [";"], command = ":" },
+
+ { keys = ["'"], command = ":shell " },
+ { keys = ["m", "k"], command = ":mkdir " },
+ { keys = ["c", "w"], command = ":rename " },
+
+ { keys = ["/"], command = ":search " },
+ { keys = ["|"], command = ":search_inc " },
+ { keys = ["\\"], command = ":search_glob " },
+ { keys = ["S"], command = "search_fzf" },
+ { keys = ["C"], command = "subdir_fzf" },
+
+ { keys = ["n"], command = "search_next" },
+ { keys = ["N"], command = "search_prev" },
+
+ { keys = ["s", "r"], command = "sort reverse" },
+ { keys = ["s", "l"], command = "sort lexical" },
+ { keys = ["s", "m"], command = "sort mtime" },
+ { keys = ["s", "n"], command = "sort natural" },
+ { keys = ["s", "s"], command = "sort size" },
+ { keys = ["s", "e"], command = "sort ext" },
+
+ { keys = ["m", "s"], command = "linemode size" },
+ { keys = ["m", "m"], command = "linemode mtime" },
+ { keys = ["m", "M"], command = "linemode sizemtime" },
+
+ { keys = ["g", "r"], command = "cd /" },
+ { keys = ["g", "c"], command = "cd ~/.config" },
+ { keys = ["g", "d"], command = "cd ~/Downloads" },
+ { keys = ["g", "e"], command = "cd /etc" },
+ { keys = ["g", "h"], command = "cd ~/" },
+ { keys = ["?"], command = "help" },
]
[task_view]
keymap = [
- # arrow keys
- { keys = [ "arrow_up" ], command = "cursor_move_up" },
- { keys = [ "arrow_down" ], command = "cursor_move_down" },
- { keys = [ "home" ], command = "cursor_move_home" },
- { keys = [ "end" ], command = "cursor_move_end" },
-
- # vim-like keybindings
- { keys = [ "j" ], command = "cursor_move_down" },
- { keys = [ "k" ], command = "cursor_move_up" },
- { keys = [ "g", "g" ], command = "cursor_move_home" },
- { keys = [ "G" ], command = "cursor_move_end" },
-
- { keys = [ "w" ], command = "show_tasks" },
- { keys = [ "escape" ], command = "show_tasks" },
+ # arrow keys
+ { keys = ["arrow_up"], command = "cursor_move_up" },
+ { keys = ["arrow_down"], command = "cursor_move_down" },
+ { keys = ["home"], command = "cursor_move_home" },
+ { keys = ["end"], command = "cursor_move_end" },
+
+ # vim-like keybindings
+ { keys = ["j"], command = "cursor_move_down" },
+ { keys = ["k"], command = "cursor_move_up" },
+ { keys = ["g", "g"], command = "cursor_move_home" },
+ { keys = ["G"], command = "cursor_move_end" },
+
+ { keys = ["w"], command = "show_tasks" },
+ { keys = ["escape"], command = "show_tasks" },
]
[help_view]
keymap = [
- # arrow keys
- { keys = [ "arrow_up" ], command = "cursor_move_up" },
- { keys = [ "arrow_down" ], command = "cursor_move_down" },
- { keys = [ "home" ], command = "cursor_move_home" },
- { keys = [ "end" ], command = "cursor_move_end" },
-
- # vim-like keybindings
- { keys = [ "j" ], command = "cursor_move_down" },
- { keys = [ "k" ], command = "cursor_move_up" },
- { keys = [ "g", "g" ], command = "cursor_move_home" },
- { keys = [ "G" ], command = "cursor_move_end" },
-
- { keys = [ "w" ], command = "show_tasks" },
- { keys = [ "escape" ], command = "show_tasks" },
+ # arrow keys
+ { keys = ["arrow_up"], command = "cursor_move_up" },
+ { keys = ["arrow_down"], command = "cursor_move_down" },
+ { keys = ["home"], command = "cursor_move_home" },
+ { keys = ["end"], command = "cursor_move_end" },
+
+ # vim-like keybindings
+ { keys = ["j"], command = "cursor_move_down" },
+ { keys = ["k"], command = "cursor_move_up" },
+ { keys = ["g", "g"], command = "cursor_move_home" },
+ { keys = ["G"], command = "cursor_move_end" },
+
+ { keys = ["w"], command = "show_tasks" },
+ { keys = ["escape"], command = "show_tasks" },
]
diff --git a/config/mimetype.toml b/config/mimetype.toml
index 65751db..7005b2c 100644
--- a/config/mimetype.toml
+++ b/config/mimetype.toml
@@ -1,186 +1,218 @@
[class]
-audio_default = [
- { command = "mpv", args = [ "--" ] },
- { command = "mediainfo", confirm_exit = true },
+audio_default = [
+ { command = "mpv", args = [
+ "--",
+ ] },
+ { command = "mediainfo", confirm_exit = true },
]
-image_default = [
- { command = "qimgv", args = [ "--" ], fork = true, silent = true },
- { command = "krita", args = [ "--" ], fork = true, silent = true },
- { command = "exiftool", confirm_exit = true },
- { command = "swappy", args = [ "-f" ], fork = true },
+image_default = [
+ { command = "qimgv", args = [
+ "--",
+ ], fork = true, silent = true },
+ { command = "krita", args = [
+ "--",
+ ], fork = true, silent = true },
+ { command = "exiftool", confirm_exit = true },
+ { command = "swappy", args = [
+ "-f",
+ ], fork = true },
]
-video_default = [
- { command = "mpv", args = [ "--" ] , fork = true, silent = true },
- { command = "mediainfo", confirm_exit = true },
- { command = "mpv", args = [ "--mute", "on", "--" ], fork = true, silent = true },
+video_default = [
+ { command = "mpv", args = [
+ "--",
+ ], fork = true, silent = true },
+ { command = "mediainfo", confirm_exit = true },
+ { command = "mpv", args = [
+ "--mute",
+ "on",
+ "--",
+ ], fork = true, silent = true },
]
-text_default = [
- { command = "micro" },
- { command = "gedit", fork = true, silent = true },
- { command = "bat", args = [ "--paging=always" ] },
+text_default = [
+ { command = "micro" },
+ { command = "gedit", fork = true, silent = true },
+ { command = "bat", args = [
+ "--paging=always",
+ ] },
]
-reader_default = [
- { command = "evince", fork = true, silent = true },
-]
+reader_default = [{ command = "evince", fork = true, silent = true }]
-libreoffice_default = [
- { command = "libreoffice", fork = true, silent = true },
-]
+libreoffice_default = [{ command = "libreoffice", fork = true, silent = true }]
[extension]
## image formats
-avif.inherit = "image_default"
-bmp.inherit = "image_default"
-gif.inherit = "image_default"
-heic.inherit = "image_default"
-jpeg.inherit = "image_default"
-jpe.inherit = "image_default"
-jpg.inherit = "image_default"
-pgm.inherit = "image_default"
-png.inherit = "image_default"
-ppm.inherit = "image_default"
-webp.inherit = "image_default"
-
-svg.app_list = [
- { command = "inkview", fork = true, silent = true },
- { command = "inkscape", fork = true, silent = true } ]
-tiff.app_list = [
- { command = "qimgv", fork = true, silent = true },
- { command = "krita", fork = true, silent = true } ]
+avif.inherit = "image_default"
+bmp.inherit = "image_default"
+gif.inherit = "image_default"
+heic.inherit = "image_default"
+jpeg.inherit = "image_default"
+jpe.inherit = "image_default"
+jpg.inherit = "image_default"
+pgm.inherit = "image_default"
+png.inherit = "image_default"
+ppm.inherit = "image_default"
+webp.inherit = "image_default"
+
+svg.app_list = [
+ { command = "inkview", fork = true, silent = true },
+ { command = "inkscape", fork = true, silent = true },
+]
+tiff.app_list = [
+ { command = "qimgv", fork = true, silent = true },
+ { command = "krita", fork = true, silent = true },
+]
## audio formats
-flac.inherit = "audio_default"
-m4a.inherit = "audio_default"
-mp3.inherit = "audio_default"
-ogg.inherit = "audio_default"
-wav.inherit = "audio_default"
+flac.inherit = "audio_default"
+m4a.inherit = "audio_default"
+mp3.inherit = "audio_default"
+ogg.inherit = "audio_default"
+wav.inherit = "audio_default"
## video formats
-avi.inherit = "video_default"
-av1.inherit = "video_default"
-flv.inherit = "video_default"
-mkv.inherit = "video_default"
-m4v.inherit = "video_default"
-mov.inherit = "video_default"
-mp4.inherit = "video_default"
-ts.inherit = "video_default"
-webm.inherit = "video_default"
-wmv.inherit = "video_default"
+avi.inherit = "video_default"
+av1.inherit = "video_default"
+flv.inherit = "video_default"
+mkv.inherit = "video_default"
+m4v.inherit = "video_default"
+mov.inherit = "video_default"
+mp4.inherit = "video_default"
+ts.inherit = "video_default"
+webm.inherit = "video_default"
+wmv.inherit = "video_default"
## text formats
-build.inherit = "text_default"
-c.inherit = "text_default"
-cmake.inherit = "text_default"
-conf.inherit = "text_default"
-cpp.inherit = "text_default"
-css.inherit = "text_default"
-csv.inherit = "text_default"
-cu.inherit = "text_default"
-ebuild.inherit = "text_default"
-eex.inherit = "text_default"
-env.inherit = "text_default"
-ex.inherit = "text_default"
-exs.inherit = "text_default"
-go.inherit = "text_default"
-h.inherit = "text_default"
-hpp.inherit = "text_default"
-hs.inherit = "text_default"
-html.inherit = "text_default"
-ini.inherit = "text_default"
-java.inherit = "text_default"
-js.inherit = "text_default"
-json.inherit = "text_default"
-kt.inherit = "text_default"
-lua.inherit = "text_default"
-log.inherit = "text_default"
-md.inherit = "text_default"
-micro.inherit = "text_default"
-ninja.inherit = "text_default"
-py.inherit = "text_default"
-rkt.inherit = "text_default"
-rs.inherit = "text_default"
-scss.inherit = "text_default"
-sh.inherit = "text_default"
-srt.inherit = "text_default"
-svelte.inherit = "text_default"
-toml.inherit = "text_default"
-tsx.inherit = "text_default"
-txt.inherit = "text_default"
-vim.inherit = "text_default"
-xml.inherit = "text_default"
-yaml.inherit = "text_default"
-yml.inherit = "text_default"
+build.inherit = "text_default"
+c.inherit = "text_default"
+cmake.inherit = "text_default"
+conf.inherit = "text_default"
+cpp.inherit = "text_default"
+css.inherit = "text_default"
+csv.inherit = "text_default"
+cu.inherit = "text_default"
+ebuild.inherit = "text_default"
+eex.inherit = "text_default"
+env.inherit = "text_default"
+ex.inherit = "text_default"
+exs.inherit = "text_default"
+go.inherit = "text_default"
+h.inherit = "text_default"
+hpp.inherit = "text_default"
+hs.inherit = "text_default"
+html.inherit = "text_default"
+ini.inherit = "text_default"
+java.inherit = "text_default"
+js.inherit = "text_default"
+json.inherit = "text_default"
+kt.inherit = "text_default"
+lua.inherit = "text_default"
+log.inherit = "text_default"
+md.inherit = "text_default"
+micro.inherit = "text_default"
+ninja.inherit = "text_default"
+py.inherit = "text_default"
+rkt.inherit = "text_default"
+rs.inherit = "text_default"
+scss.inherit = "text_default"
+sh.inherit = "text_default"
+srt.inherit = "text_default"
+svelte.inherit = "text_default"
+toml.inherit = "text_default"
+tsx.inherit = "text_default"
+txt.inherit = "text_default"
+vim.inherit = "text_default"
+xml.inherit = "text_default"
+yaml.inherit = "text_default"
+yml.inherit = "text_default"
# archive formats
-7z.app_list = [
- { command = "7z", args = [ "x" ], confirm_exit = true },
- { command = "file-roller", fork = true, silent = true } ]
-bz2.app_list = [
- { command = "tar", args = [ "-xvjf" ], confirm_exit = true },
- { command = "file-roller", fork = true, silent = true } ]
-gz.app_list = [
- { command = "tar", args = [ "-xvzf" ], confirm_exit = true },
- { command = "file-roller", fork = true, silent = true } ]
-tar.app_list = [
- { command = "tar", args = [ "-xvf" ], confirm_exit = true },
- { command = "file-roller", fork = true, silent = true } ]
-tgz.app_list = [
- { command = "tar", args = [ "-xvzf" ], confirm_exit = true },
- { command = "file-roller", fork = true, silent = true } ]
-rar.app_list = [
- { command = "unrar", args = [ "x" ], confirm_exit = true },
- { command = "file-roller", fork = true, silent = true } ]
-xz.app_list = [
- { command = "tar", args = [ "-xvJf" ], confirm_exit = true },
- { command = "file-roller", fork = true, silent = true } ]
-zip.app_list = [
- { command = "unzip", confirm_exit = true },
- { command = "file-roller", fork = true, silent = true } ]
+7z.app_list = [
+ { command = "7z", args = [
+ "x",
+ ], confirm_exit = true },
+ { command = "file-roller", fork = true, silent = true },
+]
+bz2.app_list = [
+ { command = "tar", args = [
+ "-xvjf",
+ ], confirm_exit = true },
+ { command = "file-roller", fork = true, silent = true },
+]
+gz.app_list = [
+ { command = "tar", args = [
+ "-xvzf",
+ ], confirm_exit = true },
+ { command = "file-roller", fork = true, silent = true },
+]
+tar.app_list = [
+ { command = "tar", args = [
+ "-xvf",
+ ], confirm_exit = true },
+ { command = "file-roller", fork = true, silent = true },
+]
+tgz.app_list = [
+ { command = "tar", args = [
+ "-xvzf",
+ ], confirm_exit = true },
+ { command = "file-roller", fork = true, silent = true },
+]
+rar.app_list = [
+ { command = "unrar", args = [
+ "x",
+ ], confirm_exit = true },
+ { command = "file-roller", fork = true, silent = true },
+]
+xz.app_list = [
+ { command = "tar", args = [
+ "-xvJf",
+ ], confirm_exit = true },
+ { command = "file-roller", fork = true, silent = true },
+]
+zip.app_list = [
+ { command = "unzip", confirm_exit = true },
+ { command = "file-roller", fork = true, silent = true },
+]
# misc formats
-aup.app_list = [
- { command = "audacity", fork = true, silent = true } ]
+aup.app_list = [{ command = "audacity", fork = true, silent = true }]
-m3u.app_list = [
- { command = "micro" },
- { command = "mpv" },
- { command = "gedit", fork = true, silent = true },
- { command = "bat", confirm_exit = true } ]
+m3u.app_list = [
+ { command = "micro" },
+ { command = "mpv" },
+ { command = "gedit", fork = true, silent = true },
+ { command = "bat", confirm_exit = true },
+]
-odt.inherit = "libreoffice_default"
-odf.inherit = "libreoffice_default"
-ods.inherit = "libreoffice_default"
-odp.inherit = "libreoffice_default"
+odt.inherit = "libreoffice_default"
+odf.inherit = "libreoffice_default"
+ods.inherit = "libreoffice_default"
+odp.inherit = "libreoffice_default"
-doc.inherit = "libreoffice_default"
-docx.inherit = "libreoffice_default"
-xls.inherit = "libreoffice_default"
-xlsx.inherit = "libreoffice_default"
-ppt.inherit = "libreoffice_default"
-pptx.inherit = "libreoffice_default"
+doc.inherit = "libreoffice_default"
+docx.inherit = "libreoffice_default"
+xls.inherit = "libreoffice_default"
+xlsx.inherit = "libreoffice_default"
+ppt.inherit = "libreoffice_default"
+pptx.inherit = "libreoffice_default"
-pdf.inherit = "reader_default"
+pdf.inherit = "reader_default"
-kra.app_list = [
- { command = "krita", fork = true, silent = true }
-]
-kdenlive.app_list = [
- { command = "kdenlive", fork = true, silent = true }
-]
+kra.app_list = [{ command = "krita", fork = true, silent = true }]
+kdenlive.app_list = [{ command = "kdenlive", fork = true, silent = true }]
-tex.app_list = [
- { command = "micro" },
- { command = "gedit", fork = true, silent = true },
- { command = "bat", confirm_exit = true },
- { command = "pdflatex" } ]
+tex.app_list = [
+ { command = "micro" },
+ { command = "gedit", fork = true, silent = true },
+ { command = "bat", confirm_exit = true },
+ { command = "pdflatex" },
+]
-torrent.app_list = [
- { command = "transmission-gtk" } ]
+torrent.app_list = [{ command = "transmission-gtk" }]
[mimetype]
diff --git a/config/preview_file.sh b/config/preview_file.sh
index 368ea3b..a6940c6 100755
--- a/config/preview_file.sh
+++ b/config/preview_file.sh
@@ -8,7 +8,7 @@
## preview_script = "~/.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
+## 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`
@@ -42,41 +42,41 @@ 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
+ 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)
+ ## 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;;
+ exit 1 ;;
rar)
## Avoid password prompt by providing empty password
unrar lt -p- -- "${FILE_PATH}" && exit 0
- exit 1;;
+ exit 1 ;;
7z)
## Avoid password prompt by providing empty password
7z l -p -- "${FILE_PATH}" && exit 0
- exit 1;;
+ exit 1 ;;
- ## PDF
+ ## PDF
pdf)
## Preview as text conversion
pdftotext -l 10 -nopgbrk -q -- "${FILE_PATH}" - | \
@@ -84,29 +84,29 @@ handle_extension() {
mutool draw -F txt -i -- "${FILE_PATH}" 1-10 | \
fmt -w "${PREVIEW_WIDTH}" && exit 0
exiftool "${FILE_PATH}" && exit 0
- exit 1;;
+ exit 1 ;;
- ## BitTorrent
+ ## BitTorrent
torrent)
transmission-show -- "${FILE_PATH}" && exit 0
- exit 1;;
+ exit 1 ;;
- ## OpenDocument
+ ## OpenDocument
odt|ods|odp|sxw)
## Preview as text conversion
odt2txt "${FILE_PATH}" && exit 0
## Preview as markdown conversion
pandoc -s -t markdown -- "${FILE_PATH}" && exit 0
- exit 1;;
+ exit 1 ;;
- ## XLSX
+ ## XLSX
xlsx)
## Preview as csv conversion
## Uses: https://github.com/dilshod/xlsx2csv
xlsx2csv -- "${FILE_PATH}" && exit 0
- exit 1;;
+ exit 1 ;;
- ## HTML
+ ## HTML
htm|html|xhtml)
## Preview as text conversion
w3m -dump "${FILE_PATH}" && exit 0
@@ -115,14 +115,14 @@ handle_extension() {
pandoc -s -t markdown -- "${FILE_PATH}" && exit 0
;;
- ## JSON
+ ## 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).
+ ## 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
@@ -131,69 +131,69 @@ handle_extension() {
}
handle_mime() {
- local mimetype="${1}"
+ local mimetype="${1}"
- case "${mimetype}" in
- ## RTF and DOC
+ 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;;
+ 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
+ ## 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;;
+ --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;;
+ ## E-mails
+ message/rfc822)
+ ## Parsing performed by mu: https://github.com/djcb/mu
+ mu view -- "${FILE_PATH}" && exit 0
+ exit 1 ;;
- ## XLS
+ ## 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;;
+ exit 1 ;;
- ## Text
+ ## Text
text/* | */xml)
bat --color=always --paging=never \
- --style=plain \
- --terminal-width="${PREVIEW_WIDTH}" \
- "${FILE_PATH}" && exit 0
+ --style=plain \
+ --terminal-width="${PREVIEW_WIDTH}" \
+ "${FILE_PATH}" && exit 0
cat "${FILE_PATH}" && exit 0
- exit 1;;
+ exit 1 ;;
- ## DjVu
+ ## 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;;
+ exit 1 ;;
- ## Image
+ ## Image
image/*)
## Preview as text conversion
exiftool "${FILE_PATH}" && exit 0
- exit 1;;
+ exit 1 ;;
- ## Video and audio
+ ## Video and audio
video/* | audio/*)
mediainfo "${FILE_PATH}" && exit 0
exiftool "${FILE_PATH}" && exit 0
- exit 1;;
+ exit 1 ;;
esac
}
diff --git a/config/theme.toml b/config/theme.toml
index 341c543..840d2b0 100644
--- a/config/theme.toml
+++ b/config/theme.toml
@@ -35,39 +35,39 @@ bold = true
[ext]
-bmp.fg = "yellow"
-gif.fg = "yellow"
-heic.fg = "yellow"
-jpg.fg = "yellow"
-jpeg.fg = "yellow"
-pgm.fg = "yellow"
-png.fg = "yellow"
-ppm.fg = "yellow"
-svg.fg = "yellow"
+bmp.fg = "yellow"
+gif.fg = "yellow"
+heic.fg = "yellow"
+jpg.fg = "yellow"
+jpeg.fg = "yellow"
+pgm.fg = "yellow"
+png.fg = "yellow"
+ppm.fg = "yellow"
+svg.fg = "yellow"
-wav.fg = "magenta"
+wav.fg = "magenta"
flac.fg = "magenta"
-mp3.fg = "magenta"
-amr.fg = "magenta"
+mp3.fg = "magenta"
+amr.fg = "magenta"
-avi.fg = "magenta"
-flv.fg = "magenta"
-m3u.fg = "magenta"
-m4a.fg = "magenta"
-m4v.fg = "magenta"
-mkv.fg = "magenta"
-mov.fg = "magenta"
-mp4.fg = "magenta"
-mpg.fg = "magenta"
-rmvb.fg = "magenta"
-webm.fg = "magenta"
-wmv.fg = "magenta"
+avi.fg = "magenta"
+flv.fg = "magenta"
+m3u.fg = "magenta"
<