Skip to main content

Manages default file and URL scheme handlers on macOS 12.0+

Project description

Set default handlers for files and URL schemes on MacOS 12.0+.

Why?

Most existing tools use LSSetDefaultRoleHandlerForContentType and LSSetDefaultHandlerForURLScheme, which are deprecated and apparently only available up to macOS 12.0. dooti uses a different API and should work on Monterey (12.0) and above.

Limitations

  • This tool was built out of necessity for myself and is not battle-tested.

  • The designated handler has to be installed before running the command for this to work at all.

  • Setting some URL scheme handlers (especially for http) might cause a prompt.

  • Setting some file extension handlers might be restricted (especially html seems to fail silently).

Installation

I recommend installing with pipx, although pip will work fine as well:

pipx install dooti

Quickstart

dooti currently supports three commands:

ext

specify handlers for file extensions (will be automapped to associated UTI)

scheme

specify handlers for URL schemes

uti

specify handlers for specific UTI

Positional arguments are always the target file extension(s) / URL scheme(s) / UTI(s). This allows you to inspect the current handlers for the specific target(s):

$ dooti ext html xml
html: /Applications/Firefox.app
xml: /Applications/Sublime Text.app
$ dooti scheme http https ftp
ftp: /System/Library/CoreServices/Finder.app
http: /Applications/Firefox.app
https: /Applications/Firefox.app
$ dooti uti public.html
public.html: /Applications/Firefox.app

Changing the default handler can be requested by specifying -x <handler ref>/--handler <handler_ref>. The following formats for <handler_ref> are supported:

  • name of application:

    dooti ext csv py -x "Sublime Text"
  • absolute filesystem path:

    dooti scheme http -x "/Applications/Firefox.app"
  • bundle ID

    dooti uti public.python-script -x com.sublimetext.4

Similar tools

Todo

  • support dotfiles

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

dooti-0.1.1.tar.gz (18.1 kB view details)

Uploaded Source

Built Distribution

dooti-0.1.1-py3-none-any.whl (18.7 kB view details)

Uploaded Python 3

File details

Details for the file dooti-0.1.1.tar.gz.

File metadata

  • Download URL: dooti-0.1.1.tar.gz
  • Upload date:
  • Size: 18.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.2.2 CPython/3.10.8 Darwin/21.5.0

File hashes

Hashes for dooti-0.1.1.tar.gz
Algorithm Hash digest
SHA256 c9b3a8cfbf27060995815b10985445a02be9a1480f4424f50c9cee17b8273477
MD5 d71b0c699374b2bf039706bd8008ae1b
BLAKE2b-256 9a19ae0d6fbf09632ac0678e4ce96edd1467f21ac53e4039e5aec2f29aa01576

See more details on using hashes here.

File details

Details for the file dooti-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: dooti-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 18.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.2.2 CPython/3.10.8 Darwin/21.5.0

File hashes

Hashes for dooti-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 3aed2297d8bb8f8373b361f11ca694a5ec896331526e53104c3093e33eafb2ec
MD5 32d002cbb47118988810e0db76dd2cfc
BLAKE2b-256 15c27431e2d41ea1e4d1e6e7eeaf6ef189c5b5bfac5b18afabab5f06eebfb510

See more details on using hashes here.

Supported by

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