Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lkubb/dooti
Manage default handlers for files and URI schemes on macOS 12.0+.
https://github.com/lkubb/dooti
default-handler dotfiles dotfiles-automation dotfiles-macos duti macos macos-monterey uniform-type-identifier utility
Last synced: 18 days ago
JSON representation
Manage default handlers for files and URI schemes on macOS 12.0+.
- Host: GitHub
- URL: https://github.com/lkubb/dooti
- Owner: lkubb
- License: gpl-3.0
- Created: 2022-01-28T19:28:39.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2024-10-18T13:20:50.000Z (19 days ago)
- Last Synced: 2024-10-18T15:05:21.111Z (19 days ago)
- Topics: default-handler, dotfiles, dotfiles-automation, dotfiles-macos, duti, macos, macos-monterey, uniform-type-identifier, utility
- Language: Python
- Homepage: https://lkubb.github.io/dooti/
- Size: 124 KB
- Stars: 7
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.rst
- Changelog: HISTORY.rst
- License: LICENSE
Awesome Lists containing this project
README
==============
Dooti overview
==============Manage default handlers for files and URI schemes on MacOS 12.0+.
Features
--------
* Manage handlers by specifying file extension, UTI or URI scheme.
* Specify handlers by name, bundle ID or absolute path.
* Check your associations into a dotfiles repository and ensure an idempotent state by simply running ``dooti apply``.Installation
------------
I recommend installing with `pipx `_, although pip will work fine as well:.. code-block:: bash
pipx install dooti
Quickstart
----------
``dooti`` currently supports three specific subcommands (``ext``, ``scheme``, ``uti``) and a broad one (``apply``).Lookup handlers
~~~~~~~~~~~~~~~
Simply pass a list of one specific type to the appropriate command. Example:.. code-block:: console
$ dooti ext html xml
html: /Applications/Firefox.app
xml: /Applications/Sublime Text.app$ dooti --format json scheme http https ftp | jq
{
"http": "/Applications/Firefox.app",
"https": "/Applications/Firefox.app",
"ftp": "/System/Library/CoreServices/Finder.app"
}$ dooti uti public.html
public.html: /Applications/Firefox.appSet handlers
~~~~~~~~~~~~
Changing the default handler can be requested by adding ``-x `` to the lookup command. The handler reference can be a name, bundle ID or absolute filesystem path. Example:.. code-block:: console
$ dooti ext csv xml -x "Sublime Text"
The following extensions are set to be changed:
csv: /Applications/Numbers.app -> /Applications/Sublime Text.app
xml: /Applications/Firefox.app -> /Applications/Sublime Text.app$ dooti scheme ftp -x /Applications/Firefox.app
The following scheme is set to be changed:
ftp: /System/Library/CoreServices/Finder.app -> /Applications/Firefox.app$ dooti -tf json uti public.c-source -x com.sublimetext.4
{"changes": {"utis": {"public.c-source": {"from": "/Applications/Notes.app", "to": "/Applications/Sublime Text.app"}}}, "errors": []}Ensure state
~~~~~~~~~~~~
``dooti`` can ingest and apply a YAML configuration like this:.. code-block:: yaml
ext:
jpeg: Previewscheme:
http: Firefox
mailto: Mailuti:
public.c‑source: Sublime Textapp:
Sublime Text:
ext:
- py
- rst
- yml
- yaml
uti:
- public.fortran‑sourceBrave Browser:
scheme:
- ipfsBy default, it looks at ``$XDG_CONFIG_HOME/dooti/config.yaml`` (and others, see ``docs/usage.rst``).
Limitations
-----------
* The designated handler has to be installed before running the command.
* Setting some URI scheme handlers (especially for http) might cause a prompt.
* Setting some file extension handlers might be restricted (especially html seems to fail silently).Why?
----
Most existing tools use `LSSetDefaultRoleHandlerForContentType `_ and `LSSetDefaultHandlerForURLScheme `_, which are deprecated in macOS 12.0. ``dooti`` uses a more recent API and should work on Monterey (12.0) and above.Similar tools
-------------
* `duti `_
* `openwith `_
* `defaultbrowser `_
* `SwiftDefaultApps `_