From 9c26507b013e3267ea354d12bb5659d044276d44 Mon Sep 17 00:00:00 2001 From: Jane42070 Date: Sat, 25 Mar 2023 19:04:08 +0800 Subject: [PATCH 1/4] add msdocx xlsx like doc preview support --- .config/lf/scope | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.config/lf/scope b/.config/lf/scope index 87b560a0..8d1906d2 100755 --- a/.config/lf/scope +++ b/.config/lf/scope @@ -45,6 +45,16 @@ case "$(file --dereference --brief --mime-type -- "$1")" in [ ! -f "$CACHE.jpg" ] && gnome-epub-thumbnailer "$1" "$CACHE.jpg" image "$CACHE.jpg" "$2" "$3" "$4" "$5" "$1" ;; + application/vnd.* | msword ) + CACHE="${XDG_CACHE_HOME:-$HOME/.cache}/lf/thumb.$(stat --printf '%n\0%i\0%F\0%s\0%W\0%Y' -- "$(readlink -f "$1")" | sha256sum | cut -d' ' -f1)" + [ ! -f "$CACHE.jpg" ] && libreoffice --convert-to jpg "$1" --outdir "$CACHE" >/dev/null + # 将绝对路径转换为文件名 + tmpfile=$(echo "$1"| rev | cut -f 1 -d"/" | rev | sed -r 's/.[^\.]*$//') + mv $CACHE/$tmpfile.jpg $CACHE.jpg && rmdir $CACHE + # 典中点之利用 output debug + # echo -e "\$CACHE=$CACHE\n\$1=$1\n\$tempfile=$tmpfile" > $HOME/log + image "$CACHE.jpg" "$2" "$3" "$4" "$5" "$1" + ;; application/*zip) atool --list -- "$1" ;; *opendocument*) odt2txt "$1" ;; application/pgp-encrypted) gpg -d -- "$1" ;; From 54f4b8718d9c92f0a2e56347b984c5f18026a68d Mon Sep 17 00:00:00 2001 From: Jane42070 Date: Sat, 25 Mar 2023 20:12:11 +0800 Subject: [PATCH 2/4] mounter mount ext* filesystem param does not support uid,gid fix --- .local/bin/mounter | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.local/bin/mounter b/.local/bin/mounter index b532e08f..128f1036 100755 --- a/.local/bin/mounter +++ b/.local/bin/mounter @@ -80,7 +80,8 @@ case "$chosen" in chosen="${chosen%% *}" chosen="${chosen:1}" # This is a bashism. attemptmount || getmount - sudo -A mount "$chosen" "$mp" -o uid="$(id -u)",gid="$(id -g)" + # ext4 does not support uid,gid + [ $(lsblk -npro "fstype" $chosen) == ext[2-4] ] && sudo -A mount "$chosen" "$mp" -o user="$USER",rw || sudo -A mount "$chosen" "$mp" -o uid="$(id -u)",gid="$(id -g)" notify-send "💾Drive Mounted." "$chosen mounted to $mp." ;; From a8447849eabab924ff368709e22f8f8acafa7780 Mon Sep 17 00:00:00 2001 From: Jane42070 Date: Thu, 30 Mar 2023 20:25:34 +0800 Subject: [PATCH 3/4] add *officedocument* application/msword preview support --- .config/lf/scope | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.config/lf/scope b/.config/lf/scope index 8d1906d2..e38feac9 100755 --- a/.config/lf/scope +++ b/.config/lf/scope @@ -45,14 +45,12 @@ case "$(file --dereference --brief --mime-type -- "$1")" in [ ! -f "$CACHE.jpg" ] && gnome-epub-thumbnailer "$1" "$CACHE.jpg" image "$CACHE.jpg" "$2" "$3" "$4" "$5" "$1" ;; - application/vnd.* | msword ) + *officedocument* | application/msword) CACHE="${XDG_CACHE_HOME:-$HOME/.cache}/lf/thumb.$(stat --printf '%n\0%i\0%F\0%s\0%W\0%Y' -- "$(readlink -f "$1")" | sha256sum | cut -d' ' -f1)" [ ! -f "$CACHE.jpg" ] && libreoffice --convert-to jpg "$1" --outdir "$CACHE" >/dev/null # 将绝对路径转换为文件名 tmpfile=$(echo "$1"| rev | cut -f 1 -d"/" | rev | sed -r 's/.[^\.]*$//') mv $CACHE/$tmpfile.jpg $CACHE.jpg && rmdir $CACHE - # 典中点之利用 output debug - # echo -e "\$CACHE=$CACHE\n\$1=$1\n\$tempfile=$tmpfile" > $HOME/log image "$CACHE.jpg" "$2" "$3" "$4" "$5" "$1" ;; application/*zip) atool --list -- "$1" ;; From a984022d372c72f15c2d4446f0be887f297932ab Mon Sep 17 00:00:00 2001 From: Jane42070 <1377219787@qq.com> Date: Mon, 14 Aug 2023 20:32:00 +0800 Subject: [PATCH 4/4] update --- .gtkrc-2.0 | 1 - .local/share/bg | 1 - .xprofile | 1 - .zprofile | 1 - 4 files changed, 4 deletions(-) delete mode 120000 .gtkrc-2.0 delete mode 120000 .local/share/bg delete mode 120000 .xprofile delete mode 120000 .zprofile diff --git a/.gtkrc-2.0 b/.gtkrc-2.0 deleted file mode 120000 index 20593d73..00000000 --- a/.gtkrc-2.0 +++ /dev/null @@ -1 +0,0 @@ -.config/gtk-2.0/gtkrc-2.0 \ No newline at end of file diff --git a/.local/share/bg b/.local/share/bg deleted file mode 120000 index b41641dc..00000000 --- a/.local/share/bg +++ /dev/null @@ -1 +0,0 @@ -thiemeyer_road_to_samarkand.jpg \ No newline at end of file diff --git a/.xprofile b/.xprofile deleted file mode 120000 index 61f87a7b..00000000 --- a/.xprofile +++ /dev/null @@ -1 +0,0 @@ -.config/x11/xprofile \ No newline at end of file diff --git a/.zprofile b/.zprofile deleted file mode 120000 index 8486fcaf..00000000 --- a/.zprofile +++ /dev/null @@ -1 +0,0 @@ -.config/shell/profile \ No newline at end of file