From 5a3a9936b66e0fe29ef7e0cff01f98872935e2cb Mon Sep 17 00:00:00 2001 From: warthog18 <62523836+warthog18@users.noreply.github.com> Date: Fri, 11 Nov 2022 23:51:00 +0100 Subject: [PATCH] Added bookmarkthis script Adding bookmarkscript by Luke Smith, shown in YT video "Bookmarking for Unix Chads..."... what do you think? --- .local/bin/bookmarkthis | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 .local/bin/bookmarkthis diff --git a/.local/bin/bookmarkthis b/.local/bin/bookmarkthis new file mode 100644 index 00000000..3e55b634 --- /dev/null +++ b/.local/bin/bookmarkthis @@ -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