This commit is contained in:
2025-04-17 10:49:27 -07:00
parent 739e3f8837
commit 35ed3e1343
5 changed files with 8 additions and 7 deletions

View File

@@ -1,6 +1,5 @@
#!/bin/sh #!/bin/sh
clipboard_text=$(wl-paste -p)
bookmarks_file="$HOME/.local/share/bookmarks/bookmarks" bookmarks_file="$HOME/.local/share/bookmarks/bookmarks"
if [ ! -f "$bookmarks_file" ]; then if [ ! -f "$bookmarks_file" ]; then
@@ -9,6 +8,10 @@ if [ ! -f "$bookmarks_file" ]; then
exit 1 exit 1
fi fi
# Try clipboard first, fall back to primary
clipboard_text=$(wl-paste --no-newline 2>/dev/null)
[ -z "$clipboard_text" ] && clipboard_text=$(wl-paste -p --no-newline 2>/dev/null)
# Trim leading/trailing whitespace # Trim leading/trailing whitespace
clipboard_text=$(echo "$clipboard_text" | xargs) clipboard_text=$(echo "$clipboard_text" | xargs)
@@ -25,10 +28,8 @@ if [ -n "$clipboard_text" ]; then
else else
echo "$clipboard_text" >> "$bookmarks_file" echo "$clipboard_text" >> "$bookmarks_file"
notify-send "Bookmark saved" "$clipboard_text" notify-send "Bookmark saved" "$clipboard_text"
# Run git update script
sh "$HOME/.local/bin/bookmark_update" sh "$HOME/.local/bin/bookmark_update"
fi fi
else else
notify-send "No text selected" "Please highlight some text to save as a bookmark." notify-send "No text to save" "Clipboard and primary selection are empty."
fi fi

View File

@@ -15,9 +15,9 @@ if [ -n "$(git status --porcelain "$bookmarks_file")" ]; then
git commit -m "Update bookmarks file" git commit -m "Update bookmarks file"
# Push the changes and log output # Push the changes and log output
#git push origin master git push origin master
notify-send "Bookmarks updated" "Please push your changes." notify-send "Bookmarks updated" "Push your changes."
else else
notify-send "No changes" "No changes to the bookmarks file." notify-send "No changes" "No changes to the bookmarks file."
fi fi

View File

@@ -12,7 +12,7 @@ if [ -n "$entry" ]; then
fi fi
notify-send "Autofill in 3s: Focus username field in form" notify-send "Autofill in 3s: Focus username field in form"
sleep 3 sleep 1
# Type username, press Tab, then password, then Enter # Type username, press Tab, then password, then Enter
wtype "$username" wtype "$username"