summaryrefslogtreecommitdiff
path: root/bookmark
diff options
context:
space:
mode:
authorBlake Romero <blake@blkrom.com>2024-12-11 23:20:14 +0000
committerBlake Romero <blake@blkrom.com>2024-12-11 23:20:14 +0000
commit19ea0186deab445c7b0574e239343a8162c45403 (patch)
tree9898479c711b28a2b85821d4e3c45ec99b391233 /bookmark
parentbdb38bb1424b61fa8a1d2b92c3545433ad165f68 (diff)
Add bookmark play option & remove auto detect description
Diffstat (limited to 'bookmark')
-rwxr-xr-xbookmark20
1 files 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 '/<title>/p' | sed -E 's,<title>(.*)</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
;;