dotfiles

*nix config files
git clone git://git.pyratebeard.net/dotfiles.git
Log | Files | Refs | README

commit ab065c81a055fd0ff1c524d38f56af09ecebcd7c
parent 54d5c641a4732fa39c033ca42e3cc2a215878d8f
Author: pyratebeard <root@pyratebeard.net>
Date:   Sun, 12 Sep 2021 23:17:01 +0100

plumber

Diffstat:
Abin/bin/mario | 41+++++++++++++++++++++++++++++++++++++++++
1 file changed, 41 insertions(+), 0 deletions(-)

diff --git a/bin/bin/mario b/bin/bin/mario @@ -0,0 +1,41 @@ +#!/bin/sh +# ┏┏┓┳━┓┳━┓o┏━┓ +# ┃┃┃┃━┫┃┳┛┃┃ ┃ +# ┛ ┇┛ ┇┇┗┛┇┛━┛ +# p l u m b e r + +url="$1" +filetype=$(curl -Ls "${url}" | file - | awk '{print $2}') + +iso_type() { + _iso=$(curl -Ls "${url}" | file - | awk '{print $4}') + case ${_iso} in + MP4) /usr/bin/mpv "${url}" ;; + *) /usr/bin/notify-send -u 'normal' "mario: unknown iso type ${_iso}" ;; + esac +} + +vimify() { + timestamp=$(date +%s) + curl -L -o /tmp/mario-${timestamp} "${1}" + urxvtc -hold -e vim /tmp/mario-${timestamp} + #rm -f /tmp/mario-${timestamp} +} + +plumbit() { + case ${filetype} in + JPEG|PNG|GIF) /home/pyratebeard/bin/webimg "${url}" ;; + Audio) /usr/bin/mpv "${url}" ;; + POSIX) urxvtc -hold -e curl -s ${url} ;; + ISO) iso_type ;; + #HTML) urxvtc -hold -e lynx -lss=~/.config/lynx/lynx.lss "${url}" ;; + HTML|XML) qutebrowser "${url}" ;; + #Unicode|Bourne-Again|ASCII|C|Python) curl -L -o /tmp/mario.sh "${url}" ; urxvtc -hold -e vim /tmp/mario.sh ; rm -f /tmp/mario.sh ;; + Unicode|Bourne-Again|ASCII|C|Python) vimify "${url}" ;; + #Unicode|Bourne-Again|ASCII|C|Python) urxvtc -hold -e curl -Ls "${url}" ;; + PDF) curl -L -o /tmp/mario.pdf "${url}" ; zathura /tmp/mario.pdf ; rm -f /tmp/mario.pdf ;; + *) /usr/bin/notify-send -u 'normal' "mario: unknown filetype ${filetype}" ;; + esac +} + +[[ "${url}" == *"youtube"* ]] && mpv "${url}" || plumbit