Clean up unnecessary stuff

This commit is contained in:
FollieHiyuki 2021-04-15 18:14:02 +03:00
parent 3f981be233
commit ca7de54b35
No known key found for this signature in database
GPG Key ID: 813CF484F4993419
4 changed files with 6 additions and 51 deletions

View File

@ -16,7 +16,7 @@ set hidden
set info 'size'
set icons
set preview
set previewer '~/.config/lf/preview 2>/dev/null'
set previewer '~/.local/bin/scope.sh 2>/dev/null'
# General
set globsearch

View File

@ -1,44 +0,0 @@
#!/bin/sh
case "$1" in
# First check common extensions
*.png|*.jpg|*.bmp|*.jpeg|*.gif|*.xpm|*.svg) mediainfo "$1" || exiftool "$1" || identify "$1" ;;
*.wav|*.mp3|*.flac|*.m4a|*.ape|*.ac3|*.og[agx]|*.spx|*.dsf|*.opus|*.dff|*.wma|*.wvc?) mediainfo "$1" || exiftool "$1" ;;
*.avi|*.mp4|*.wmv|*.dat|*.3gp|*.vob|*.ogv|*.mkv|*.mpe?g|*.fl[icv]|*.m2v|*.webm|*.m?ts|*.r[am]|*.qt|*.divx|*.as[fx]|*.m4v|*.mov) mediainfo "$1" || exiftool "$1" || fprobe -pretty "$1" 2>&1 ;;
*.pdf) mutool draw -F txt -i -- "$1" 1-10 || pdftotext -l 10 -nopgbrk -q -- "$1" - || exiftool "$1" ;;
*.ps) pstotext "$1" || ps2ascii "$1" ;;
*.epub|*.fb2) pandoc -s -t markdown -- "$1" ;;
*.djvu) djvutxt "$1" || exiftool "$1" ;;
# *.ttf|*.otf) otfinfo --info "$1" ;;
*.html|*.xhtml|*.htm) pandoc -s -t markdown -- "$1" || lynx -dump -- "$1" ;;
*.mkd|*.md|*.markdown) glow -s dark "$1" || mdcat "$1" ;;
*.ipynb) notedown --from notebook "$1" --to markdown | pandoc -f markdown -t plain ;;
*.torrent) dumptorrent -v "$1" || transmission-show -- "$1" ;;
*.zip|*.war|*.ear|*.oxt|*.tar|*.tgz|*.tar.gz|*.tbz2|*.tar.bz2|*.tar.txz|*.txz|*.rar|*.7z|*.ace|*.rpm|*.deb|*.xbps|*.Z|*.lzo|*.lzma|*.lha|*.cpio|*.jar|*.lz|*.lzh)
atool -l -q "$1" | tail -n +3 | awk -F' ' '{print $NF}' ;;
*.iso) isoinfo -l -i "$1" ;;
*.doc) catdoc -- "$1" ;;
*.docx) pandoc -s -t markdown -- "$1" ;;
*.odt|*.ott|*.s[xt]w|*.sxc) pandoc -s -t markdown -- "$1" || odt2txt "$1" ;;
*.xls) xls2csv -- "$1" ;;
*.xlsx) xlsx2csv -- "$1" ;;
*.ods|*.odp|*.sxw) pandoc -s -t markdown -- "$1" ;;
*.json) jq --color-output . "$1" || python -m json.tool -- "$1" ;;
# Then fallback to mimetypes
*)
mimetype=$(file --dereference --brief --mime-type -- "$1")
case "$mimetype" in
application/zip | application/x-tar | application/x-rar | application/x-7z-compressed | application/x-xz | application/x-bzip2 | application/x-gzip)
atool -l -q "$1" | tail -n +3 | awk -F' ' '{print $NF}' ;;
image/vnd.djvu)
djvutxt "$1" || exiftool "$1" ;;
image/*)
mediainfo "$1" || exiftool "$1" || identify "$1" ;;
video/*)
mediainfo "$1" || exiftool "$1" || fprobe -pretty "$1" 2>&1 ;;
text/* | */xml)
bat --style=plain --color=always "$1" ;;
*)
echo '----- File Type Classification -----' && file --dereference --brief -- "$1" ;;
esac ;;
esac

View File

@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/sh
MUSIC_DIR=$HOME/Music/
COVER=/tmp/cover.jpg
@ -13,17 +13,17 @@ fi
{
file="$(mpc --format %file% current -p 6600)"
album_dir="${file%/*}"
[[ -z "$album_dir" ]] && exit 1
if [ -z "$album_dir" ]; then exit 1; fi
album_dir="$MUSIC_DIR/$album_dir"
covers="$(find "$album_dir" -type d -exec find {} -maxdepth 1 -type f -iregex ".*/.*\(Album\|album\|Cover\|cover\|Folder\|folder\|Artwork\|artwork\|Front\|front\).*[.]\(jpe?g\|png\|gif\|bmp\)" \; )"
src="$(echo -n "$covers" 2>/dev/null | head -n1)"
src="$(echo "$covers" 2>/dev/null | tr -d '\n' | head -n1)"
rm -f "$COVER"
# For Notifications
if [[ -n "$src" ]] ; then
if [ -n "$src" ] ; then
# Resize the image's width to 64px
convert "$src" -resize 64x "$COVER"
if [[ -f "$COVER" ]] ; then
if [ -f "$COVER" ] ; then
notify-send -u low -i ${COVER} " Now Playing" "$(mpc --format '%title% \n%artist% - %album%' current)"
fi
else

View File

@ -29,7 +29,6 @@
"typeParameter": " ",
"default": " "
},
"coc.preferences.hoverTarget": "float",
"coc.preferences.formatOnSaveFiletypes": [
"markdown",
"html",