Skip to content

Instantly share code, notes, and snippets.

@sulsanaul
Created September 21, 2021 07:04
Show Gist options
  • Save sulsanaul/97006e76c5b7f495765205f4d88d0915 to your computer and use it in GitHub Desktop.
Save sulsanaul/97006e76c5b7f495765205f4d88d0915 to your computer and use it in GitHub Desktop.
#!/bin/bash
echo "Running capturetabs..."
markdown=""
numtabs=0
for DIR in mnt/tabs/by-title/*
do
((numtabs++))
title=`cat $DIR/title.txt`
url=`cat $DIR/url.txt`
if ! grep -q "roamresearch.com" <<< $url
then
markdown+="[$title]($url)\n"
rm -r $DIR
fi
done
echo $markdown | pbcopy
echo "Copied $numtabs tabs to clipboard."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment