diff options
Diffstat (limited to 'scripts/bookmark.sh')
| -rwxr-xr-x | scripts/bookmark.sh | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/scripts/bookmark.sh b/scripts/bookmark.sh new file mode 100755 index 0000000..a41eb8e --- /dev/null +++ b/scripts/bookmark.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +bookmark=$(wl-paste -p) +filename="$HOME/.local/share/larbs/bookmarks" + + +if [[ "$bookmark" =~ ^https?:// ]]; then + if grep -q "^$bookmark$" "$filename"; then + notify-send "Bookmark Status" "Already Bookmarked" + else + notify-send "Bookmark Status" "Bookmark Added" + echo "$bookmark" >> "$filename" + fi +else + exit 1 +fi |
