Skip to content

Instantly share code, notes, and snippets.

@bennylope
Created July 25, 2022 18:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bennylope/c1d19be08b863b7d0b809fc31b4290a0 to your computer and use it in GitHub Desktop.
Save bennylope/c1d19be08b863b7d0b809fc31b4290a0 to your computer and use it in GitHub Desktop.
Fish compatible version of productivty scripts https://gist.github.com/bennylope/dd0c723b6586ded254b3bd673a7861a3
function slacktime
while read line;
if [ (string match "*WORKTIME" "$line") ]
continue
else
echo $line
end
end < /etc/hosts > /tmp/hosts
sudo cp /tmp/hosts /etc/hosts
end
function worktime
while read line;
echo "127.0.0.1 $line # WORKTIME"
echo "fe80::1%lo0 $line # WORKTIME"
echo "127.0.0.1 www.$line # WORKTIME"
echo "fe80::1%lo0 www.$line # WORKTIME"
end < $HOME/.blocked_sites | sudo tee -a /etc/hosts > /dev/null
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment