trying qutebrowser again, tweaking scripts and sway keybinds

This commit is contained in:
2025-04-15 17:53:45 -07:00
parent 23f53a5ac4
commit 9e424589de
10 changed files with 4333 additions and 4 deletions

View File

@@ -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