Merge branch 'master' of github.com:LukeSmithxyz/voidrice

This commit is contained in:
Luke Smith 2020-06-09 16:42:42 -04:00
commit 117194dc6f
No known key found for this signature in database
GPG key ID: 4C50B54A911F6252
3 changed files with 19 additions and 15 deletions

View file

@ -18,7 +18,7 @@ cmd open ${{
image/vnd.djvu|application/pdf|application/octet-stream) setsid -f zathura $fx >/dev/null 2>&1 ;; image/vnd.djvu|application/pdf|application/octet-stream) setsid -f zathura $fx >/dev/null 2>&1 ;;
text/*) $EDITOR $fx;; text/*) $EDITOR $fx;;
image/x-xcf|image/svg+xml) setsid -f gimp $f >/dev/null 2>&1 ;; image/x-xcf|image/svg+xml) setsid -f gimp $f >/dev/null 2>&1 ;;
image/*) rotdir $f | grep -i "\.\(png\|jpg\|jpeg\|gif\|webp\)\(_large\)*$" | sxiv -aio 2>/dev/null | lf-select ;; image/*) rotdir $f | grep -i "\.\(png\|jpg\|jpeg\|gif\|webp\|tif\)\(_large\)*$" | sxiv -aio 2>/dev/null | lf-select ;;
audio/*) mpv --audio-display=no $f ;; audio/*) mpv --audio-display=no $f ;;
video/*) setsid -f mpv $f -quiet >/dev/null 2>&1 ;; video/*) setsid -f mpv $f -quiet >/dev/null 2>&1 ;;
application/pdf|application/vnd*|application/epub*) setsid -f zathura $fx >/dev/null 2>&1 ;; application/pdf|application/vnd*|application/epub*) setsid -f zathura $fx >/dev/null 2>&1 ;;

View file

@ -12,6 +12,7 @@
file=$(readlink -f "$1") file=$(readlink -f "$1")
dir=${file%/*} dir=${file%/*}
base="${file%.*}" base="${file%.*}"
ext="${file##*.}"
cd "$dir" || exit cd "$dir" || exit
@ -25,25 +26,26 @@ textype() { \
$command --output-directory="$dir" "$base" $command --output-directory="$dir" "$base"
} }
case "$file" in case "$ext" in
*\.ms) preconv "$file" | refer -PS -e | groff -me -ms -kept -T pdf > "$base".pdf ;; ms) preconv "$file" | refer -PS -e | groff -me -ms -kept -T pdf > "$base".pdf ;;
*\.mom) preconv "$file" | refer -PS -e | groff -mom -kept -T pdf > "$base".pdf ;; mom) preconv "$file" | refer -PS -e | groff -mom -kept -T pdf > "$base".pdf ;;
*\.[0-9]) preconv "$file" | refer -PS -e | groff -mandoc -T pdf > "$base".pdf ;; [0-9]) preconv "$file" | refer -PS -e | groff -mandoc -T pdf > "$base".pdf ;;
*\.[rR]md) Rscript -e "rmarkdown::render('$file', quiet=TRUE)" ;; [rR]md) Rscript -e "rmarkdown::render('$file', quiet=TRUE)" ;;
*\.tex) textype "$file" ;; tex) textype "$file" ;;
*\.md) if command -v lowdown >/dev/null; then md) if command -v lowdown >/dev/null; then
lowdown -d nointem -e super "$file" -Tms | groff -mpdfmark -ms -kept > "$base".pdf lowdown -d nointem -e super "$file" -Tms | groff -mpdfmark -ms -kept > "$base".pdf
elif command -v groffdown >/dev/null; then elif command -v groffdown >/dev/null; then
groffdown -i "$file" | groff > "$base.pdf" groffdown -i "$file" | groff > "$base.pdf"
else else
pandoc "$file" --pdf-engine=xelatex -o "$base".pdf pandoc "$file" --pdf-engine=xelatex -o "$base".pdf
fi ; ;; fi ; ;;
*config.h) sudo make install ;; h) sudo make install ;;
*\.c) cc "$file" -o "$base" && "$base" ;; c) cc "$file" -o "$base" && "$base" ;;
*\.py) python "$file" ;; py) python "$file" ;;
*\.m) octave "$file" ;; rs) cargo build ;;
*\.scad) openscad -o "$base".stl "$file" ;; m) octave "$file" ;;
*\.go) go run "$file" ;; scad) openscad -o "$base".stl "$file" ;;
*\.sent) setsid -f sent "$file" 2>/dev/null ;; go) go run "$file" ;;
sent) setsid -f sent "$file" 2>/dev/null ;;
*) sed 1q "$file" | grep "^#!/" | sed "s/^#!//" | xargs -r -I % "$file" ;; *) sed 1q "$file" | grep "^#!/" | sed "s/^#!//" | xargs -r -I % "$file" ;;
esac esac

View file

@ -34,6 +34,8 @@ export ANDROID_SDK_HOME="${XDG_CONFIG_HOME:-$HOME/.config}/android"
export CARGO_HOME="${XDG_DATA_HOME:-$HOME/.local/share}/cargo" export CARGO_HOME="${XDG_DATA_HOME:-$HOME/.local/share}/cargo"
export GOPATH="${XDG_DATA_HOME:-$HOME/.local/share}/go" export GOPATH="${XDG_DATA_HOME:-$HOME/.local/share}/go"
export ANSIBLE_CONFIG="${XDG_CONFIG_HOME:-$HOME/.config}/ansible/ansible.cfg" export ANSIBLE_CONFIG="${XDG_CONFIG_HOME:-$HOME/.config}/ansible/ansible.cfg"
export UNISON="${XDG_DATA_HOME:-$HOME/.local/share}/unison"
export HISTFILE="${XDG_DATA_HOME:-$HOME/.local/share}/history"
# Other program settings: # Other program settings:
export DICS="/usr/share/stardict/dic/" export DICS="/usr/share/stardict/dic/"