From 5763ad0234947adac0adeb1d6e46ac56dcd66ebd Mon Sep 17 00:00:00 2001 From: LordMZTE Date: Sat, 8 Jan 2022 16:37:20 +0100 Subject: [PATCH] update joshuto config --- .config/joshuto/joshuto.toml | 8 ++++---- .config/joshuto/preview.sh | 12 ++++++++++++ 2 files changed, 16 insertions(+), 4 deletions(-) create mode 100755 .config/joshuto/preview.sh diff --git a/.config/joshuto/joshuto.toml b/.config/joshuto/joshuto.toml index 380ed3b..4eccf1f 100644 --- a/.config/joshuto/joshuto.toml +++ b/.config/joshuto/joshuto.toml @@ -23,10 +23,10 @@ directories_first = true reverse = false # Not fully implemented yet -#[preview] -#max_preview_size = 2097152 # 2MB -#preview_images = true -#preview_script = "~/.config/joshuto/preview.sh" +[preview] +max_preview_size = 2097152 # 2MB +preview_images = true +preview_script = "~/.config/joshuto/preview.sh" [tab] # inherit, home, root diff --git a/.config/joshuto/preview.sh b/.config/joshuto/preview.sh new file mode 100755 index 0000000..25d8d8d --- /dev/null +++ b/.config/joshuto/preview.sh @@ -0,0 +1,12 @@ +#!/bin/sh + +set -e +# viuer doesn't like xterm-kitty +export TERM=xterm-256color + +mime=$(file -b --mime-type "$1") + +case $mime in +image/*) viu $1 ;; +*) bat $1 --color=always ;; +esac