Working on neomutt setup and some other small fixes

This commit is contained in:
Marko Korhonen 2020-11-25 10:06:19 +02:00
parent 91836193e7
commit bf10ef8645
36 changed files with 152 additions and 155 deletions

29
scripts/media/imageviewer Executable file
View file

@ -0,0 +1,29 @@
#!/bin/bash
if [ $# -eq 1 ]; then
DIR=/tmp/images
IMGNAME=$(basename $1)
if [ ! -d $DIR ]; then
mkdir $DIR
fi
if [ ! -f $DIR/$IMGNAME ]; then
wget $1 -O $DIR/$IMGNAME
fi
mimeo $DIR/$IMGNAME
else
DIR=/tmp/images/$(basename $1)
if [ ! -d $]; then
mkdir -p $DIR
fi
if [ ! -f $DIR/$IMGNAME ]; then
wget -P $DIR $@
fi
mimeo $DIR/*
fi

11
scripts/media/imgurviewer Executable file
View file

@ -0,0 +1,11 @@
#!/bin/bash
ALBUMNAME=$(basename $1)
ALBUMDIR=/tmp/imgur/$ALBUMNAME
if [ ! -d $ALBUMDIR ]; then
mkdir -p $ALBUMDIR
imgur-album-downloader $1 $ALBUMDIR
fi
mimeo $ALBUMDIR

30
scripts/media/mpvqueue Executable file
View file

@ -0,0 +1,30 @@
#!/usr/bin/env bash
MPVPIPE=/tmp/mpvqueue.playlist
notify="notify-send -i mpv -a mpv"
url="$1"
# See if MPV is already running
if [ -z "$(pidof mpv)" ]; then
# mpv is not running
# remove fifo
rm -f $MPVPIPE && mkfifo $MPVPIPE
# pause other players
playerctl pause
# start mpv
/usr/bin/mpv --no-terminal --input-file="${MPVPIPE}" "$url" & disown
# Wait for mpv to be up before moving on to adding anything else to playlist
while [ -z "$(pidof mpv)" ]; do
sleep 1
done
$notify "Playing $url"
else
# mpv is running, so add stuff to playlist
$notify "Adding $url"
echo "loadfile \"$url\" append-play" >> "${MPVPIPE}"
fi