From 35ed3e134332299cf769a8f4221829a9a6616468 Mon Sep 17 00:00:00 2001 From: opal Date: Thu, 17 Apr 2025 10:49:27 -0700 Subject: [PATCH] fixing --- .local/bin/bookmark_insert | 9 +++++---- .local/bin/bookmark_update | 4 ++-- .local/bin/{pass_autofill.sh => pass_autofill} | 2 +- .local/bin/{pass_copy.sh => pass_copy} | 0 .local/bin/{pass_user_copy.sh => pass_user_copy} | 0 5 files changed, 8 insertions(+), 7 deletions(-) rename .local/bin/{pass_autofill.sh => pass_autofill} (98%) rename .local/bin/{pass_copy.sh => pass_copy} (100%) rename .local/bin/{pass_user_copy.sh => pass_user_copy} (100%) diff --git a/.local/bin/bookmark_insert b/.local/bin/bookmark_insert index ebc25d8..31d63ad 100755 --- a/.local/bin/bookmark_insert +++ b/.local/bin/bookmark_insert @@ -1,6 +1,5 @@ #!/bin/sh -clipboard_text=$(wl-paste -p) bookmarks_file="$HOME/.local/share/bookmarks/bookmarks" if [ ! -f "$bookmarks_file" ]; then @@ -9,6 +8,10 @@ if [ ! -f "$bookmarks_file" ]; then exit 1 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 clipboard_text=$(echo "$clipboard_text" | xargs) @@ -25,10 +28,8 @@ if [ -n "$clipboard_text" ]; then else echo "$clipboard_text" >> "$bookmarks_file" notify-send "Bookmark saved" "$clipboard_text" - - # Run git update script sh "$HOME/.local/bin/bookmark_update" fi 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 diff --git a/.local/bin/bookmark_update b/.local/bin/bookmark_update index 7bce3d6..b0f444e 100755 --- a/.local/bin/bookmark_update +++ b/.local/bin/bookmark_update @@ -15,9 +15,9 @@ if [ -n "$(git status --porcelain "$bookmarks_file")" ]; then git commit -m "Update bookmarks file" # 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 notify-send "No changes" "No changes to the bookmarks file." fi diff --git a/.local/bin/pass_autofill.sh b/.local/bin/pass_autofill similarity index 98% rename from .local/bin/pass_autofill.sh rename to .local/bin/pass_autofill index bb54d63..5b20674 100755 --- a/.local/bin/pass_autofill.sh +++ b/.local/bin/pass_autofill @@ -12,7 +12,7 @@ if [ -n "$entry" ]; then fi notify-send "Autofill in 3s: Focus username field in form" - sleep 3 + sleep 1 # Type username, press Tab, then password, then Enter wtype "$username" diff --git a/.local/bin/pass_copy.sh b/.local/bin/pass_copy similarity index 100% rename from .local/bin/pass_copy.sh rename to .local/bin/pass_copy diff --git a/.local/bin/pass_user_copy.sh b/.local/bin/pass_user_copy similarity index 100% rename from .local/bin/pass_user_copy.sh rename to .local/bin/pass_user_copy