Skip to main content

Collect all browser URLs, output to terminal, and archive to todoist. Useful for cleaning up your workspace at the end of the day, without loosing important urls.

Project description

Release Notes Downloads License: MIT Poetry

Clean Workspace: Archive Web Browser Tabs

I love experimenting with productivity. One glitch I've found in my mind is I can easily get distracted by open tabs on my browser, especially if I'm trying to write or read something which I want to give my full attention to.

I've found that if I close all my tabs (similar idea to shrinking context size), I can focus better on the task at hand. However, I don't want to lose any interesting tabs so I don't easily quit my browsers. It's just the little extra of cognitive energy required to add more focus that doesn't get spent.

This is utility to fix this issue. It closes all your tabs (in both Safari & Chrome), sends them to todoist with a specified project and optionally a label, and outputs the list to the terminal (mostly for debugging). Only unique URLs are sent to Todoist, if you have a previous "archive task" with a URL archived it will not be archived again.

This utility has helped my mind and made it easy for me to find interesting things I've run into in the past. I've tied this into a 'first wake' hyper focus script to automatically run each morning when I first open my computer.

Installation

pip install clean-workspace
  • TODOIST_API_KEY has to exist in your shell environment for the tool to run. I recommend using direnv to do this. Add your todoist token to .envrc and direnv allow .
  • Customize the url and domain blacklist

Usage

 clean-workspace --help
Usage: clean-workspace [OPTIONS]

Options:
  --blacklist-domains PATH
  --blacklist-urls PATH
  --tab-description TEXT    Description for tab
  --todoist-label TEXT      label in todoist for all created tasks  [default:
                            web-archive]
  --todoist-project TEXT    project in todoist for all created tasks
                            [default: Learning]
  --help                    Show this message and exit.

Development

poetry install
poetry run clean-workspace

Regex Entries

You can use regex matches in both the url and domain blacklist files. For example, if you want to blacklist all Zoom domains, you can use the following:

echo "/.*zoom\.us/" >> ~/.config/clean-workspace/blacklist-domains.txt

A regex entry starts & ends with /, like sed.

Collecting Tab Description Via AppleScript

Here's a quick script you can use to collect a description of what you were working on via applescript:

dialogResult=$(
osascript <<EOT
set dialogResult to display dialog "What were you working on yesterday?" buttons {"OK"} default button "OK" giving up after 300 default answer ""
return text returned of dialogResult
EOT
)

Here's a full example of using this with hyper-focus.

Debugging

You can use ipython to interactively play with the todoist API:

from clean_workspace import _todoist_api_key
api = TodoistAPI(_todoist_api_key())

Inspiration

TODO

  • Indicate in python config that this is macOS only in poetry config? I wonder if pyobjc does this in some way?
  • move blacklist files into example area of repo
  • look at previous tasks and see if links are contained there before including them again
  • support google chrome canary
  • check to make sure regex gdrive urls work

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

clean_workspace-0.6.5.tar.gz (7.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

clean_workspace-0.6.5-py3-none-any.whl (8.6 kB view details)

Uploaded Python 3

File details

Details for the file clean_workspace-0.6.5.tar.gz.

File metadata

  • Download URL: clean_workspace-0.6.5.tar.gz
  • Upload date:
  • Size: 7.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.12.3 Darwin/23.6.0

File hashes

Hashes for clean_workspace-0.6.5.tar.gz
Algorithm Hash digest
SHA256 793a01354a31d9b3846e85e899a17173f9abad8019165cf3eb88ffad111bcf4b
MD5 e47c26f2d0a7806dbbf8af9f442ef5b9
BLAKE2b-256 bf1486f64614fc07b8d65de6fb93458c5fb4dd05b1c9eb8c97a2ff7209306f46

See more details on using hashes here.

File details

Details for the file clean_workspace-0.6.5-py3-none-any.whl.

File metadata

  • Download URL: clean_workspace-0.6.5-py3-none-any.whl
  • Upload date:
  • Size: 8.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.12.3 Darwin/23.6.0

File hashes

Hashes for clean_workspace-0.6.5-py3-none-any.whl
Algorithm Hash digest
SHA256 dca994bef4144521443cc19da0974c3a65f9f833b9cb4ea994f658d385bbb9a5
MD5 52b59b88b9be0d042878c4ac74893c74
BLAKE2b-256 b89db0cbeee2b1ab1af79d9125d74f8f667ce621fe47eb5009541fc8d71616aa

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page