mirror of
https://github.com/LukeSmithxyz/voidrice.git
synced 2026-03-20 01:37:45 +01:00
Compare commits
7 Commits
290d56d2e2
...
5adab9ea46
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5adab9ea46 | ||
|
|
d8a8970715 | ||
|
|
0497dcd51c | ||
|
|
6f6b749d0e | ||
|
|
a8447849ea | ||
|
|
54f4b8718d | ||
|
|
9c26507b01 |
@ -25,10 +25,14 @@ case "$(file --dereference --brief --mime-type -- "$1")" in
|
|||||||
image/avif) 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)"
|
image/avif) 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" ] && convert "$1" "$CACHE.jpg"
|
[ ! -f "$CACHE" ] && convert "$1" "$CACHE.jpg"
|
||||||
image "$CACHE.jpg" "$2" "$3" "$4" "$5" "$1" ;;
|
image "$CACHE.jpg" "$2" "$3" "$4" "$5" "$1" ;;
|
||||||
|
image/vnd.djvu)
|
||||||
|
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" ] && djvused "$1" -e 'select 1; save-page-with /dev/stdout' | convert -density 200 - "$CACHE.jpg" > /dev/null 2>&1
|
||||||
|
image "$CACHE.jpg" "$2" "$3" "$4" "$5" "$1" ;;
|
||||||
image/*) image "$1" "$2" "$3" "$4" "$5" "$1" ;;
|
image/*) image "$1" "$2" "$3" "$4" "$5" "$1" ;;
|
||||||
text/html) lynx -width="$4" -display_charset=utf-8 -dump "$1" ;;
|
text/html) lynx -width="$4" -display_charset=utf-8 -dump "$1" ;;
|
||||||
text/troff) man ./ "$1" | col -b ;;
|
text/troff) man ./ "$1" | col -b ;;
|
||||||
text/* | */xml | application/json) bat --terminal-width "$(($4-2))" -f "$1" ;;
|
text/* | */xml | application/json | application/x-ndjson) bat --terminal-width "$(($4-2))" -f "$1" ;;
|
||||||
audio/* | application/octet-stream) mediainfo "$1" || exit 1 ;;
|
audio/* | application/octet-stream) mediainfo "$1" || exit 1 ;;
|
||||||
video/* )
|
video/* )
|
||||||
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)"
|
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)"
|
||||||
@ -45,6 +49,14 @@ case "$(file --dereference --brief --mime-type -- "$1")" in
|
|||||||
[ ! -f "$CACHE.jpg" ] && gnome-epub-thumbnailer "$1" "$CACHE.jpg"
|
[ ! -f "$CACHE.jpg" ] && gnome-epub-thumbnailer "$1" "$CACHE.jpg"
|
||||||
image "$CACHE.jpg" "$2" "$3" "$4" "$5" "$1"
|
image "$CACHE.jpg" "$2" "$3" "$4" "$5" "$1"
|
||||||
;;
|
;;
|
||||||
|
*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
|
||||||
|
image "$CACHE.jpg" "$2" "$3" "$4" "$5" "$1"
|
||||||
|
;;
|
||||||
application/*zip) atool --list -- "$1" ;;
|
application/*zip) atool --list -- "$1" ;;
|
||||||
*opendocument*) odt2txt "$1" ;;
|
*opendocument*) odt2txt "$1" ;;
|
||||||
application/pgp-encrypted) gpg -d -- "$1" ;;
|
application/pgp-encrypted) gpg -d -- "$1" ;;
|
||||||
|
|||||||
@ -80,7 +80,8 @@ case "$chosen" in
|
|||||||
chosen="${chosen%% *}"
|
chosen="${chosen%% *}"
|
||||||
chosen="${chosen:1}" # This is a bashism.
|
chosen="${chosen:1}" # This is a bashism.
|
||||||
attemptmount || getmount
|
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."
|
notify-send "💾Drive Mounted." "$chosen mounted to $mp."
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
|||||||
@ -19,7 +19,7 @@ case "$clock" in
|
|||||||
esac
|
esac
|
||||||
|
|
||||||
case $BLOCK_BUTTON in
|
case $BLOCK_BUTTON in
|
||||||
1) notify-send "This Month" "$(cal --color=always | sed "s/..7m/<b><span color=\"red\">/;s|..27m|</span></b>|")" && notify-send "Appointments" "$(calcurse -d3)" ;;
|
1) notify-send "This Month" "$(cal | sed "s/\<$(date +'%e')\>/<b><span color='red'>&<\/span><\/b>/")" && notify-send "Appointments" "$(calcurse -d3)" ;;
|
||||||
2) setsid -f "$TERMINAL" -e calcurse ;;
|
2) setsid -f "$TERMINAL" -e calcurse ;;
|
||||||
3) notify-send "📅 Time/date module" "\- Left click to show upcoming appointments for the next three days via \`calcurse -d3\` and show the month via \`cal\`
|
3) notify-send "📅 Time/date module" "\- Left click to show upcoming appointments for the next three days via \`calcurse -d3\` and show the month via \`cal\`
|
||||||
- Middle click opens calcurse if installed" ;;
|
- Middle click opens calcurse if installed" ;;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user