trying qutebrowser again, tweaking scripts and sway keybinds
This commit is contained in:
@@ -9,20 +9,24 @@ if [ ! -f "$bookmarks_file" ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Trim leading and trailing whitespace from clipboard
|
||||
# Trim leading/trailing whitespace
|
||||
clipboard_text=$(echo "$clipboard_text" | xargs)
|
||||
|
||||
# Strip https:// or http://
|
||||
clipboard_text=$(echo "$clipboard_text" | sed 's#^https\?://##')
|
||||
|
||||
# Remove trailing slashes
|
||||
clipboard_text=$(echo "$clipboard_text" | sed 's#/$##')
|
||||
|
||||
# Check if clipboard is not empty
|
||||
if [ -n "$clipboard_text" ]; then
|
||||
# Escape special characters for grep and check for exact match
|
||||
if grep -Fxq "$clipboard_text" "$bookmarks_file"; then
|
||||
notify-send "Bookmark already exists!" "$clipboard_text"
|
||||
else
|
||||
# Append the text to the bookmarks file
|
||||
echo "$clipboard_text" >> "$bookmarks_file"
|
||||
notify-send "Bookmark saved" "$clipboard_text"
|
||||
|
||||
# Run git update script
|
||||
# Run git update script
|
||||
sh "$HOME/.local/bin/bookmark_update"
|
||||
fi
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user