{"id":22505392,"url":"https://github.com/azer/distractions","last_synced_at":"2026-03-16T22:32:35.502Z","repository":{"id":51614326,"uuid":"175007195","full_name":"azer/distractions","owner":"azer","description":"A command-line tool to define distracting websites and turn them on/off when needed.","archived":false,"fork":false,"pushed_at":"2020-01-30T20:30:38.000Z","size":11,"stargazers_count":59,"open_issues_count":1,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-09T08:01:37.335Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/azer.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-03-11T13:35:01.000Z","updated_at":"2023-08-18T10:30:58.000Z","dependencies_parsed_at":"2022-08-21T23:30:16.554Z","dependency_job_id":null,"html_url":"https://github.com/azer/distractions","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/azer/distractions","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/azer%2Fdistractions","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/azer%2Fdistractions/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/azer%2Fdistractions/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/azer%2Fdistractions/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/azer","download_url":"https://codeload.github.com/azer/distractions/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/azer%2Fdistractions/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260609592,"owners_count":23035959,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-07T00:18:12.443Z","updated_at":"2026-03-16T22:32:35.467Z","avatar_url":"https://github.com/azer.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# distractions\n\nA command-line tool (and background service) for managing distractions with builtin [pomodoro mode](#pomodoro).\n\n```\nSYNOPSIS\n    distractions [on|off|toggle|status|background|clock|pomodoro]\n\nOPTIONS\n    -f --file\n        Path to the distractions file. Needed for 'off' command\n       --work-time\n        Work time for pomodoro mode. Example values: '20m' '1h'. Default: 25m.\n       --break-time\n        Break time for pomodoro mode. Example values: 20m, 3m. Default: 5m\n       --on-work\n        Execute given script on starting to work\n       --on-break\n        Execute given script on break\n       --json\n        Format output as JSON. (Only implemented for clock command)\n       --relative\n        Format output as relative time. (Only implemented for clock command)\n\n    -h --help\n        Show help\n```\n\n# Install\n\nClone and add it to `$PATH`\n\n# Setting up\n\nCreate a `.distractions` file in your home directory:\n\n```\ngmail.com\nnews.ycombinator.com\ntwitter.com\nquora.com\n```\n\nStart a background service as `root`, it needs write access to `/etc/hosts`;\n\n```bash\n$ sudo distractions background -f ~/.distractions\n```\n\nIf preferred, you can define a system service;\n\n```\nUnit]\nDescription=Distractions\n\n[Service]\nType=simple\nExecStart=distractions background -f /home/azer/.distractions\nUser=root\n\n[Install]\nWantedBy=multi-user.target\n```\n\n# Usage\n\nOnce distractions is running on the background, you can call it by sending signals via the same distraction script;\n\n```bash\n$ distractions off\n```\n\nIt'll add these lines to `/etc/hosts`:\n\n```hosts\n# \u003cdistractions\u003e\n127.0.0.1 gmail.com\n127.0.0.1 news.ycombinator.com\n127.0.0.1 twitter.com\n127.0.0.1 quora.com\n# \u003c/distractions\u003e\n```\n\nYou can turn them on if needed, so they'll be removed from `/etc/hosts`\n\n```bash\n$ distractions on\n```\n\nCheck if it's on/off:\n\n```bash\n$ distractions status\n```\n\n# Pomodoro\n\nRun `clock` command to see how many minutes has passed since you've turned off distractions;\n\n```bash\n$ distractions clock\n00:08 Work\n```\n\nRun `pomodoro` command if you prefer switching work/break mode automatically:\n\n```bash\n$ distractions pomodoro\nStarting Pomodoro.\nStarting work-mode.\n```\n\nBy default, work is 25 minutes and break is 5 minutes. You can customize that;\n\n```bash\n$ distractions pomodoro --work-time 15m --break-time 3m\n```\n\nYou can set custom scripts to be executed when work/break mode starts:\n\n```bash\n$ distractions pomodoro --on-work ~/start-work.sh --on-break ~/start-break.sh\n```\n\nIf desired, you can define a system service for pomodoro mode so you can control it easily;\n\n```\nDescription=Pomodoro\n\n[Service]\nType=simple\nExecStart=distractions pomodoro --on-work /home/azer/.pomodoro/start-work.sh --on-break /home/azer/.pomodoro/start-break.sh\nEnvironment=DISPLAY=:0\nEnvironment=XAUTHORITY=%h/.Xauthority\nEnvironment=DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus\nUser=azer\n\n[Install]\nWantedBy=multi-user.target\n```\n\nNote that this service runs as non-root user, in contrast to the background service.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fazer%2Fdistractions","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fazer%2Fdistractions","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fazer%2Fdistractions/lists"}