Last active
May 15, 2022 15:24
-
-
Save belkarx/299b6d83a85beee2c2559c1b42f96c1d to your computer and use it in GitHub Desktop.
Puts all copied URLs in a file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
while clipnotify | |
do | |
paste=$(parcellite -c) | |
if [[ -z $(echo $paste | grep -Eoq "(http|https)://[a-zA-Z0-9./?=_-]*") ]] | |
then | |
echo -e "$paste\n$(date +%Y-%m-%d/%H:%M)" >> $HOME/notes/clipurls | |
### Avoids duplicates | |
#prev=$(tail -n1 $HOME/notes/clipurls) | |
#if [[ "$paste" != "$prev" ]]; then | |
# echo -e "$paste\n$(date +%Y-%m-%d/%H:%M)" >> $HOME/notes/clipurls | |
#fi | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment