Added bookmarkthis script

Adding bookmarkscript by Luke Smith, shown in YT video "Bookmarking for Unix Chads..."... what do you think?
This commit is contained in:
warthog18 2022-11-11 23:51:00 +01:00 committed by GitHub
parent d6616cf08b
commit 5a3a9936b6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

11
.local/bin/bookmarkthis Normal file
View File

@ -0,0 +1,11 @@
#!/bin/sh
bookmark="$(xclip -o)"
file="$HOME/.local/share/larbs/snippets"
if grep "^$bookmark$" "$file"; then
notify-send "Oops." "Already bookmarked!"
else
notify-send "Bookmark added!" "$bookmark is now saved to the file."
echo "$bookmark" >> "$file"
fi