dooti


Namedooti JSON
Version 0.2.2 PyPI version JSON
download
home_pageNone
SummaryManage default file and URI scheme handlers on macOS 12.0+
upload_time2024-10-18 12:36:32
maintainerNone
docs_urlNone
authorNone
requires_python>=3.10
licenseApache Software License
keywords salt-extension
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ==============
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 <https://pipx.pypa.io/stable/>`_, 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.app

Set handlers
~~~~~~~~~~~~
Changing the default handler can be requested by adding ``-x <handler_ref>`` 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: Preview

    scheme:
      http: Firefox
      mailto: Mail

    uti:
      public.c‑source: Sublime Text

    app:
      Sublime Text:
        ext:
          - py
          - rst
          - yml
          - yaml
        uti:
          - public.fortran‑source

      Brave Browser:
        scheme:
          - ipfs

By 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 <https://developer.apple.com/documentation/coreservices/1444955-lssetdefaultrolehandlerforconten>`_ and `LSSetDefaultHandlerForURLScheme <https://developer.apple.com/documentation/coreservices/1447760-lssetdefaulthandlerforurlscheme?language=objc>`_, 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 <https://github.com/moretension/duti>`_
* `openwith <https://github.com/jdek/openwith>`_
* `defaultbrowser <https://gist.github.com/miketaylr/5969656>`_
* `SwiftDefaultApps <https://github.com/Lord-Kamina/SwiftDefaultApps>`_

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "dooti",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.10",
    "maintainer_email": null,
    "keywords": "salt-extension",
    "author": null,
    "author_email": "jeanluc <lkubb@protonmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/0b/b5/e8ed3df1891601dd0661c0fbad817196d3decea3491e32104d6fe7497e3e/dooti-0.2.2.tar.gz",
    "platform": null,
    "description": "==============\nDooti overview\n==============\n\nManage default handlers for files and URI schemes on MacOS 12.0+.\n\n\nFeatures\n--------\n* Manage handlers by specifying file extension, UTI or URI scheme.\n* Specify handlers by name, bundle ID or absolute path.\n* Check your associations into a dotfiles repository and ensure an idempotent state by simply running ``dooti apply``.\n\n\nInstallation\n------------\nI recommend installing with `pipx <https://pipx.pypa.io/stable/>`_, although pip will work fine as well:\n\n.. code-block:: bash\n\n        pipx install dooti\n\n\nQuickstart\n----------\n``dooti`` currently supports three specific subcommands (``ext``, ``scheme``, ``uti``) and a broad one (``apply``).\n\nLookup handlers\n~~~~~~~~~~~~~~~\nSimply pass a list of one specific type to the appropriate command. Example:\n\n.. code-block:: console\n\n    $ dooti ext html xml\n    html: /Applications/Firefox.app\n    xml: /Applications/Sublime Text.app\n\n    $ dooti --format json scheme http https ftp | jq\n    {\n      \"http\": \"/Applications/Firefox.app\",\n      \"https\": \"/Applications/Firefox.app\",\n      \"ftp\": \"/System/Library/CoreServices/Finder.app\"\n    }\n\n    $ dooti uti public.html\n    public.html: /Applications/Firefox.app\n\nSet handlers\n~~~~~~~~~~~~\nChanging the default handler can be requested by adding ``-x <handler_ref>`` to the lookup command. The handler reference can be a name, bundle ID or absolute filesystem path. Example:\n\n.. code-block:: console\n\n    $ dooti ext csv xml -x \"Sublime Text\"\n    The following extensions are set to be changed:\n    csv: /Applications/Numbers.app -> /Applications/Sublime Text.app\n    xml: /Applications/Firefox.app -> /Applications/Sublime Text.app\n\n    $ dooti scheme ftp -x /Applications/Firefox.app\n    The following scheme is set to be changed:\n    ftp: /System/Library/CoreServices/Finder.app -> /Applications/Firefox.app\n\n    $ dooti -tf json uti public.c-source -x com.sublimetext.4\n    {\"changes\": {\"utis\": {\"public.c-source\": {\"from\": \"/Applications/Notes.app\", \"to\": \"/Applications/Sublime Text.app\"}}}, \"errors\": []}\n\n\nEnsure state\n~~~~~~~~~~~~\n``dooti`` can ingest and apply a YAML configuration like this:\n\n.. code-block:: yaml\n\n    ext:\n      jpeg: Preview\n\n    scheme:\n      http: Firefox\n      mailto: Mail\n\n    uti:\n      public.c\u2011source: Sublime Text\n\n    app:\n      Sublime Text:\n        ext:\n          - py\n          - rst\n          - yml\n          - yaml\n        uti:\n          - public.fortran\u2011source\n\n      Brave Browser:\n        scheme:\n          - ipfs\n\nBy default, it looks at ``$XDG_CONFIG_HOME/dooti/config.yaml`` (and others, see ``docs/usage.rst``).\n\nLimitations\n-----------\n* The designated handler has to be installed before running the command.\n* Setting some URI scheme handlers (especially for http) might cause a prompt.\n* Setting some file extension handlers might be restricted (especially html seems to fail silently).\n\n\nWhy?\n----\nMost existing tools use `LSSetDefaultRoleHandlerForContentType <https://developer.apple.com/documentation/coreservices/1444955-lssetdefaultrolehandlerforconten>`_ and `LSSetDefaultHandlerForURLScheme <https://developer.apple.com/documentation/coreservices/1447760-lssetdefaulthandlerforurlscheme?language=objc>`_, which are deprecated in macOS 12.0. ``dooti`` uses a more recent API and should work on Monterey (12.0) and above.\n\n\nSimilar tools\n-------------\n* `duti <https://github.com/moretension/duti>`_\n* `openwith <https://github.com/jdek/openwith>`_\n* `defaultbrowser <https://gist.github.com/miketaylr/5969656>`_\n* `SwiftDefaultApps <https://github.com/Lord-Kamina/SwiftDefaultApps>`_\n",
    "bugtrack_url": null,
    "license": "Apache Software License",
    "summary": "Manage default file and URI scheme handlers on macOS 12.0+",
    "version": "0.2.2",
    "project_urls": {
        "Documentation": "https://lkubb.github.io/dooti/",
        "Homepage": "https://github.com/lkubb/dooti",
        "Source": "https://github.com/lkubb/dooti",
        "Tracker": "https://github.com/lkubb/dooti/issues"
    },
    "split_keywords": [
        "salt-extension"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "b9c6e7edf8aa123ae5443cb76b70898e3872fab6fe93b944ffe85e5681790627",
                "md5": "124fc29bccd8e1601e1257612f31d9de",
                "sha256": "f41c1bc3f8c6b16a28b1e4e79e55eda7fb76f92c173a293adc7eb25b1661e1e5"
            },
            "downloads": -1,
            "filename": "dooti-0.2.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "124fc29bccd8e1601e1257612f31d9de",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10",
            "size": 21454,
            "upload_time": "2024-10-18T12:36:31",
            "upload_time_iso_8601": "2024-10-18T12:36:31.048292Z",
            "url": "https://files.pythonhosted.org/packages/b9/c6/e7edf8aa123ae5443cb76b70898e3872fab6fe93b944ffe85e5681790627/dooti-0.2.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "0bb5e8ed3df1891601dd0661c0fbad817196d3decea3491e32104d6fe7497e3e",
                "md5": "71266c1f823af61f510993eebd14130d",
                "sha256": "57ccf3323a79b46b6d94f02a47a75c857d666e9c9561e82e248b641102fe0194"
            },
            "downloads": -1,
            "filename": "dooti-0.2.2.tar.gz",
            "has_sig": false,
            "md5_digest": "71266c1f823af61f510993eebd14130d",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10",
            "size": 42983,
            "upload_time": "2024-10-18T12:36:32",
            "upload_time_iso_8601": "2024-10-18T12:36:32.063740Z",
            "url": "https://files.pythonhosted.org/packages/0b/b5/e8ed3df1891601dd0661c0fbad817196d3decea3491e32104d6fe7497e3e/dooti-0.2.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-10-18 12:36:32",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "lkubb",
    "github_project": "dooti",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "dooti"
}
        
Elapsed time: 1.12920s