dotfiles

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README

commit 4866f7501bc37a225a9d7082bc5048f9f1a99ccf
parent ac0d63f182624493de2a7f1be29b904d53f403fc
Author: Janis Pagel <janis.pagel@ims.uni-stuttgart.de>
Date:   Sun, 15 Dec 2019 00:25:12 +0100

Add script for launching bookmarks into mpv

Diffstat:
Abin/mpv-youtube.bash | 14++++++++++++++
1 file changed, 14 insertions(+), 0 deletions(-)

diff --git a/bin/mpv-youtube.bash b/bin/mpv-youtube.bash @@ -0,0 +1,14 @@ +#!/bin/env bash + +BOOKMARKS="$HOME/.bookmarks.html" +TMPFILE=$HOME/.tmp/mpv-youtube.last +LASTENTRY=`< $TMPFILE` + +ENTRY=$(cat <(printf 'Last: %s\n\n' "$LASTENTRY") <(paste -d' ' <(pup -f $BOOKMARKS "dt a attr{adddate}") <(pup -f $BOOKMARKS "dt a text{}") <(pup -f $BOOKMARKS "dt a attr{href}") | egrep "https?://(www\.)?youtube\.(com|de)" | sort -r | cut -d' ' -f2-) | dmenu -p "YouTube Bookmarks:" -i -l 30) +if [ -z "$ENTRY" ]; then + exit 0 +else + echo $ENTRY > $TMPFILE +fi +LINK=$(echo $ENTRY | tr ' ' '\n' | tail -1) +mpv --x11-name mpv-youtube $LINK