Move :tools macos to :os macos

This commit is contained in:
Henrik Lissner 2020-08-20 02:10:25 -04:00
parent 7081d833f6
commit f4ec42ae5c
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
8 changed files with 117 additions and 51 deletions

View file

@ -1,31 +0,0 @@
#+TITLE: tools/macos
#+DATE: February 19, 2017
#+SINCE: v1.3
#+STARTUP: inlineimages nofold
* Table of Contents :TOC_3:noexport:
- [[#description][Description]]
- [[#maintainers][Maintainers]]
- [[#features][Features]]
* Description
This module provides extra functionality for macOS.
** Maintainers
This module has no dedicated maintainers
* Features
This module adds various macOS specific launchers under the SPC o shortcuts.
It also enables keychain as an auth-source. This is used by apps like [[file:../../../modules/app/irc/README.org][irc]] and
[[file:../../../modules/tools/magit/README.org][magit]]'s forge module. For instance, to support GitHub Forge add an internet
password like this to your keychain:
| Field | Value |
|----------+-------------------------|
| Name | api.github.com |
| Kind | Internet password |
| Account | <username>^forge |
| Where | https://api.github.com/ |
| Password | <token> |

View file

@ -1,54 +0,0 @@
;;; tools/macos/autoload.el -*- lexical-binding: t; -*-
;;;###autoload
(setq locate-command "mdfind")
;;;###autoload
(defun +macos-open-with (&optional app-name path)
"Send PATH to APP-NAME on OSX."
(interactive)
(let* ((path (expand-file-name
(replace-regexp-in-string
"'" "\\'"
(or path (if (derived-mode-p 'dired-mode)
(dired-get-file-for-visit)
(buffer-file-name)))
nil t)))
(command (format "open %s"
(if app-name
(format "-a %s '%s'" (shell-quote-argument app-name) path)
(format "'%s'" path)))))
(message "Running: %s" command)
(shell-command command)))
;;;###autoload
(defmacro +macos--open-with (id &optional app dir)
`(defun ,(intern (format "+macos/%s" id)) ()
(interactive)
(+macos-open-with ,app ,dir)))
;;;###autoload (autoload '+macos/open-in-default-program "tools/macos/autoload" nil t)
(+macos--open-with open-in-default-program)
;;;###autoload (autoload '+macos/reveal-in-finder "tools/macos/autoload" nil t)
(+macos--open-with reveal-in-finder "Finder" default-directory)
;;;###autoload (autoload '+macos/reveal-project-in-finder "tools/macos/autoload" nil t)
(+macos--open-with reveal-project-in-finder "Finder"
(or (doom-project-root) default-directory))
;;;###autoload (autoload '+macos/send-to-transmit "tools/macos/autoload" nil t)
(+macos--open-with send-to-transmit "Transmit")
;;;###autoload (autoload '+macos/send-cwd-to-transmit "tools/macos/autoload" nil t)
(+macos--open-with send-cwd-to-transmit "Transmit" default-directory)
;;;###autoload (autoload '+macos/send-to-launchbar "tools/macos/autoload" nil t)
(+macos--open-with send-to-launchbar "LaunchBar")
;;;###autoload (autoload '+macos/send-project-to-launchbar "tools/macos/autoload" nil t)
(+macos--open-with send-project-to-launchbar "LaunchBar"
(or (doom-project-root) default-directory))
;;;###autoload (autoload '+macos/open-in-iterm "tools/macos/autoload" nil t)
(+macos--open-with open-in-iterm "iTerm" default-directory)

View file

@ -1,5 +0,0 @@
;;; tools/macos/config.el -*- lexical-binding: t; -*-
(after! auth-source
(when IS-MAC
(pushnew! auth-sources 'macos-keychain-internet 'macos-keychain-generic)))