{"id":16940704,"url":"https://github.com/halostatue/fish-macos","last_synced_at":"2025-04-11T19:23:12.623Z","repository":{"id":58487305,"uuid":"192257040","full_name":"halostatue/fish-macos","owner":"halostatue","description":"MacOS functions for Fish","archived":false,"fork":false,"pushed_at":"2025-04-10T03:31:30.000Z","size":123,"stargazers_count":37,"open_issues_count":2,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-11T19:23:08.398Z","etag":null,"topics":["fish","fish-plugin","fish-shell","fisher","macos"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/halostatue.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":null,"code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"halostatue","buy_me_a_coffee":"halostatue","ko_fi":"halostatue","tidelift":"rubygems/diff-lcs"}},"created_at":"2019-06-17T01:50:33.000Z","updated_at":"2025-04-10T03:30:37.000Z","dependencies_parsed_at":"2024-10-13T21:07:47.903Z","dependency_job_id":"96f77e4e-c3c8-46ca-885c-ce3769161e1e","html_url":"https://github.com/halostatue/fish-macos","commit_stats":null,"previous_names":[],"tags_count":24,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/halostatue%2Ffish-macos","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/halostatue%2Ffish-macos/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/halostatue%2Ffish-macos/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/halostatue%2Ffish-macos/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/halostatue","download_url":"https://codeload.github.com/halostatue/fish-macos/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248465353,"owners_count":21108244,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["fish","fish-plugin","fish-shell","fisher","macos"],"created_at":"2024-10-13T21:07:43.952Z","updated_at":"2025-04-11T19:23:12.588Z","avatar_url":"https://github.com/halostatue.png","language":"Shell","funding_links":["https://github.com/sponsors/halostatue","https://buymeacoffee.com/halostatue","https://ko-fi.com/halostatue","https://tidelift.com/funding/github/rubygems/diff-lcs"],"categories":["Shell"],"sub_categories":[],"readme":"# halostatue/fish-macos\n\n[![Version][version]](https://github.com/halostatue/fish-macos/releases)\n\nUseful functions for macOS using [fish shell][fish].\n\n## Installation\n\nInstall with [Fisher][fisher]:\n\n```fish\nfisher install halostatue/fish-macos@v7\n```\n\n### System Requirements\n\n- [fish][fish] 3.4+\n\nCompatibility with macOS versions is maintained on a rolling basis. When\npossible, _backwards_ compatibility will be maintained as long as the\nfunctionality is _possible_ in later versions of macOS. Functions and\nsubcommands may be removed if they are no longer supported on the latest\nversions of macOS. This will always trigger a major version release.\n\n## Functions\n\n### `app`\n\nUtilities for working with MacOS apps. Has the following subcommands:\n\n#### `app bundleid`\n\nShows the bundle identifier for each of the applications found for the pattern\n(see `app find` for how applications are found).\n\n##### Options\n\n- `-x`, `--exact`: Perform exact matches only\n- `-a`, `--all`: Show all matches\n- `-q`, `--quiet`: Suppress error output\n- `-s`, `--short`: Prints out the bundle IDs only\n\n##### Examples\n\n```console\n$ app bundleid 1password\n/Applications/1Password for Safari.app: com.1password.safari\n/Applications/1Password.app: com.1password.1password\n\n$ app bundleid -x 1password\n/Applications/1Password.app: com.1password.1password\n```\n\n#### `app find`\n\nShows installed apps by the provided pattern or patterns. Searches for apps in\n`/Applications`, `/Applications/Setapp`, `/Applications/Utilities`,\n`~/Applications`, `/Appliciations/Xcode.app/Contents/Applications`,\n`/Developer/Applications`, and `/System/Applications`.\n\n##### Options\n\n- `-x`, `--exact`: Perform exact matches only\n- `-a`, `--all`: Show all matches\n- `-q`, `--quiet`: Do not print matches\n\n##### Examples\n\n```console\n$ app find -a 1password\n/Applications/1Password for Safari.app\n/Applications/1Password.app\n\n$ app find -x 1password\n/Applications/1Password.app'\n```\n\n#### `app frontmost`\n\nShows the front-most application.\n\n##### Options\n\n- `-b`, `--bundle-id`: Shows the app bundle ID\n- `-p`, `--path`: Shows the app path\n- `-n`, `--name`: Shows the app name\n- `-P`, `--pid`: Shows the PID of the app\n- `-a`, `--all`: Shows all details\n\n##### Examples\n\n```console\n$ app frontmost\niTerm2'\n```\n\n#### `app icon`\n\nExtracts macOS app icons as PNG (see `app find` for how applications are found).\n\n##### Options\n\n- `-x`, `--exact`: Perform exact matches only\n- `-oOUTPUT`: Output to the file or directory specified\n- `--output OUTPUT`: Output to the file or directory specified\n- `-wWIDTH`: Outputs to a maximum of WIDTH pixels\n- `--width WIDTH`: Outputs to a maximum of WIDTH pixels\n\n#### `app quit`\n\nQuits apps identified by the provided pattern or patterns (see `app find` for\nhow applications are found).\n\n##### Options\n\n- `-x`, `--exact`: Quits only applications with exact matches\n- `-r`, `--restart`: Restarts the application that was quit\n\n### `finder`\n\nInteracts with the Finder. If a window number parameter is accepted in a\ncommand, the first (front-most) window is number `1`. If a lower window is\nspecified, or no window is specified, that window becomes the first window.\n\n#### `finder track`\n\nMakes the first Finder window track with the shell `$PWD`. This should be used\nin a single shell instance only, and updates only when the `$PWD` value is\nupdated.\n\n#### `finder untrack`\n\nDisables Finder directory tracking.\n\n#### `finder cd [window#]`\n\nChanges the current path to that of the Finder window.\n\n#### `finder pushd [window#]`\n\nChanges the current path with `pushd` to that of the Finder window.\n\n#### `finder pwd [window#]`\n\nPrint the current path of the Finder window.\n\n#### `finder column [window#]`\n\nChanges the Finder window to the current working directory (`$PWD`) using the\n`column` view.\n\n#### `finder icon [window#]`\n\nChanges the Finder window to the current working directory (`$PWD`) using the\n`icon` view.\n\n#### `finder list [window#]`\n\nChanges the Finder window to the current working directory (`$PWD`) using the\n`list` view.\n\n#### `finder update [window#]`\n\nChanges the Finder window to the current working directory (`$PWD`) using the\ncurrent view.\n\n#### `finder clean [path...]`\n\nRemoves `.DS_Store` files from the paths provided, or the current path if one is\nnot provided.\n\n#### `finder hidden [off|on|toggle]`\n\nShows or hides hidden files in Finder. Accepts a parameter `on` (show the\nfiles), `off` (hide the files), or `toggle`. If no parameter is given, shows the\ncurrent state.\n\n#### `finder selected`\n\nPrints a list of selected folders and files from Finder.\n\n#### `finder quarantine [show]`\n\nShows quarantine events from quarantine databases.\n\n#### `finder quarantine clear`\n\nClears quarantine events from quarantine databases.\n\n#### `finder quarantine clean FILE...`\n\nCleans the named file(s) of quarantine extended attributes.\n\n#### `finder desktop-icons [off|on|toggle]`\n\nShows or hides the desktop icons. Accepts a parameter `on` (show the files),\n`off` (hide the files), or `toggle`. If no parameter is given, shows the current\nstate.\n\n### `has_app`\n\nReturns true if one or more of the named MacOS application exists. This is a\nspecialized wrapper around `app find` that always looks for exact matches.\n\nThis was called `has:app`, but has been renamed `has_app`. The previous versions\nwill be removed at version 6.\n\n### `mac`\n\nManage various aspects of the modern MacOS interface.\n\n#### `mac airdrop`\n\nWorks with the Mac AirDrop configurations. Has the following subcommands:\n\n- `on`: Turns AirDrop on.\n- `off`: Turns AirDrop off.\n- `status`: Reports the status of AirDrop.\n\n#### `mac airport`\n\nWork with Mac AirPort configurations. Has the following subcommands:\n\n- `scan`: Scans the current AirPort configurations.\n- `ssid`: Prints the current AirPort network SSID.\n- `history`: Prints the history of network connections.\n- `on`: Turns AirPort `on`.\n- `off`: Turns AirPort `off`.\n- `password`: Recovers the current AirPort network password, or the password for\n  a specified SSID.\n\n#### `mac brightness`\n\nIncrease or decrease the brightness level. This uses system event key codes.\nSupports `up` (increase brightness) and `down` (decrease brightness).\n\n#### `mac flushdns`\n\nFlush the MacOS DNS cache.\n\n#### `mac font-smoothing`\n\nEnables or disables font smoothing. If no apps are provided, sets the global\nfont smoothing preference. If apps are provided, font smoothing will be set for\neach app. See `app bundleid` for how apps are resolved.\n\n`mac font-smoothing [options] off|on [APP...]`\n\n#### `mac lsclean`\n\nClean LaunchServices to remove duplicate 'Open with...' entries.\n\n#### `mac mail`\n\nPerforms operations on Mail.app configuration and database. Before running\nvacuum after any OS upgrade, Mail.app must have been opened at least once so\nthat the database and index formats have been updated.\n\nSupported subcommands are:\n\n- `vacuum`: Vacuums the envelope index to improve performance.\n- `attachments inline`: Sets Mail.app attachment handling to inline.\n- `attachments icon`: Sets Mail.app attachment handling to icon.\n\n\u003e This started as a process to speed up Mail.app by vacuuming the envelope index\n\u003e with a history from a October 2007 [blog post][hawkwings] by Tim Gaden on the\n\u003e Hawk Wings blog covering tips and tricks for Apple Mail. It turned into a\n\u003e script by [pmbuko][pmbuko] and Romulo and variously updated by Brett Terpstra\n\u003e (2012), Mathias Törnblom (2015), Andrei Miclaus (2017) before I ported it to\n\u003e Fish in 2022.\n\n[hawkwings]: http://web.archive.org/web/20071008123746/http://www.hawkwings.net/2007/03/03/scripts-to-automate-the-mailapp-envelope-speed-trick/\n[pmbuko]: https://github.com/pmbuko\n\n#### `mac proxy-icon`\n\nEnables or disables the visibility of the proxy icon without delay. macOS\nversions older than Monterey always show the proxy icon.\n\nStates:\n\n- `FLOAT`: Sets the display of the proxy icon to FLOAT fractional seconds.\n- `off`: Sets the display of the proxy icon to default.\n- `on` Sets the display of the proxy icon to 0 seconds.\n- `[status]`: Shows the duration of the proxy icon display.\n- `toggle`: Toggles the display of the proxy icon.\n\nWhen displaying `status`, `-q` or `--query` can be used to suppress the output.\n\n#### `mac serialnumber`\n\nGets the serial number for the current macOS device.\n\n#### `mac touchid sudo`\n\nEnables or disables Touch ID support for `sudo`. Requires administrative\npermissions to edit `/etc/pam.d/sudo_local` and executes with `sudo`. If\n`pam_reattach` is installed, this will be managed as well.\n\nThe following states may be specified:\n\n- `off`: Disables Touch ID.\n- `on`: Enables Touch ID.\n- `[status]`: Shows the status of Touch ID.\n- `toggle`: Toggles the status of Touch ID.\n\n##### Notes\n\nIn v7 or later, `mac touchid sudo` only manages `/etc/pam.d/sudo_local`. It will\nhalt if either `pam_tid` or `pam_reattach` are present in `/etc/pam.d/sudo` or\nif `/etc/pam.d/sudo` does not include `sudo_local`.\n\n`/etc/pam.d/sudo_local` survives reboots and operating system upgrades, so as\nlong as the `pam_tid.so` and `pam_reattach.so` files are not missing or do not\nwork, nothing will be broken.\n\nIf something breaks while managing `/etc/pam.d/sudo_local`, recovery is easy:\n\n1. `open /etc/pam.d`\n2. Use ⌘⌫ in Finder on `sudo_local` to delete the file. Authenticate (possibly\n   with Touch ID), and everything is fixed.\n\n#### `mac transparency`\n\nEnables or disables interface transparency by setting the universal access\n\"reduce transparency\" setting.\n\nValid states are:\n\n- `off`: Disables interface transparency\n- `on`: Enables interface transparency\n- `[status]`: Shows the status of interface transparency\n- `toggle`: Toggles interface transparency\n\n#### `mac version`\n\nShows the current macOS version.\n\nOptions include:\n\n- `-s`, `--simple`: Removes spaces from the version displayed\n- `-l`, `--lowercase`: Converts the version to all lowercase\n- `-c`, `--comparable`: Outputs the comparable version value\n- `-v`, `--version`: Outputs the macOS version (same as\n  `sw_vers -productVersion`)'\n\n#### `mac vol`\n\nSet or show the Mac audio volume.\n\n### `manp`\n\nView a man page as a PDF via `Preview.app`. PDFs will be cached in\n`/private/tmp/man PDFs` by default, but this can be overridden with the\nuniversal variable `$manp_cache_path`. It will be opened with the default PDF\napplication by default unless `$manp_pdf_app_name` is set.\n\nThe cache can be cleared with `--clear-cache`.\n\n### `note`\n\nAdd a note to Notes.app.\n\n### `ql`\n\nQuick Look a file from the command-line.\n\n### `remind`\n\nAdd a note to Reminders.app.\n\n## Licence\n\n[MIT](./LICENCE.md)\n\n## Change Log\n\n[CHANGELOG](./CHANGELOG.md)\n\n## Contributing\n\n- [Contributing](./CONTRIBUTING.md)\n- [Contributors](./CONTRIBUTORS.md)\n- [Code of Conduct](./CODE_OF_CONDUCT.md)\n\n[version]: https://img.shields.io/github/tag/halostatue/fish-macos.svg?label=Version\n[fisher]: https://github.com/jorgebucaran/fisher\n[fish]: https://github.com/fish-shell/fish-shell\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhalostatue%2Ffish-macos","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhalostatue%2Ffish-macos","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhalostatue%2Ffish-macos/lists"}