1
0
Fork 0

random changes

This commit is contained in:
Luca Bilke 2024-05-21 11:42:12 +02:00
parent 2d20408f46
commit 1c4fd52eee
5 changed files with 63 additions and 23 deletions

View File

@ -35,15 +35,13 @@ run() {
#shellcheck disable=SC2068 #shellcheck disable=SC2068
if ! command -v "$1" >/dev/null 2>&1; then if ! command -v "$1" >/dev/null 2>&1; then
printf "%b" "${RED}Cannot execute ${1}${RESET}" printf "%b" "${RED}Cannot execute ${1}${RESET}"
exit 1
elif "$@"; then elif "$@"; then
exit 1 :
else else
printf "%b" "${RED}Failed to run command: ${RESET}" printf "%b" "${RED}Failed to run command: ${RESET}"
for l in "$@"; do for l in "$@"; do
printf "%b" "\n${RED} ${l}${RESET}" printf "%b" "\n${RED} ${l}${RESET}"
done done
exit 1
fi fi
} }
@ -53,30 +51,72 @@ mimetest() {
[ ! -f "${CACHE}.jpg" ] && run pdftoppm -jpeg -f 1 -singlefile "$f" "$CACHE" [ ! -f "${CACHE}.jpg" ] && run pdftoppm -jpeg -f 1 -singlefile "$f" "$CACHE"
image "${CACHE}.jpg" image "${CACHE}.jpg"
;; ;;
*/x-bzip-compressed-tar | */x-compressed-tar | */x-xz-compressed-tar) run als -- "$f" ;; */x-bzip-compressed-tar | */x-compressed-tar | */x-xz-compressed-tar)
*/x-7z-compressed | */vnd.rar | */x-tar | */zip | */x-java-archive | */x-xz | */gzip) run 7z l "$f" | sed 1,11d ;; run als -- "$f"
*/x-cd-image) run iso-info --no-header -l "$f" ;; exit 1
*/x-bittorrent) run transmission-show "$f" ;; ;;
*/vnd.sun.xml.writer) run odt2txt "$f" ;; */x-7z-compressed | */vnd.rar | */x-tar | */zip | */x-java-archive | */x-xz | */gzip)
*/msword) run catdoc "$f" ;; run 7z l "$f" | sed 1,11d
*/vnd.openxmlformats-officedocument.wordprocessingml.document) run docx2txt <"$f" ;; exit 1
*/vnd.ms-excel) run ssconvert --export-type=Gnumeric_stf:stf_csv "$f" "fd://1" | text --language=csv ;; ;;
*/vnd.openxmlformats-officedocument.spreadsheetml.sheet) run ssconvert --export-type=Gnumeric_stf:stf_csv "$f" "fd://1" | text --language=csv ;; */x-cd-image)
run iso-info --no-header -l "$f"
exit 1
;;
*/x-bittorrent)
run transmission-show "$f"
exit 1
;;
*/vnd.sun.xml.writer)
run odt2txt "$f"
exit 1
;;
*/msword)
run catdoc "$f"
exit 1
;;
*/vnd.openxmlformats-officedocument.wordprocessingml.document)
run docx2txt <"$f"
exit 1
;;
*/vnd.ms-excel)
run ssconvert --export-type=Gnumeric_stf:stf_csv "$f" "fd://1" | text --language=csv
exit 1
;;
*/vnd.openxmlformats-officedocument.spreadsheetml.sheet)
run ssconvert --export-type=Gnumeric_stf:stf_csv "$f" "fd://1" | text --language=csv
exit 1
;;
*/epub+zip) */epub+zip)
[ ! -f "$CACHE" ] && run epub-thumbnailer "$f" "$CACHE" 1024 [ ! -f "$CACHE" ] && run epub-thumbnailer "$f" "$CACHE" 1024
image "$CACHE" image "$CACHE"
;; ;;
*/pgp-encrypted) run gpg -d -- "$f" ;; */pgp-encrypted)
*/pkix-cert) run openssl x509 -text -noout -in "$f" ;; run gpg -d -- "$f"
exit 1
;;
*/pkix-cert)
run openssl x509 -text -noout -in "$f"
exit 1
;;
image/svg+xml) image/svg+xml)
[ ! -f "$CACHE" ] && run inkscape --convert-dpi-method=none -o "$CACHE" --export-overwrite -D --export-png-color-mode=RGBA_16 "$f" [ ! -f "${CACHE}.png" ] && run inkscape --convert-dpi-method=none -o "${CACHE}.png" --export-overwrite -D --export-png-color-mode=RGBA_16 "$f"
image "$CACHE" image "${CACHE}.png"
;; ;;
image/*) image ;; image/*) image ;;
video/*) video ;; video/*) video ;;
*opendocument*) run odt2txt "$f" ;; *opendocument*)
*/markdown) run glow -s "$XDG_CONFIG_HOME/glow/style.json" "$f" --width "$w" ;; run odt2txt "$f"
*/html) run lynx -dump "$f" ;; exit 1
;;
*/markdown)
run glow -s "$XDG_CONFIG_HOME/glow/style.json" "$f" --width "$w"
exit 1
;;
*/html)
run lynx -dump "$f"
exit 1
;;
*) return 1 ;; *) return 1 ;;
esac esac
} }

@ -1 +1 @@
Subproject commit dcb1db488b5226478642885d5616cceea1e6260e Subproject commit 71dde0f9798908a5b4d120a1e2cedbeb1923a3d9

View File

@ -119,7 +119,7 @@ export W3M_DIR="$XDG_DATA_HOME/w3m"
export RUSTUP_HOME="$XDG_DATA_HOME/rustup" export RUSTUP_HOME="$XDG_DATA_HOME/rustup"
export PYTHONSTARTUP="/etc/python/pythonrc" export PYTHONSTARTUP="/etc/python/pythonrc"
export DOCKER_CONFIG="$XDG_CONFIG_HOME/docker" export DOCKER_CONFIG="$XDG_CONFIG_HOME/docker"
export XBPS_DISTDIR="$XDG_DOCUMENTS_DIR/dev/desktop/void-packages" export XBPS_DISTDIR="$XDG_DOCUMENTS_DIR/dev/server/void-packages"
export ZK_NOTEBOOK_DIR="$XDG_DOCUMENTS_DIR/notes" export ZK_NOTEBOOK_DIR="$XDG_DOCUMENTS_DIR/notes"
localpath="$(find -L ~/.local/bin -type d -printf %p: | sed 's/.$//')" localpath="$(find -L ~/.local/bin -type d -printf %p: | sed 's/.$//')"

View File

@ -1,2 +1,2 @@
#!/bin/sh #!/bin/sh
firefox 'element.snaile.de' 'discord.com/channels/@me' 'web.telegram.org' 'web.whatsapp.com' 'web.threema.ch' firefox 'mm.tralios.de' 'element.snaile.de' 'discord.com/channels/@me' 'web.telegram.org' 'web.whatsapp.com' 'web.threema.ch'

View File

@ -1,2 +1,2 @@
#!/bin/sh #!/bin/sh
firefox 'mm.tralios.de' 'gitlab.tralios.de' 'op.tralios.de/my/page' 'tickets.tralios.de' 'adminfrontend.prod.kc.production.kubernetes.tralios.de' 'prometheus.tralios.de/overview' firefox 'gitlab.tralios.de' 'op.tralios.de/my/page' 'tickets.tralios.de' 'adminfrontend.prod.kc.production.kubernetes.tralios.de' 'prometheus.tralios.de/overview'