From 19ea0186deab445c7b0574e239343a8162c45403 Mon Sep 17 00:00:00 2001 From: Blake Romero Date: Wed, 11 Dec 2024 23:20:14 +0000 Subject: Add bookmark play option & remove auto detect description --- bookmark | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/bookmark b/bookmark index b7dcf78..db8800d 100755 --- a/bookmark +++ b/bookmark @@ -26,19 +26,10 @@ if [ "$1" = "add" ]; then # Prompt for link confirmation addbookmark=$(printf "Yes\nNo" | bemenu -p "Add '$link' to bookmarks?" --auto-select) + # Description if [ "$addbookmark" = "Yes" ]; then - description=$(curl -L "$link" | sed -n '//p' | sed -E 's,<title>(.*),\1,' | xargs) - - [ -z "$description" ] \ - && description=$(: | bemenu -p "Enter a description: ") - - # Prompt for description confirmation - usedescription=$(printf "Yes\nNo" | bemenu -p "Use description '$description'?" --auto-select) - [ -z "$usedescription" ] && exit 1 - - if [ "$usedescription" = "No" ]; then - description=$(: | bemenu -p "Enter a description: ") - fi + description=$(: | bemenu -p "Enter a description: ") + [ -z "$description" ] && exit 1 printf "# %s\n%s\n" "$description" "$link" >> "$bookmarks" \ && notify-send "Bookmark Added" "$link" @@ -55,7 +46,7 @@ link=$(sed -n "/^# $description$/{n;p}" "$bookmarks") [ -z "$link" ] && exit 1 # Perform an action on a bookmark -case "$(printf 'Open\nCopy\nType' | bemenu -p 'Bookmark action')" in +case "$(printf 'Open\nCopy\nType\nPlay' | bemenu -p 'Bookmark action')" in "Open") wlrctl window focus $browser "$browser" "$link" @@ -67,6 +58,9 @@ case "$(printf 'Open\nCopy\nType' | bemenu -p 'Bookmark action')" in "Type") echo "$link" | wtype - ;; + "Play") + mpv "$link" + ;; *) exit ;; -- cgit