dotfiles

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

commit f799505df1964d38462b4462c7832aee7c757b19
parent 20a1ecd5d2558b9c29c6226ee31da11e1863714e
Author: Janis Pagel <janis.pagel@ims.uni-stuttgart.de>
Date:   Tue, 14 Apr 2020 18:00:02 +0200

Update youtube bookmarks script

Diffstat:
Mbin/mpv-youtube.bash | 12++++++------
Msxhkd/sxhkdrc | 2+-
2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/bin/mpv-youtube.bash b/bin/mpv-youtube.bash @@ -1,14 +1,14 @@ #!/bin/env bash -BOOKMARKS="$HOME/.bookmarks.html" -TMPFILE=$HOME/.tmp/mpv-youtube.last -LASTENTRY=`< $TMPFILE` +BOOKMARKS_PATH="$HOME/.bookmarks.html" +CACHEFILE=$HOME/.cache/mpv-youtube.last +LASTENTRY=`< $CACHEFILE` -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 "$@") +ENTRY=$(cat <(printf 'Last: %s\n\n' "$LASTENTRY") <(paste -d' ' <(pup -f $BOOKMARKS_PATH "dt a attr{adddate}") <(pup -f $BOOKMARKS_PATH "dt a text{}") <(pup -f $BOOKMARKS_PATH "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 + echo $ENTRY > $CACHEFILE fi LINK=$(echo $ENTRY | tr ' ' '\n' | tail -1) -mpv --x11-name=mpv-youtube $LINK +mpv --no-terminal --force-window --keep-open=yes --ytdl --no-osc --x11-name="mpv-youtube" "$LINK" diff --git a/sxhkd/sxhkdrc b/sxhkd/sxhkdrc @@ -56,7 +56,7 @@ alt + t st -e top alt + shift + y - st -e mpv-youtube.bash -c -p "YouTube Bookmarks" -i -l 20 + mpv-youtube.bash -c -p "YouTube Bookmarks" -i -l 20 alt + y st -e youtube-viewer