mirror of
https://github.com/ivuorinen/dotfiles.git
synced 2026-01-27 22:41:02 +00:00
Compare commits
43 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| cbfc9049a1 | |||
| 12391d7757 | |||
| 10fd3862aa | |||
| 77b3173531 | |||
| e53a880e75 | |||
|
|
8efdde88a3 | ||
|
|
575a80ffff | ||
|
|
e86c137529 | ||
|
|
cb35b5eb62 | ||
|
|
0ae6b106b7 | ||
|
|
c61127abbe | ||
|
|
4b8a53f687 | ||
|
|
712187578f | ||
|
|
db4b663e64 | ||
| 6bb804ec7f | |||
|
|
892216a8fc | ||
|
|
a2a99445ff | ||
|
|
678466b898 | ||
| bd5eff8bce | |||
| 2979cc6cfc | |||
|
|
5630200d95 | ||
| 961efec364 | |||
| 4b0e38ffd2 | |||
|
|
c6ba0e4036 | ||
|
|
7b1ed2f596 | ||
|
|
82d48c8989 | ||
|
|
48f61fa917 | ||
|
|
abc3408609 | ||
|
|
8bef11095e | ||
| 7d427d29bb | |||
|
|
fd71a1ad32 | ||
|
|
277d47098f | ||
|
|
d35014ed2e | ||
|
|
8e7af8ddc7 | ||
| 099e6672c8 | |||
| e578e52aff | |||
|
|
0b5f80cb03 | ||
|
|
72f42835ff | ||
|
|
a949f0d4cf | ||
|
|
8b1e4462b3 | ||
|
|
055cf7ef2e | ||
|
|
8c2b3fb475 | ||
| 3fa1efe88d |
@@ -9,7 +9,7 @@ insert_final_newline = true
|
||||
trim_trailing_whitespace = true
|
||||
|
||||
[*.fish]
|
||||
max_line_length = 80
|
||||
max_line_length = 120
|
||||
|
||||
[*.md]
|
||||
max_line_length = 120
|
||||
@@ -49,3 +49,6 @@ ignore = true
|
||||
[plan]
|
||||
trim_trailing_whitespace = false
|
||||
max_line_length = off
|
||||
|
||||
[base/hammerspoon/hammerspoon.types.lua]
|
||||
max_line_length = off
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
{
|
||||
"extends": ["@ivuorinen"]
|
||||
}
|
||||
8
.github/dependabot.yml
vendored
8
.github/dependabot.yml
vendored
@@ -1,8 +0,0 @@
|
||||
---
|
||||
version: 2
|
||||
updates:
|
||||
# Maintain dependencies for GitHub Actions
|
||||
- package-ecosystem: 'github-actions'
|
||||
directory: '/'
|
||||
schedule:
|
||||
interval: 'weekly'
|
||||
8
.github/tag-changelog-config.js
vendored
8
.github/tag-changelog-config.js
vendored
@@ -16,10 +16,10 @@ module.exports = {
|
||||
|
||||
excludeTypes: [],
|
||||
|
||||
renderTypeSection: function (label, commits) {
|
||||
renderTypeSection: (label, commits) => {
|
||||
let text = `\n## ${label}\n\n`
|
||||
|
||||
commits.forEach(commit => {
|
||||
commits.forEach((commit) => {
|
||||
const scope = commit.scope ? `**${commit.scope}:** ` : ''
|
||||
text += `- ${scope}${commit.subject}\n`
|
||||
})
|
||||
@@ -27,10 +27,10 @@ module.exports = {
|
||||
return text
|
||||
},
|
||||
|
||||
renderChangelog: function (release, changes) {
|
||||
renderChangelog: (release, changes) => {
|
||||
const now = new Date()
|
||||
const d = now.toISOString().substring(0, 10)
|
||||
const header = `# ${release} - ${d}\n`
|
||||
return header + changes + '\n\n'
|
||||
return `${header}${changes}\n\n`
|
||||
},
|
||||
}
|
||||
|
||||
2
.github/workflows/changelog.yml
vendored
2
.github/workflows/changelog.yml
vendored
@@ -18,7 +18,7 @@ jobs:
|
||||
permissions: write-all
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
|
||||
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
|
||||
- name: Create changelog text
|
||||
id: changelog
|
||||
|
||||
4
.github/workflows/linters.yml
vendored
4
.github/workflows/linters.yml
vendored
@@ -27,7 +27,7 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
|
||||
- name: Yarn Lock Changes
|
||||
uses: Simek/yarn-lock-changes@61d1a0595070b79c1abdc8e1e5a5f5d98b18918c # v0.12.2
|
||||
@@ -35,4 +35,4 @@ jobs:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Run PR Lint
|
||||
uses: ivuorinen/actions/pr-lint@ff0ca4bc920c518b2ce2dc20c5e5a6e95f76dee0 # v2025.11.02
|
||||
uses: ivuorinen/actions/pr-lint@f98ae7cd7d0feb1f9d6b01de0addbb11414cfc73 # v2026.01.21
|
||||
|
||||
4
.github/workflows/new-release.yml
vendored
4
.github/workflows/new-release.yml
vendored
@@ -24,7 +24,7 @@ jobs:
|
||||
version: ${{ steps.daily-version.outputs.version }}
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
|
||||
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
|
||||
- name: Create tag if necessary
|
||||
uses: fregante/daily-version-action@fb1a60b7c4daf1410cd755e360ebec3901e58588 # v2.1.3
|
||||
@@ -40,7 +40,7 @@ jobs:
|
||||
|
||||
- name: Create release
|
||||
if: steps.daily-version.outputs.created
|
||||
uses: softprops/action-gh-release@5be0e66d93ac7ed76da52eca8bb058f665c3a5fe # v2.4.2
|
||||
uses: softprops/action-gh-release@a06a81a03ee405af7f2048a818ed3f03bbf83c7b # v2.5.0
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
tag_name: ${{ steps.daily-version.outputs.version }}
|
||||
|
||||
6
.github/workflows/pre-commit-autoupdate.yml
vendored
6
.github/workflows/pre-commit-autoupdate.yml
vendored
@@ -23,13 +23,13 @@ jobs:
|
||||
pull-requests: write
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
|
||||
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
|
||||
- uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0
|
||||
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
|
||||
|
||||
- run: pip install pre-commit && pre-commit autoupdate
|
||||
|
||||
- uses: peter-evans/create-pull-request@271a8d0340265f705b14b6d32b9829c1cb33d45e # v7.0.8
|
||||
- uses: peter-evans/create-pull-request@c0f553fe549906ede9cf27b5156039d195d2ece0 # v8.1.0
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
branch: update/pre-commit-hooks
|
||||
|
||||
2
.github/workflows/sync-labels.yml
vendored
2
.github/workflows/sync-labels.yml
vendored
@@ -29,4 +29,4 @@ jobs:
|
||||
issues: write
|
||||
|
||||
steps:
|
||||
- uses: ivuorinen/actions/sync-labels@ff0ca4bc920c518b2ce2dc20c5e5a6e95f76dee0 # v2025.11.02
|
||||
- uses: ivuorinen/actions/sync-labels@f98ae7cd7d0feb1f9d6b01de0addbb11414cfc73 # v2026.01.21
|
||||
|
||||
2
.github/workflows/update-submodules.yml
vendored
2
.github/workflows/update-submodules.yml
vendored
@@ -22,7 +22,7 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
with:
|
||||
submodules: true
|
||||
fetch-depth: 2
|
||||
|
||||
2
.gitignore
vendored
2
.gitignore
vendored
@@ -11,6 +11,7 @@
|
||||
.nfs*
|
||||
.scannerwork
|
||||
.vscode
|
||||
.yarn/
|
||||
!config/git/local.d/.gitkeep
|
||||
!config/nvim/spell/.gitkeep
|
||||
!config/zed/settings.json
|
||||
@@ -56,3 +57,4 @@ local/share/fonts/*
|
||||
lock
|
||||
node_modules
|
||||
ssh/local.d/*
|
||||
config/fish/fish_variables*
|
||||
|
||||
@@ -1 +1 @@
|
||||
1.25.4
|
||||
1.25.5
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
{
|
||||
"extends": "@ivuorinen/markdownlint-config",
|
||||
"code-block-style": {
|
||||
"style": "fenced"
|
||||
},
|
||||
"code-fence-style": {
|
||||
"style": "backtick"
|
||||
},
|
||||
"heading-style": {
|
||||
"style": "atx"
|
||||
},
|
||||
"no-duplicate-heading": {
|
||||
"siblings_only": true
|
||||
},
|
||||
"required-headings": false,
|
||||
"ul-style": {
|
||||
"style": "dash"
|
||||
}
|
||||
}
|
||||
@@ -16,12 +16,9 @@ SHOW_SKIPPED_LINTERS: false # Show skipped linters in MegaLinter log
|
||||
TYPESCRIPT_DEFAULT_STYLE: prettier # Default style for TypeScript
|
||||
DISABLE_LINTERS:
|
||||
- REPOSITORY_DEVSKIM
|
||||
- JAVASCRIPT_ES
|
||||
- JAVASCRIPT_ES # using biome
|
||||
- JAVASCRIPT_PRETTIER # using biome
|
||||
YAML_YAMLLINT_CONFIG_FILE: .yamllint.yml
|
||||
MARKDOWN_MARKDOWNLINT_CONFIG_FILE: .markdownlint.json
|
||||
JAVASCRIPT_ES_CONFIG_FILE: .eslintrc.json
|
||||
TYPESCRIPT_ES_CONFIG_FILE: .eslintrc.json
|
||||
REPOSITORY_GIT_DIFF_DISABLE_ERRORS: true
|
||||
FILTER_REGEX_EXCLUDE: >
|
||||
(node_modules|tools|config/cheat/cheatsheets/community|config/cheat/cheatsheets/tldr|config/fzf|config/zsh|config/tmux/plugins)
|
||||
|
||||
|
||||
@@ -20,22 +20,22 @@ repos:
|
||||
- id: end-of-file-fixer
|
||||
- id: mixed-line-ending
|
||||
args: [--fix=auto]
|
||||
- id: pretty-format-json
|
||||
args: [--autofix, --no-sort-keys]
|
||||
|
||||
- repo: https://github.com/igorshubovych/markdownlint-cli
|
||||
rev: v0.46.0
|
||||
- repo: local
|
||||
hooks:
|
||||
- id: markdownlint
|
||||
args: [-c, .markdownlint.json, --fix]
|
||||
- id: biome-check
|
||||
name: Biome Check
|
||||
entry: yarn biome check --write --files-ignore-unknown=true --no-errors-on-unmatched
|
||||
language: system
|
||||
files: \.(js|ts|jsx|tsx|json|md)$
|
||||
|
||||
- repo: https://github.com/adrienverge/yamllint
|
||||
rev: v1.37.1
|
||||
rev: v1.38.0
|
||||
hooks:
|
||||
- id: yamllint
|
||||
|
||||
- repo: https://github.com/koalaman/shellcheck-precommit
|
||||
rev: v0.11.0
|
||||
- repo: https://github.com/shellcheck-py/shellcheck-py
|
||||
rev: v0.11.0.1
|
||||
hooks:
|
||||
- id: shellcheck
|
||||
|
||||
@@ -45,19 +45,15 @@ repos:
|
||||
- id: shfmt
|
||||
|
||||
- repo: https://github.com/rhysd/actionlint
|
||||
rev: v1.7.9
|
||||
rev: v1.7.10
|
||||
hooks:
|
||||
- id: actionlint
|
||||
|
||||
- repo: https://github.com/renovatebot/pre-commit-hooks
|
||||
rev: 42.19.3
|
||||
hooks:
|
||||
- id: renovate-config-validator
|
||||
|
||||
- repo: https://github.com/JohnnyMorganz/StyLua
|
||||
rev: v2.3.1
|
||||
hooks:
|
||||
- id: stylua # or stylua-system / stylua-github
|
||||
exclude: hammerspoon\.types\.lua$
|
||||
|
||||
- repo: https://github.com/hugoh/pre-commit-fish.git
|
||||
rev: v1.2
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
# vim: ft=gitignore
|
||||
.mypy_cache/*
|
||||
Brewfile.lock.json
|
||||
base/plan
|
||||
config/cheat/cheatsheets/community
|
||||
config/cheat/cheatsheets/tldr
|
||||
config/fzf/*
|
||||
config/nvim/*
|
||||
config/op/plugins/used_plugins/*
|
||||
config/tmux/plugins/*
|
||||
config/zsh/*
|
||||
lazy-lock.json
|
||||
local/bin/antigen.zsh
|
||||
local/bin/asdf
|
||||
tools/antidote/*
|
||||
tools/dotbot*
|
||||
@@ -1,15 +0,0 @@
|
||||
module.exports = {
|
||||
...require('@ivuorinen/prettier-config'),
|
||||
trailingComma: 'all',
|
||||
// Add custom options below:
|
||||
overrides: [
|
||||
{
|
||||
files: '*.md',
|
||||
options: {
|
||||
printWidth: 120,
|
||||
proseWrap: 'preserve',
|
||||
tabWidth: 2,
|
||||
},
|
||||
},
|
||||
],
|
||||
}
|
||||
@@ -1 +1 @@
|
||||
3.14.0
|
||||
3.14.2
|
||||
|
||||
5
.sonarlint/connectedMode.json
Normal file
5
.sonarlint/connectedMode.json
Normal file
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"sonarCloudOrganization": "ivuorinen",
|
||||
"projectKey": "ivuorinen_dotfiles",
|
||||
"region": "EU"
|
||||
}
|
||||
1
.yarnrc.yml
Normal file
1
.yarnrc.yml
Normal file
@@ -0,0 +1 @@
|
||||
nodeLinker: node-modules
|
||||
@@ -2673,7 +2673,7 @@ function canvas:delete(fadeOutTime) end
|
||||
--- optionally return false to indicate that you do not wish to accept the item being dragged.
|
||||
--- "exit" - the user has moved the item out of the canvas; if the previous "enter" callback returned false, this
|
||||
--- message will also occur when the user finally releases the items being dragged.
|
||||
--- "receive" - indicates that the user has released the dragged object while it is still within the canvas frame.
|
||||
--- "receive" - indicates that the user has released the dragged object while it is still within the canvas frame.
|
||||
--- When your callback receives this message, you can optionally return false to indicate to the sending application
|
||||
--- that you do not want to accept the dragged item -- this may affect the animations provided by the sending
|
||||
--- application.
|
||||
@@ -2810,7 +2810,7 @@ function canvas:minimumTextSize(index, text) end
|
||||
--- element. The message will be "mouseDown".
|
||||
--- trackMouseUp - indicates that a callback should be invoked when a mouse button has been released over the canvas
|
||||
--- element. The message will be "mouseUp".
|
||||
--- trackMouseEnterExit - indicates that a callback should be invoked when the mouse pointer enters or exits the
|
||||
--- trackMouseEnterExit - indicates that a callback should be invoked when the mouse pointer enters or exits the
|
||||
--- canvas element. The message will be "mouseEnter" or "mouseExit".
|
||||
--- trackMouseMove - indicates that a callback should be invoked when the mouse pointer moves within the canvas
|
||||
--- element. The message will be "mouseMove".
|
||||
@@ -4197,7 +4197,7 @@ hs.drawing.windowLevels = nil
|
||||
--- hs.drawing
|
||||
--- for text drawing objects.
|
||||
---
|
||||
--- Note: This method returns the default font, size, color, and paragraphStyle used by hs.drawing for text objects.
|
||||
--- Note: This method returns the default font, size, color, and paragraphStyle used by hs.drawing for text objects.
|
||||
--- If you modify a drawing object's defaults with hs.drawing:setColor , hs.drawing:setTextFont , or
|
||||
--- hs.drawing:setTextSize , the changes will not be reflected by this function.
|
||||
---@return table
|
||||
@@ -4662,7 +4662,7 @@ hs.drawing.color.ansiTerminalColors = nil
|
||||
---@type table
|
||||
hs.drawing.color.hammerspoon = nil
|
||||
|
||||
--- A collection of colors representing the X11 color names as defined at
|
||||
--- A collection of colors representing the X11 color names as defined at
|
||||
--- https://en.wikipedia.org/wiki/Web_colors#X11_color_names (names in lowercase)
|
||||
---@type any
|
||||
hs.drawing.color.x11 = nil
|
||||
@@ -7022,7 +7022,7 @@ function hs.http.doAsyncRequest(url, method, data, headers, callback, cachePolic
|
||||
--- use the asynchronous functions.
|
||||
--- If you attempt to connect to a local Hammerspoon server created with hs.httpserver , then Hammerspoon will block
|
||||
--- until the connection times out (60 seconds), return a failed result due to the timeout, and then the hs.httpserver
|
||||
--- callback function will be invoked (so any side effects of the function will occur, but it's results will be lost).
|
||||
--- callback function will be invoked (so any side effects of the function will occur, but it's results will be lost).
|
||||
--- Use hs.http.doAsyncRequest to avoid this.
|
||||
--- If the Content-Type response header begins text/ then the response body return value is a UTF8 string. Any other
|
||||
--- content type passes the response body, unaltered, as a stream of bytes.
|
||||
@@ -7054,7 +7054,7 @@ function hs.http.encodeForQuery(string) end
|
||||
--- are encouraged to use the asynchronous functions
|
||||
--- If you attempt to connect to a local Hammerspoon server created with hs.httpserver , then Hammerspoon will block
|
||||
--- until the connection times out (60 seconds), return a failed result due to the timeout, and then the hs.httpserver
|
||||
--- callback function will be invoked (so any side effects of the function will occur, but it's results will be lost).
|
||||
--- callback function will be invoked (so any side effects of the function will occur, but it's results will be lost).
|
||||
--- Use hs.http.asyncGet to avoid this.
|
||||
---@param url string
|
||||
---@param headers table|nil
|
||||
@@ -7072,7 +7072,7 @@ function hs.http.get(url, headers) end
|
||||
--- are encouraged to use the asynchronous functions
|
||||
--- If you attempt to connect to a local Hammerspoon server created with hs.httpserver , then Hammerspoon will block
|
||||
--- until the connection times out (60 seconds), return a failed result due to the timeout, and then the hs.httpserver
|
||||
--- callback function will be invoked (so any side effects of the function will occur, but it's results will be lost).
|
||||
--- callback function will be invoked (so any side effects of the function will occur, but it's results will be lost).
|
||||
--- Use hs.http.asyncPost to avoid this.
|
||||
---@param url string
|
||||
---@param data string|nil
|
||||
@@ -7091,7 +7091,7 @@ function hs.http.post(url, data, headers) end
|
||||
--- are encouraged to use the asynchronous functions
|
||||
--- If you attempt to connect to a local Hammerspoon server created with hs.httpserver , then Hammerspoon will block
|
||||
--- until the connection times out (60 seconds), return a failed result due to the timeout, and then the hs.httpserver
|
||||
--- callback function will be invoked (so any side effects of the function will occur, but it's results will be lost).
|
||||
--- callback function will be invoked (so any side effects of the function will occur, but it's results will be lost).
|
||||
--- Use hs.http.asyncPost to avoid this.
|
||||
---@param url string
|
||||
---@param data string|nil
|
||||
@@ -7374,7 +7374,7 @@ function hs.httpserver.hsminweb.new(documentRoot) end
|
||||
--- Get or set the access-list table for the hsminweb web server
|
||||
---
|
||||
--- Note: The access-list feature works by comparing the request headers against a list of tests which either accept or
|
||||
--- reject the request. If no access list is set (i.e. it is assigned a value of nil ), then all requests are served.
|
||||
--- reject the request. If no access list is set (i.e. it is assigned a value of nil ), then all requests are served.
|
||||
--- If a table is passed into this method, then any request which is not explicitly accepted by one of the tests
|
||||
--- provided is rejected (i.e. there is an implicit "reject" at the end of the list).
|
||||
--- The access-list table is a list of tests which are evaluated in order. The first test which matches a given
|
||||
@@ -7919,7 +7919,7 @@ function hs.httpserver.hsminweb.cgilua.urlcode.insertfield(table, key, value) en
|
||||
--- Parse the query string and store the key-value pairs in the provided table.
|
||||
---
|
||||
--- Note: The specification allows for the same key to be assigned multiple values in an encoded string, but does not
|
||||
--- specify the behavior; by convention, web servers assign these multiple values to the same key in an array (table).
|
||||
--- specify the behavior; by convention, web servers assign these multiple values to the same key in an array (table).
|
||||
--- This function follows that convention. This is most commonly used by forms which allow selecting multiple options
|
||||
--- via check boxes or in a selection list.
|
||||
--- This function uses cgilua.urlcode.insertfield to build the key-value table.
|
||||
@@ -10225,7 +10225,7 @@ function echorequest:seeAllUnexpectedPackets(state) end
|
||||
--- Sends a single ICMP Echo Request packet.
|
||||
---
|
||||
--- Note: By convention, unless you are trying to test for specific network fragmentation or congestion problems, ICMP
|
||||
--- Echo Requests are generally 64 bytes in length (this includes the 8 byte header, giving 56 bytes of payload data).
|
||||
--- Echo Requests are generally 64 bytes in length (this includes the 8 byte header, giving 56 bytes of payload data).
|
||||
--- If you do not specify a payload, a default payload which will result in a packet size of 64 bytes is constructed.
|
||||
---@param payload string|nil
|
||||
---@return echoRequestObject|boolean|nil
|
||||
@@ -15169,7 +15169,7 @@ function watcher:stop() end
|
||||
---@class hs.utf8
|
||||
hs.utf8 = {}
|
||||
|
||||
--- A collection of UTF-8 characters already converted from codepoint and available as convenient key-value pairs.
|
||||
--- A collection of UTF-8 characters already converted from codepoint and available as convenient key-value pairs.
|
||||
--- UTF-8 printable versions of common Apple and OS X special keys are predefined and others can be added with
|
||||
--- hs.utf8.registerCodepoint(label, codepoint)
|
||||
--- for your own use.
|
||||
@@ -15238,7 +15238,7 @@ function hs.utf8.hexDump(inputString, count) end
|
||||
--- hs.utf8.registeredKeys[label]
|
||||
--- for convenience and readability.
|
||||
---
|
||||
--- Note: If a codepoint label was previously registered, this will overwrite the previous value with a new one.
|
||||
--- Note: If a codepoint label was previously registered, this will overwrite the previous value with a new one.
|
||||
--- Because many of the special keys you may want to register have different variants, this allows you to easily modify
|
||||
--- the existing predefined defaults to suite your preferences.
|
||||
--- The return value is merely syntactic sugar and you do not need to save it locally; it can be safely ignored --
|
||||
@@ -15585,13 +15585,13 @@ function hs.webview.newBrowser(rect, preferencesTable, userContentController) en
|
||||
---@return webviewObject
|
||||
function webview:allowGestures(value) end
|
||||
|
||||
--- Get or set whether or not the webview will respond to magnification gestures from a trackpad or magic mouse.
|
||||
--- Get or set whether or not the webview will respond to magnification gestures from a trackpad or magic mouse.
|
||||
--- Default is false.
|
||||
---@param value any
|
||||
---@return webviewObject
|
||||
function webview:allowMagnificationGestures(value) end
|
||||
|
||||
--- Get or set whether or not the webview will respond to the navigation gestures from a trackpad or magic mouse.
|
||||
--- Get or set whether or not the webview will respond to the navigation gestures from a trackpad or magic mouse.
|
||||
--- Default is false.
|
||||
---@param value any
|
||||
---@return webviewObject
|
||||
@@ -16455,7 +16455,7 @@ function usercontent:removeAllScripts() end
|
||||
--- } catch(err) {
|
||||
--- console.log('The controller does not exist yet');
|
||||
--- }
|
||||
--- Where name matches the name specified in the constructor and message-object is the object to post to the function.
|
||||
--- Where name matches the name specified in the constructor and message-object is the object to post to the function.
|
||||
--- This object can be a number, string, date, array, dictionary(table), or nil.
|
||||
---@param fn function
|
||||
---@return usercontentControllerObject
|
||||
@@ -17860,4 +17860,4 @@ hs.window.tiling = {}
|
||||
---@param preserveRelativeArea? any
|
||||
---@param animationDuration? hs.window.animationDuration|nil
|
||||
---@return any
|
||||
function hs.window.tiling.tileWindows(windows, rect, desiredAspect, processInOrder, preserveRelativeArea, animationDuration) end
|
||||
function hs.window.tiling.tileWindows(windows, rect, desiredAspect, processInOrder, preserveRelativeArea, animationDuration) end
|
||||
|
||||
@@ -193,11 +193,12 @@ end)
|
||||
|
||||
-- Paste 1Password secret with Meh + P
|
||||
f18:bind({}, 'p', function()
|
||||
local output, status = hs.execute('op read "op://Svea/3hzhctmvovbwlgulv7mgy25rf4/login-input"', true)
|
||||
local output, status =
|
||||
hs.execute('op read "op://Svea/3hzhctmvovbwlgulv7mgy25rf4/login-input"', true)
|
||||
if status then
|
||||
hs.eventtap.keyStrokes(output:gsub('%s+$', '')) -- trim trailing whitespace
|
||||
else
|
||||
hs.alert.show('1Password CLI error')
|
||||
hs.alert.show '1Password CLI error'
|
||||
end
|
||||
end)
|
||||
|
||||
|
||||
103
biome.json
Normal file
103
biome.json
Normal file
@@ -0,0 +1,103 @@
|
||||
{
|
||||
"$schema": "https://biomejs.dev/schemas/2.3.1/schema.json",
|
||||
"vcs": {
|
||||
"enabled": true,
|
||||
"clientKind": "git",
|
||||
"useIgnoreFile": true,
|
||||
"defaultBranch": "main"
|
||||
},
|
||||
"files": {
|
||||
"ignoreUnknown": true,
|
||||
"includes": [
|
||||
"**",
|
||||
"!!**/.mypy_cache",
|
||||
"!!**/Brewfile.lock.json",
|
||||
"!!**/base/plan",
|
||||
"!!**/config/cheat/cheatsheets/community",
|
||||
"!!**/config/cheat/cheatsheets/tldr",
|
||||
"!!**/config/fzf",
|
||||
"!!**/config/nvim",
|
||||
"!!**/config/op/plugins/used_plugins",
|
||||
"!!**/config/tmux/plugins",
|
||||
"!!**/config/zsh",
|
||||
"!!**/config/vim",
|
||||
"!!**/lazy-lock.json",
|
||||
"!!**/local/bin/antigen.zsh",
|
||||
"!!**/local/bin/asdf",
|
||||
"!!**/tools/antidote",
|
||||
"!!**/tools/dotbot",
|
||||
"!!**/node_modules"
|
||||
]
|
||||
},
|
||||
"formatter": {
|
||||
"enabled": true,
|
||||
"formatWithErrors": false,
|
||||
"indentStyle": "space",
|
||||
"indentWidth": 2,
|
||||
"lineEnding": "lf",
|
||||
"lineWidth": 80
|
||||
},
|
||||
"linter": {
|
||||
"enabled": true,
|
||||
"rules": {
|
||||
"recommended": true,
|
||||
"correctness": {
|
||||
"noUnusedVariables": "warn",
|
||||
"noUnusedImports": "warn"
|
||||
},
|
||||
"style": {
|
||||
"useConst": "warn",
|
||||
"useTemplate": "warn"
|
||||
},
|
||||
"suspicious": {
|
||||
"noExplicitAny": "warn",
|
||||
"noConsole": "off"
|
||||
}
|
||||
}
|
||||
},
|
||||
"javascript": {
|
||||
"formatter": {
|
||||
"enabled": true,
|
||||
"quoteStyle": "single",
|
||||
"jsxQuoteStyle": "double",
|
||||
"trailingCommas": "all",
|
||||
"semicolons": "asNeeded",
|
||||
"arrowParentheses": "always",
|
||||
"bracketSpacing": true,
|
||||
"bracketSameLine": false,
|
||||
"quoteProperties": "asNeeded",
|
||||
"indentStyle": "space",
|
||||
"indentWidth": 2
|
||||
}
|
||||
},
|
||||
"json": {
|
||||
"parser": {
|
||||
"allowComments": true,
|
||||
"allowTrailingCommas": false
|
||||
},
|
||||
"formatter": {
|
||||
"enabled": true,
|
||||
"indentStyle": "space",
|
||||
"indentWidth": 2,
|
||||
"lineWidth": 80
|
||||
}
|
||||
},
|
||||
"overrides": [
|
||||
{
|
||||
"includes": ["*.md", "*.mdx"],
|
||||
"formatter": {
|
||||
"enabled": true,
|
||||
"lineWidth": 120
|
||||
}
|
||||
},
|
||||
{
|
||||
"includes": ["package.json"],
|
||||
"json": {
|
||||
"formatter": {
|
||||
"enabled": true,
|
||||
"indentWidth": 2
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1,8 +1,3 @@
|
||||
import = [
|
||||
# Default to night if the copied one doesn't exist.
|
||||
"~/.dotfiles/config/alacritty/theme-night.toml",
|
||||
"~/.config/alacritty/theme-active.toml"
|
||||
]
|
||||
|
||||
[env]
|
||||
TERM = "xterm-256color"
|
||||
@@ -50,3 +45,10 @@ lines = 75
|
||||
[window.padding]
|
||||
x = 5
|
||||
y = 5
|
||||
|
||||
[general]
|
||||
import = [
|
||||
# Default to night if the copied one doesn't exist.
|
||||
"~/.dotfiles/config/alacritty/theme-night.toml",
|
||||
"~/.config/alacritty/theme-active.toml"
|
||||
]
|
||||
|
||||
@@ -6,21 +6,19 @@
|
||||
*
|
||||
* @param {Object} windows - All windows in the current space.
|
||||
* @param {Object} screenFrame - The frame of the current screen.
|
||||
* @param {Object} state - The state of the current space.
|
||||
* @param {Object} extendedFrames - The frames of the windows in the current space.
|
||||
* @return {Object} - The frames for the windows in the current space.
|
||||
*/
|
||||
function layout() {
|
||||
return {
|
||||
name: 'Almost Maximize',
|
||||
getFrameAssignments: (windows, screenFrame, state, extendedFrames) => {
|
||||
getFrameAssignments: (windows, screenFrame) => {
|
||||
const width = screenFrame.width * 0.95
|
||||
const height = screenFrame.height * 0.95
|
||||
const x = (screenFrame.width - width) / 2
|
||||
const y = (screenFrame.height - height) / 2
|
||||
const windowFrames = {}
|
||||
|
||||
windows.forEach(window => {
|
||||
windows.forEach((window) => {
|
||||
windowFrames[window.id] = {
|
||||
Y: screenFrame.y + y,
|
||||
x: screenFrame.x + x,
|
||||
@@ -33,3 +31,5 @@ function layout() {
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = layout()
|
||||
|
||||
@@ -23,5 +23,7 @@ github.com/junegunn/fzf@latest
|
||||
golang.org/x/tools/gopls@latest
|
||||
// A language for writing HTML user interfaces in Go.
|
||||
github.com/a-h/templ/cmd/templ@latest
|
||||
// A tool for glamorous shell scripts 🎀
|
||||
github.com/charmbracelet/gum@latest
|
||||
// A terminal session manager
|
||||
github.com/joshmedeski/sesh/v2@latest
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
# This file is secret and wont be added to the git repo.
|
||||
|
||||
export GITLAB_API_TOKEN=""
|
||||
|
||||
@@ -1,71 +0,0 @@
|
||||
# @halostatue/fish-macos/completions/app.fish:v7.0.1
|
||||
|
||||
complete --command app --erase
|
||||
|
||||
complete --command app --arguments bundleid \
|
||||
--exclusive --condition __fish_use_subcommand \
|
||||
--description 'Show bundle IDs for macOS apps'
|
||||
|
||||
complete --command app --arguments find \
|
||||
--exclusive --condition __fish_use_subcommand \
|
||||
--description 'Find macOS apps by pattern'
|
||||
|
||||
complete --command app --arguments frontmost \
|
||||
--exclusive --condition __fish_use_subcommand \
|
||||
--description 'Shows the front-most application'
|
||||
|
||||
complete --command app --arguments icon \
|
||||
--exclusive --condition __fish_use_subcommand \
|
||||
--description 'Extracts a MacOS app icon as a png file'
|
||||
|
||||
complete --command app --arguments quit \
|
||||
--exclusive --condition __fish_use_subcommand \
|
||||
--description 'Quit macOS apps by pattern'
|
||||
|
||||
for subcommand in bundleid find
|
||||
complete --command app --condition '__fish_seen_subcommand_from '$subcommand \
|
||||
--short-option x --long-option exact --description 'Exact matches only'
|
||||
|
||||
complete --command app --condition '__fish_seen_subcommand_from '$subcommand \
|
||||
--short-option a --long-option all --description 'Show all matches'
|
||||
|
||||
complete --command app --condition '__fish_seen_subcommand_from '$subcommand \
|
||||
--short-option q --long-option quiet --description 'Quiet (show no output)'
|
||||
|
||||
complete --command app --condition '__fish_seen_subcommand_from '$subcommand \
|
||||
--short-option h --long-option help --description 'Help for app '$subcommand
|
||||
end
|
||||
|
||||
complete --command app --condition '__fish_seen_subcommand_from 'bundleid \
|
||||
--short-option s --long-option short --description 'Show only the bundle ID'
|
||||
|
||||
complete --command app --condition '__fish_seen_subcommand_from 'frontmost \
|
||||
--short-option b --long-option bundle-id --description 'Shows the app bundle ID'
|
||||
complete --command app --condition '__fish_seen_subcommand_from 'frontmost \
|
||||
--short-option p --long-option path --description 'Shows the app path'
|
||||
complete --command app --condition '__fish_seen_subcommand_from 'frontmost \
|
||||
--short-option n --long-option name --description 'Shows the app name'
|
||||
complete --command app --condition '__fish_seen_subcommand_from 'frontmost \
|
||||
--short-option P --long-option pid --description 'Shows the PID of the app'
|
||||
complete --command app --condition '__fish_seen_subcommand_from 'frontmost \
|
||||
--short-option a --long-option all --description 'Shows all details'
|
||||
complete --command app --condition '__fish_seen_subcommand_from 'frontmost \
|
||||
--short-option h --long-option help --description 'Help for app 'frontmost
|
||||
|
||||
complete --command app --condition '__fish_seen_subcommand_from 'icon \
|
||||
--short-option x --long-option exact --description 'Exact matches only'
|
||||
complete --command app --condition '__fish_seen_subcommand_from 'icon \
|
||||
--short-option o --long-option output --description 'Extracts to this file or directory' \
|
||||
--force-files
|
||||
complete --command app --condition '__fish_seen_subcommand_from 'icon \
|
||||
--short-option w --long-option width --description 'Uses this pixel width' \
|
||||
--no-files
|
||||
complete --command app --condition '__fish_seen_subcommand_from 'icon \
|
||||
--short-option h --long-option help --description 'Help for app 'icon
|
||||
|
||||
complete --command app --condition '__fish_seen_subcommand_from 'quit \
|
||||
--short-option x --long-option exact --description 'Exact matches only'
|
||||
complete --command app --condition '__fish_seen_subcommand_from 'quit \
|
||||
--short-option r --long-option restart --description 'Restart after quit'
|
||||
complete --command app --condition '__fish_seen_subcommand_from 'quit \
|
||||
--short-option h --long-option help --description 'Help for app 'quit
|
||||
0
config/fish/completions/docker.fish
Executable file → Normal file
0
config/fish/completions/docker.fish
Executable file → Normal file
@@ -1,70 +0,0 @@
|
||||
# @halostatue/fish-macos/completions/finder.fish:v7.0.1
|
||||
|
||||
complete --command finder --erase
|
||||
|
||||
complete --command finder --arguments track \
|
||||
--exclusive --condition __fish_use_subcommand \
|
||||
--description 'Enables Finder PWD tracking'
|
||||
complete --command finder --arguments untrack \
|
||||
--exclusive --condition __fish_use_subcommand \
|
||||
--description 'Disables Finder PWD tracking'
|
||||
complete --command finder --arguments pwd \
|
||||
--exclusive --condition __fish_use_subcommand \
|
||||
--description 'Prints the path of the Finder window'
|
||||
complete --command finder --arguments cd \
|
||||
--exclusive --condition __fish_use_subcommand \
|
||||
--description 'Changes to the path of the Finder window'
|
||||
complete --command finder --arguments pushd \
|
||||
--exclusive --condition __fish_use_subcommand \
|
||||
--description 'Pushes to the path of the Finder window'
|
||||
complete --command finder --arguments update \
|
||||
--exclusive --condition __fish_use_subcommand \
|
||||
--description 'Updates the Finder to PWD'
|
||||
complete --command finder --arguments list \
|
||||
--exclusive --condition __fish_use_subcommand \
|
||||
--description 'Sets Finder to list view with PWD'
|
||||
complete --command finder --arguments icon \
|
||||
--exclusive --condition __fish_use_subcommand \
|
||||
--description 'Sets Finder to icon view with PWD'
|
||||
complete --command finder --arguments column \
|
||||
--exclusive --condition __fish_use_subcommand \
|
||||
--description 'Sets Finder to column view with PWD'
|
||||
complete --command finder --arguments hidden \
|
||||
--exclusive --condition __fish_use_subcommand \
|
||||
--description 'Shows or hides `hidden` files'
|
||||
complete --command finder --arguments desktop-icons \
|
||||
--exclusive --condition __fish_use_subcommand \
|
||||
--description 'Shows or hides desktop icons'
|
||||
complete --command finder --arguments clean \
|
||||
--exclusive --condition __fish_use_subcommand \
|
||||
--description 'Cleans .DS_Store files'
|
||||
complete --command finder --arguments quarantine \
|
||||
--exclusive --condition __fish_use_subcommand \
|
||||
--description 'Works with file quarantine data'
|
||||
complete --command finder --arguments selected \
|
||||
--exclusive --condition __fish_use_subcommand \
|
||||
--description 'Print Finder selected files'
|
||||
|
||||
for subcommand in cd clean column desktop-icons hidden icon list pushd pwd quarantine selected track untrack update
|
||||
complete --command finder --condition '__fish_seen_subcommand_from '$subcommand \
|
||||
--short-option h --long-option help --description 'Help for finder '$subcommand
|
||||
end
|
||||
|
||||
for subcommand in hidden desktop-icons
|
||||
complete --command finder --condition '__fish_seen_subcommand_from '$subcommand \
|
||||
--arguments off --description 'Turns '$subcommand' off'
|
||||
complete --command finder --condition '__fish_seen_subcommand_from '$subcommand \
|
||||
--arguments on --description 'Turns '$subcommand' on'
|
||||
complete --command finder --condition '__fish_seen_subcommand_from '$subcommand \
|
||||
--arguments toggle --description 'Toggles '$subcommand
|
||||
complete --command finder --condition '__fish_seen_subcommand_from '$subcommand \
|
||||
--arguments status --description 'Shows the status of '$subcommand
|
||||
end
|
||||
|
||||
complete --command finder --condition '__fish_seen_subcommand_from 'quarantine \
|
||||
--arguments show --description 'Shows quarantine events'
|
||||
complete --command finder --condition '__fish_seen_subcommand_from 'quarantine \
|
||||
--arguments clear --description 'Clears all quarantine events'
|
||||
complete --command finder --condition '__fish_seen_subcommand_from 'quarantine \
|
||||
--arguments clean --description 'Removes 'quarantine' attributes from files' \
|
||||
--require-parameter --force-files
|
||||
@@ -1,8 +0,0 @@
|
||||
complete fzf_configure_bindings --no-files
|
||||
complete fzf_configure_bindings --long help --short h --description "Print help" --condition "not __fish_seen_argument --help -h"
|
||||
complete fzf_configure_bindings --long directory --description "Change the key binding for Search Directory" --condition "not __fish_seen_argument --directory"
|
||||
complete fzf_configure_bindings --long git_log --description "Change the key binding for Search Git Log" --condition "not __fish_seen_argument --git_log"
|
||||
complete fzf_configure_bindings --long git_status --description "Change the key binding for Search Git Status" --condition "not __fish_seen_argument --git_status"
|
||||
complete fzf_configure_bindings --long history --description "Change the key binding for Search History" --condition "not __fish_seen_argument --history"
|
||||
complete fzf_configure_bindings --long processes --description "Change the key binding for Search Processes" --condition "not __fish_seen_argument --processes"
|
||||
complete fzf_configure_bindings --long variables --description "Change the key binding for Search Variables" --condition "not __fish_seen_argument --variables"
|
||||
@@ -1,117 +0,0 @@
|
||||
# @halostatue/fish-macos/completions/mac.fish:v7.0.1
|
||||
|
||||
complete --command mac --erase
|
||||
|
||||
complete --command mac --arguments airdrop \
|
||||
--exclusive --condition __fish_use_subcommand \
|
||||
--description 'Changes AirDrop settings'
|
||||
complete --command mac --arguments airport \
|
||||
--exclusive --condition __fish_use_subcommand \
|
||||
--description 'Work with AirPort (WiFi) settings'
|
||||
complete --command mac --arguments brightness \
|
||||
--exclusive --condition __fish_use_subcommand \
|
||||
--description 'Adjust the screen brightness level'
|
||||
complete --command mac --arguments flushdns \
|
||||
--exclusive --condition __fish_use_subcommand \
|
||||
--description 'Flushes DNS'
|
||||
complete --command mac --arguments font-smoothing \
|
||||
--exclusive --condition __fish_use_subcommand \
|
||||
--description 'Manages font smoothing settings'
|
||||
complete --command mac --arguments lsclean \
|
||||
--exclusive --condition __fish_use_subcommand \
|
||||
--description 'Cleans LaunchServices to remove duplicate Open with... entries'
|
||||
complete --command mac --arguments mail \
|
||||
--exclusive --condition __fish_use_subcommand \
|
||||
--description 'Manage various operations of Mail.app'
|
||||
complete --command mac --arguments proxy-icon \
|
||||
--exclusive --condition __fish_use_subcommand \
|
||||
--description 'Manage proxy icon appearance delay'
|
||||
complete --command mac --arguments transparency \
|
||||
--exclusive --condition __fish_use_subcommand \
|
||||
--description 'Manage UI transparency'
|
||||
complete --command mac --arguments vol \
|
||||
--exclusive --condition __fish_use_subcommand \
|
||||
--description 'Changes Mac volume; accepts 0–100 volume percentage'
|
||||
|
||||
for subcommand in airdrop airport brightness flushdns font-smoothing lsclean mail proxy-icon transparency version vol
|
||||
complete --command mac --condition '__fish_seen_subcommand_from '$subcommand \
|
||||
--short-option h --long-option help --description 'Help for mac '$subcommand
|
||||
end
|
||||
|
||||
complete --command mac --condition '__fish_seen_subcommand_from brightness' \
|
||||
--arguments up --description 'Increases screen brightness'
|
||||
complete --command mac --condition '__fish_seen_subcommand_from brightness' \
|
||||
--arguments down --description 'Decreases screen brightness'
|
||||
|
||||
for subcommand in airdrop proxy-icon transparency
|
||||
complete --command mac --condition '__fish_seen_subcommand_from '$subcommand \
|
||||
--arguments on --description 'Enables '$subcommand
|
||||
complete --command mac --condition '__fish_seen_subcommand_from '$subcommand \
|
||||
--arguments off --description 'Disables '$subcommand
|
||||
complete --command mac --condition '__fish_seen_subcommand_from '$subcommand \
|
||||
--arguments toggle --description 'Toggles '$subcommand
|
||||
complete --command mac --condition '__fish_seen_subcommand_from '$subcommand \
|
||||
--arguments status --description 'Shows the status of '$subcommand
|
||||
end
|
||||
|
||||
complete --command mac --condition '__fish_seen_subcommand_from 'airport \
|
||||
--arguments scan --description 'Shows available networks'
|
||||
complete --command mac --condition '__fish_seen_subcommand_from 'airport \
|
||||
--arguments ssid --description 'Shows the SSID'
|
||||
complete --command mac --condition '__fish_seen_subcommand_from 'airport \
|
||||
--arguments password --description 'Gets the current WiFi network password'
|
||||
|
||||
complete --command mac --condition '__fish_seen_subcommand_from 'font-smoothing \
|
||||
--arguments on --description 'Enables font smoothing; app IDs can be provided to limit control'
|
||||
complete --command mac --condition '__fish_seen_subcommand_from 'font-smoothing \
|
||||
--arguments off --description 'Disables font smoothing; app IDs can be provided to limit control'
|
||||
|
||||
complete --command mac --condition '__fish_seen_subcommand_from 'mail \
|
||||
--arguments vacuum --description 'Vacuums the Mail.app envelope index'
|
||||
complete --command mac --condition '__fish_seen_subcommand_from 'mail \
|
||||
--arguments attachments --description 'Sets Mail.app attachment handling' \
|
||||
--require-parameter --no-files
|
||||
complete --command mac --condition '__fish_seen_subcommand_from 'attachments \
|
||||
--arguments inline \
|
||||
--description 'Sets Mail.app attachment handling so that they are inline to the message'
|
||||
complete --command mac --condition '__fish_seen_subcommand_from 'attachments \
|
||||
--arguments icon \
|
||||
--description 'Sets Mail.app attachment handling so that they are icons on the message'
|
||||
|
||||
complete --command mac --condition '__fish_seen_subcommand_from 'version \
|
||||
--short-option s --long-option simple --description 'Simple mac version name'
|
||||
complete --command mac --condition '__fish_seen_subcommand_from 'version \
|
||||
--short-option l --long-option lowercase --description 'Lowercase mac version name'
|
||||
complete --command mac --condition '__fish_seen_subcommand_from 'version \
|
||||
--short-option f --long-option version --description 'Full version number'
|
||||
complete --command mac --condition '__fish_seen_subcommand_from 'version \
|
||||
--short-option c --long-option comparable --description 'Simplified comparable version value'
|
||||
complete --command mac --condition '__fish_seen_subcommand_from 'version \
|
||||
--short-option h --long-option help --description 'Help for mac 'version
|
||||
|
||||
complete --command mac --condition '__fish_seen_subcommand_from 'vol \
|
||||
--arguments mute --description 'Mutes volume'
|
||||
complete --command mac --condition '__fish_seen_subcommand_from 'vol \
|
||||
--arguments unmute --description 'Unmutes volume'
|
||||
complete --command mac --condition '__fish_seen_subcommand_from 'vol \
|
||||
--arguments show --description 'Shows the current volume'
|
||||
complete --command mac --condition '__fish_seen_subcommand_from 'vol \
|
||||
--arguments 10 --description 'Sets the volume to 10%'
|
||||
complete --command mac --condition '__fish_seen_subcommand_from 'vol \
|
||||
--arguments 20 --description 'Sets the volume to 20%'
|
||||
complete --command mac --condition '__fish_seen_subcommand_from 'vol \
|
||||
--arguments 30 --description 'Sets the volume to 30%'
|
||||
complete --command mac --condition '__fish_seen_subcommand_from 'vol \
|
||||
--arguments 40 --description 'Sets the volume to 40%'
|
||||
complete --command mac --condition '__fish_seen_subcommand_from 'vol \
|
||||
--arguments 50 --description 'Sets the volume to 50%'
|
||||
complete --command mac --condition '__fish_seen_subcommand_from 'vol \
|
||||
--arguments 60 --description 'Sets the volume to 60%'
|
||||
complete --command mac --condition '__fish_seen_subcommand_from 'vol \
|
||||
--arguments 70 --description 'Sets the volume to 70%'
|
||||
complete --command mac --condition '__fish_seen_subcommand_from 'vol \
|
||||
--arguments 80 --description 'Sets the volume to 80%'
|
||||
complete --command mac --condition '__fish_seen_subcommand_from 'vol \
|
||||
--arguments 90 --description 'Sets the volume to 90%'
|
||||
complete --command mac --condition '__fish_seen_subcommand_from 'vol \
|
||||
--arguments 100 --description 'Sets the volume to 100%'
|
||||
@@ -1,8 +0,0 @@
|
||||
# @halostatue/fish-macos/completions/manp.fish:v7.0.1
|
||||
|
||||
complete --command manp --erase
|
||||
complete --command manp --wraps man
|
||||
complete --command manp --exclusive --condition __fish_no_arguments \
|
||||
--short-option h --long-option help --description 'Show help for manp'
|
||||
complete --command manp --exclusive --condition __fish_no_arguments \
|
||||
--long-option clear-cache --description 'Clear the man page PDF cache'
|
||||
@@ -2,21 +2,21 @@
|
||||
# Place in ~/.config/fish/completions/phpenv.fish
|
||||
|
||||
# Complete main commands
|
||||
complete -c phpenv -f -n __fish_use_subcommand -a install -d "Install a PHP version"
|
||||
complete -c phpenv -f -n __fish_use_subcommand -a uninstall -d "Uninstall a PHP version"
|
||||
complete -c phpenv -f -n __fish_use_subcommand -a use -d "Use PHP version for current shell"
|
||||
complete -c phpenv -f -n __fish_use_subcommand -a local -d "Set PHP version for current project"
|
||||
complete -c phpenv -f -n __fish_use_subcommand -a global -d "Set global PHP version"
|
||||
complete -c phpenv -f -n __fish_use_subcommand -a list -d "List installed PHP versions"
|
||||
complete -c phpenv -f -n __fish_use_subcommand -a ls -d "List installed PHP versions"
|
||||
complete -c phpenv -f -n __fish_use_subcommand -a current -d "Show current PHP version"
|
||||
complete -c phpenv -f -n __fish_use_subcommand -a which -d "Show path to PHP binary"
|
||||
complete -c phpenv -f -n __fish_use_subcommand -a versions -d "Show all available versions"
|
||||
complete -c phpenv -f -n __fish_use_subcommand -a doctor -d "Check phpenv installation"
|
||||
complete -c phpenv -f -n __fish_use_subcommand -a config -d "Manage configuration"
|
||||
complete -c phpenv -f -n __fish_use_subcommand -a extensions -d "Manage PHP extensions"
|
||||
complete -c phpenv -f -n __fish_use_subcommand -a ext -d "Manage PHP extensions"
|
||||
complete -c phpenv -f -n __fish_use_subcommand -a help -d "Show help"
|
||||
complete -c phpenv -f -n "__fish_use_subcommand" -a "install" -d "Install a PHP version"
|
||||
complete -c phpenv -f -n "__fish_use_subcommand" -a "uninstall" -d "Uninstall a PHP version"
|
||||
complete -c phpenv -f -n "__fish_use_subcommand" -a "use" -d "Use PHP version for current shell"
|
||||
complete -c phpenv -f -n "__fish_use_subcommand" -a "local" -d "Set PHP version for current project"
|
||||
complete -c phpenv -f -n "__fish_use_subcommand" -a "global" -d "Set global PHP version"
|
||||
complete -c phpenv -f -n "__fish_use_subcommand" -a "list" -d "List installed PHP versions"
|
||||
complete -c phpenv -f -n "__fish_use_subcommand" -a "ls" -d "List installed PHP versions"
|
||||
complete -c phpenv -f -n "__fish_use_subcommand" -a "current" -d "Show current PHP version"
|
||||
complete -c phpenv -f -n "__fish_use_subcommand" -a "which" -d "Show path to PHP binary"
|
||||
complete -c phpenv -f -n "__fish_use_subcommand" -a "versions" -d "Show all available versions"
|
||||
complete -c phpenv -f -n "__fish_use_subcommand" -a "doctor" -d "Check phpenv installation"
|
||||
complete -c phpenv -f -n "__fish_use_subcommand" -a "config" -d "Manage configuration"
|
||||
complete -c phpenv -f -n "__fish_use_subcommand" -a "extensions" -d "Manage PHP extensions"
|
||||
complete -c phpenv -f -n "__fish_use_subcommand" -a "ext" -d "Manage PHP extensions"
|
||||
complete -c phpenv -f -n "__fish_use_subcommand" -a "help" -d "Show help"
|
||||
|
||||
# Helper functions for completions
|
||||
function __phpenv_complete_installed_versions
|
||||
@@ -26,13 +26,13 @@ end
|
||||
function __phpenv_complete_available_versions
|
||||
# Try to get dynamic versions first
|
||||
if command -q curl -a command -q jq; and functions -q __phpenv_parse_version_field
|
||||
echo latest
|
||||
echo nightly
|
||||
echo "latest"
|
||||
echo "nightly"
|
||||
echo "5.x"
|
||||
echo "7.x"
|
||||
echo "8.x"
|
||||
__phpenv_parse_version_field latest "8.4"
|
||||
__phpenv_parse_version_field nightly "8.5"
|
||||
__phpenv_parse_version_field "latest" "8.4"
|
||||
__phpenv_parse_version_field "nightly" "8.5"
|
||||
__phpenv_parse_version_field "5.x" "5.6"
|
||||
__phpenv_parse_version_field "7.x" "7.4"
|
||||
__phpenv_parse_version_field "8.x" "8.4"
|
||||
@@ -64,18 +64,18 @@ complete -c phpenv -f -n "__fish_seen_subcommand_from uninstall use local global
|
||||
-a "(__phpenv_complete_installed_versions)" -d "Installed PHP version"
|
||||
|
||||
# Add system option for use command
|
||||
complete -c phpenv -f -n "__fish_seen_subcommand_from use" -a system -d "Use system PHP"
|
||||
complete -c phpenv -f -n "__fish_seen_subcommand_from use" -a "system" -d "Use system PHP"
|
||||
|
||||
# Complete binaries for which command
|
||||
complete -c phpenv -f -n "__fish_seen_subcommand_from which" -a "(__phpenv_complete_binaries)" -d "PHP binary"
|
||||
|
||||
# Complete config subcommands
|
||||
complete -c phpenv -f -n "__fish_seen_subcommand_from config; and not __fish_seen_subcommand_from get set list" \
|
||||
-a get -d "Get configuration value"
|
||||
-a "get" -d "Get configuration value"
|
||||
complete -c phpenv -f -n "__fish_seen_subcommand_from config; and not __fish_seen_subcommand_from get set list" \
|
||||
-a set -d "Set configuration value"
|
||||
-a "set" -d "Set configuration value"
|
||||
complete -c phpenv -f -n "__fish_seen_subcommand_from config; and not __fish_seen_subcommand_from get set list" \
|
||||
-a list -d "List all configuration"
|
||||
-a "list" -d "List all configuration"
|
||||
|
||||
# Complete config keys
|
||||
complete -c phpenv -f -n "__fish_seen_subcommand_from config; and __fish_seen_subcommand_from get set" \
|
||||
@@ -91,27 +91,27 @@ complete -c phpenv -f \
|
||||
complete -c phpenv -f \
|
||||
-n "__fish_seen_subcommand_from extensions ext" \
|
||||
-n "not __fish_seen_subcommand_from install uninstall remove list ls available" \
|
||||
-a install -d "Install PHP extension"
|
||||
-a "install" -d "Install PHP extension"
|
||||
complete -c phpenv -f \
|
||||
-n "__fish_seen_subcommand_from extensions ext" \
|
||||
-n "not __fish_seen_subcommand_from install uninstall remove list ls available" \
|
||||
-a uninstall -d "Uninstall PHP extension"
|
||||
-a "uninstall" -d "Uninstall PHP extension"
|
||||
complete -c phpenv -f \
|
||||
-n "__fish_seen_subcommand_from extensions ext" \
|
||||
-n "not __fish_seen_subcommand_from install uninstall remove list ls available" \
|
||||
-a remove -d "Remove PHP extension"
|
||||
-a "remove" -d "Remove PHP extension"
|
||||
complete -c phpenv -f \
|
||||
-n "__fish_seen_subcommand_from extensions ext" \
|
||||
-n "not __fish_seen_subcommand_from install uninstall remove list ls available" \
|
||||
-a list -d "List installed extensions"
|
||||
-a "list" -d "List installed extensions"
|
||||
complete -c phpenv -f \
|
||||
-n "__fish_seen_subcommand_from extensions ext" \
|
||||
-n "not __fish_seen_subcommand_from install uninstall remove list ls available" \
|
||||
-a ls -d "List installed extensions"
|
||||
-a "ls" -d "List installed extensions"
|
||||
complete -c phpenv -f \
|
||||
-n "__fish_seen_subcommand_from extensions ext" \
|
||||
-n "not __fish_seen_subcommand_from install uninstall remove list ls available" \
|
||||
-a available -d "Show available extensions"
|
||||
-a "available" -d "Show available extensions"
|
||||
|
||||
# Complete extension names
|
||||
complete -c phpenv -f \
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
# @halostatue/fish-macos/completions/ql.fish:v7.0.1
|
||||
|
||||
complete --erase --command ql
|
||||
complete --command ql --wraps qlmanage
|
||||
@@ -1,24 +0,0 @@
|
||||
# Everforest color scheme for fish shell
|
||||
# Generated from template - do not edit manually
|
||||
|
||||
# Set fish colors
|
||||
set -U fish_color_normal #d3c6aa
|
||||
set -U fish_color_command #7fbbb3
|
||||
set -U fish_color_keyword #d699b6
|
||||
set -U fish_color_quote #dbbc7f
|
||||
set -U fish_color_redirection #83c092
|
||||
set -U fish_color_end #e69875
|
||||
set -U fish_color_error #e67e80
|
||||
set -U fish_color_param #d3c6aa
|
||||
set -U fish_color_comment #7a8478
|
||||
set -U fish_color_selection --background=#323c41
|
||||
set -U fish_color_search_match --background=#323c41
|
||||
set -U fish_color_operator #a7c080
|
||||
set -U fish_color_escape #d699b6
|
||||
set -U fish_color_autosuggestion #859289
|
||||
|
||||
# Set fish pager colors
|
||||
set -U fish_pager_color_progress #9da9a0
|
||||
set -U fish_pager_color_prefix #7fbbb3
|
||||
set -U fish_pager_color_completion #d3c6aa
|
||||
set -U fish_pager_color_description #859289
|
||||
@@ -1,24 +0,0 @@
|
||||
# Everforest color scheme for fish shell
|
||||
# Generated from template - do not edit manually
|
||||
|
||||
# Set fish colors
|
||||
set -U fish_color_normal #d3c6aa
|
||||
set -U fish_color_command #7fbbb3
|
||||
set -U fish_color_keyword #d699b6
|
||||
set -U fish_color_quote #dbbc7f
|
||||
set -U fish_color_redirection #83c092
|
||||
set -U fish_color_end #e69875
|
||||
set -U fish_color_error #e67e80
|
||||
set -U fish_color_param #d3c6aa
|
||||
set -U fish_color_comment #7a8478
|
||||
set -U fish_color_selection --background=#374247
|
||||
set -U fish_color_search_match --background=#374247
|
||||
set -U fish_color_operator #a7c080
|
||||
set -U fish_color_escape #d699b6
|
||||
set -U fish_color_autosuggestion #859289
|
||||
|
||||
# Set fish pager colors
|
||||
set -U fish_pager_color_progress #9da9a0
|
||||
set -U fish_pager_color_prefix #7fbbb3
|
||||
set -U fish_pager_color_completion #d3c6aa
|
||||
set -U fish_pager_color_description #859289
|
||||
@@ -1,24 +0,0 @@
|
||||
# Everforest color scheme for fish shell
|
||||
# Generated from template - do not edit manually
|
||||
|
||||
# Set fish colors
|
||||
set -U fish_color_normal #d3c6aa
|
||||
set -U fish_color_command #7fbbb3
|
||||
set -U fish_color_keyword #d699b6
|
||||
set -U fish_color_quote #dbbc7f
|
||||
set -U fish_color_redirection #83c092
|
||||
set -U fish_color_end #e69875
|
||||
set -U fish_color_error #e67e80
|
||||
set -U fish_color_param #d3c6aa
|
||||
set -U fish_color_comment #7a8478
|
||||
set -U fish_color_selection --background=#3a464c
|
||||
set -U fish_color_search_match --background=#3a464c
|
||||
set -U fish_color_operator #a7c080
|
||||
set -U fish_color_escape #d699b6
|
||||
set -U fish_color_autosuggestion #859289
|
||||
|
||||
# Set fish pager colors
|
||||
set -U fish_pager_color_progress #9da9a0
|
||||
set -U fish_pager_color_prefix #7fbbb3
|
||||
set -U fish_pager_color_completion #d3c6aa
|
||||
set -U fish_pager_color_description #859289
|
||||
@@ -1,24 +0,0 @@
|
||||
# Everforest color scheme for fish shell
|
||||
# Generated from template - do not edit manually
|
||||
|
||||
# Set fish colors
|
||||
set -U fish_color_normal #5c6a72
|
||||
set -U fish_color_command #7fbbb3
|
||||
set -U fish_color_keyword #d699b6
|
||||
set -U fish_color_quote #dbbc7f
|
||||
set -U fish_color_redirection #83c092
|
||||
set -U fish_color_end #e69875
|
||||
set -U fish_color_error #e67e80
|
||||
set -U fish_color_param #5c6a72
|
||||
set -U fish_color_comment #a6b0a0
|
||||
set -U fish_color_selection --background=#f4f0d9
|
||||
set -U fish_color_search_match --background=#f4f0d9
|
||||
set -U fish_color_operator #a7c080
|
||||
set -U fish_color_escape #d699b6
|
||||
set -U fish_color_autosuggestion #b3c0b0
|
||||
|
||||
# Set fish pager colors
|
||||
set -U fish_pager_color_progress #c0cdb8
|
||||
set -U fish_pager_color_prefix #7fbbb3
|
||||
set -U fish_pager_color_completion #5c6a72
|
||||
set -U fish_pager_color_description #b3c0b0
|
||||
@@ -1,24 +0,0 @@
|
||||
# Everforest color scheme for fish shell
|
||||
# Generated from template - do not edit manually
|
||||
|
||||
# Set fish colors
|
||||
set -U fish_color_normal #5c6a72
|
||||
set -U fish_color_command #7fbbb3
|
||||
set -U fish_color_keyword #d699b6
|
||||
set -U fish_color_quote #dbbc7f
|
||||
set -U fish_color_redirection #83c092
|
||||
set -U fish_color_end #e69875
|
||||
set -U fish_color_error #e67e80
|
||||
set -U fish_color_param #5c6a72
|
||||
set -U fish_color_comment #a6b0a0
|
||||
set -U fish_color_selection --background=#ede6cf
|
||||
set -U fish_color_search_match --background=#ede6cf
|
||||
set -U fish_color_operator #a7c080
|
||||
set -U fish_color_escape #d699b6
|
||||
set -U fish_color_autosuggestion #b3c0b0
|
||||
|
||||
# Set fish pager colors
|
||||
set -U fish_pager_color_progress #c0cdb8
|
||||
set -U fish_pager_color_prefix #7fbbb3
|
||||
set -U fish_pager_color_completion #5c6a72
|
||||
set -U fish_pager_color_description #b3c0b0
|
||||
@@ -1,24 +0,0 @@
|
||||
# Everforest color scheme for fish shell
|
||||
# Generated from template - do not edit manually
|
||||
|
||||
# Set fish colors
|
||||
set -U fish_color_normal #5c6a72
|
||||
set -U fish_color_command #7fbbb3
|
||||
set -U fish_color_keyword #d699b6
|
||||
set -U fish_color_quote #dbbc7f
|
||||
set -U fish_color_redirection #83c092
|
||||
set -U fish_color_end #e69875
|
||||
set -U fish_color_error #e67e80
|
||||
set -U fish_color_param #5c6a72
|
||||
set -U fish_color_comment #a6b0a0
|
||||
set -U fish_color_selection --background=#e9e1cc
|
||||
set -U fish_color_search_match --background=#e9e1cc
|
||||
set -U fish_color_operator #a7c080
|
||||
set -U fish_color_escape #d699b6
|
||||
set -U fish_color_autosuggestion #b3c0b0
|
||||
|
||||
# Set fish pager colors
|
||||
set -U fish_pager_color_progress #c0cdb8
|
||||
set -U fish_pager_color_prefix #7fbbb3
|
||||
set -U fish_pager_color_completion #5c6a72
|
||||
set -U fish_pager_color_description #b3c0b0
|
||||
@@ -1,7 +0,0 @@
|
||||
if test -z "$SSH_ENV"
|
||||
set -xg SSH_ENV $HOME/.ssh/environment
|
||||
end
|
||||
|
||||
if not __ssh_agent_is_started
|
||||
__ssh_agent_start
|
||||
end
|
||||
@@ -1,27 +0,0 @@
|
||||
# fzf.fish is only meant to be used in interactive mode. If not in interactive mode and not in CI, skip the config to speed up shell startup
|
||||
if not status is-interactive && test "$CI" != true
|
||||
exit
|
||||
end
|
||||
|
||||
# Because of scoping rules, to capture the shell variables exactly as they are, we must read
|
||||
# them before even executing _fzf_search_variables. We use psub to store the
|
||||
# variables' info in temporary files and pass in the filenames as arguments.
|
||||
# This variable is global so that it can be referenced by fzf_configure_bindings and in tests
|
||||
set --global _fzf_search_vars_command '_fzf_search_variables (set --show | psub) (set --names | psub)'
|
||||
|
||||
# Install the default bindings, which are mnemonic and minimally conflict with fish's preset bindings
|
||||
fzf_configure_bindings
|
||||
|
||||
# Doesn't erase autoloaded _fzf_* functions because they are not easily accessible once key bindings are erased
|
||||
function _fzf_uninstall --on-event fzf_uninstall
|
||||
_fzf_uninstall_bindings
|
||||
|
||||
set --erase _fzf_search_vars_command
|
||||
functions --erase _fzf_uninstall _fzf_migration_message _fzf_uninstall_bindings fzf_configure_bindings
|
||||
complete --erase fzf_configure_bindings
|
||||
|
||||
set_color cyan
|
||||
echo "fzf.fish uninstalled."
|
||||
echo "You may need to manually remove fzf_configure_bindings from your config.fish if you were using custom key bindings."
|
||||
set_color normal
|
||||
end
|
||||
@@ -1,62 +0,0 @@
|
||||
# @halostatue/fish-brew/conf.d/halostatue_fish_brew.fish:v3.2.1
|
||||
|
||||
# Find Homebrew via a known prefix. If the `__homebrew_prefix` universal
|
||||
# variable is set, that will be set as the first test prefix.
|
||||
if not command --query brew
|
||||
set --local prefixes $HOME/.brew $HOME/.linuxbrew /opt/homebrew /usr/local
|
||||
set --query --universal __homebrew_prefix
|
||||
and set --prepend prefixes $__homebrew_prefix
|
||||
|
||||
for prefix in $prefixes
|
||||
test -x $prefix/bin/brew
|
||||
or continue
|
||||
|
||||
set --prepend PATH $prefix/bin
|
||||
break
|
||||
end
|
||||
end
|
||||
|
||||
if command --query brew
|
||||
set --query --universal __brew_prefix
|
||||
and set --erase --universal __brew_prefix
|
||||
|
||||
set --local __brew_prefix (brew --prefix)
|
||||
|
||||
if ! contains -- {$__brew_prefix}/bin $fish_user_paths
|
||||
fish_add_path --append --move --path \
|
||||
{$__brew_prefix}/bin \
|
||||
/usr/local/bin \
|
||||
/usr/bin \
|
||||
/bin \
|
||||
{$__brew_prefix}/sbin \
|
||||
/usr/local/sbin \
|
||||
/usr/sbin \
|
||||
/sbin
|
||||
end
|
||||
|
||||
if test -s $HOME/.config/brew/config.fish
|
||||
if status is-interactive
|
||||
set --local deprecated 0
|
||||
|
||||
if set --query $__halostatue_fish_brew_config_deprecated
|
||||
set deprecated $__halostatue_fish_brew_config_deprecated
|
||||
end
|
||||
|
||||
if test $deprecated -le 0
|
||||
echo >&2 "Sourcing ~/.config/brew/config.fish is deprecated."
|
||||
echo >&2 "See https://docs.brew.sh/Manpage#environment for a better alternative."
|
||||
|
||||
set --universal $__halostatue_fish_brew_config_deprecated 10
|
||||
else
|
||||
set --universal $__halostatue_fish_brew_config_deprecated (math $deprecated - 1)
|
||||
end
|
||||
end
|
||||
|
||||
source $HOME/.config/brew/config.fish
|
||||
end
|
||||
end
|
||||
|
||||
function _halostatue_fish_brew_uninstall -e halostatue_fish_brew_uninstall
|
||||
set --universal --erase __brew_prefix __halostatue_fish_brew_config_deprecated
|
||||
functions --erase has_cask has_keg (status function)
|
||||
end
|
||||
@@ -1,14 +0,0 @@
|
||||
# @halostatue/fish-macos/conf.d/halostatue_fish_macos.fish:v7.0.1
|
||||
|
||||
function _halostatue_fish_macos_uninstall -e halostatue_fish_macos_uninstall
|
||||
set --function functions app finder has_app mac manp note ql remind
|
||||
|
||||
for cmd in $functions
|
||||
complete --erase --command $cmd
|
||||
end
|
||||
|
||||
set --append functions (status function) \
|
||||
(functions --all | string match --entire --regex '^__macos_app_|^__macos_finder_|^__macos_mac_')
|
||||
|
||||
functions --erase $functions
|
||||
end
|
||||
@@ -16,7 +16,7 @@ if not set -q PHPENV_AUTO_SWITCH
|
||||
end
|
||||
|
||||
if not set -q PHPENV_DEFAULT_EXTENSIONS
|
||||
set -g PHPENV_DEFAULT_EXTENSIONS opcache
|
||||
set -g PHPENV_DEFAULT_EXTENSIONS "opcache"
|
||||
end
|
||||
|
||||
# Initialize PATH on shell startup if global version is set (less aggressive)
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
status is-interactive || exit
|
||||
|
||||
function _puffer_fish_key_bindings --on-variable fish_key_bindings
|
||||
set -l modes
|
||||
if test "$fish_key_bindings" = fish_default_key_bindings
|
||||
set modes default insert
|
||||
else
|
||||
set modes insert default
|
||||
end
|
||||
|
||||
bind --mode $modes[1] . _puffer_fish_expand_dots
|
||||
bind --mode $modes[1] ! _puffer_fish_expand_bang
|
||||
bind --mode $modes[1] '$' _puffer_fish_expand_lastarg
|
||||
bind --mode $modes[2] --erase . ! '$'
|
||||
end
|
||||
|
||||
_puffer_fish_key_bindings
|
||||
|
||||
set -l uninstall_event puffer_fish_key_bindings_uninstall
|
||||
|
||||
function _$uninstall_event --on-event $uninstall_event
|
||||
bind -e .
|
||||
bind -e !
|
||||
bind -e '$'
|
||||
end
|
||||
@@ -1,52 +0,0 @@
|
||||
# Sponge version
|
||||
set --global sponge_version 1.1.0
|
||||
|
||||
# Allow to repeat previous command by default
|
||||
if not set --query --universal sponge_delay
|
||||
set --universal sponge_delay 2
|
||||
end
|
||||
|
||||
# Purge entries both after `sponge_delay` entries and on exit by default
|
||||
if not set --query --universal sponge_purge_only_on_exit
|
||||
set --universal sponge_purge_only_on_exit false
|
||||
end
|
||||
|
||||
# Add default filters
|
||||
if not set --query --universal sponge_filters
|
||||
set --universal sponge_filters sponge_filter_failed sponge_filter_matched
|
||||
end
|
||||
|
||||
# Don't filter out commands that already have been in the history by default
|
||||
if not set --query --universal sponge_allow_previously_successful
|
||||
set --universal sponge_allow_previously_successful true
|
||||
end
|
||||
|
||||
# Consider `0` the only successful exit code by default
|
||||
if not set --query --universal sponge_successful_exit_codes
|
||||
set --universal sponge_successful_exit_codes 0
|
||||
end
|
||||
|
||||
# No active regex patterns by default
|
||||
if not set --query --universal sponge_regex_patterns
|
||||
set --universal sponge_regex_patterns
|
||||
end
|
||||
|
||||
# Attach event handlers
|
||||
functions --query \
|
||||
_sponge_on_prompt \
|
||||
_sponge_on_preexec \
|
||||
_sponge_on_postexec \
|
||||
_sponge_on_exit
|
||||
|
||||
# Initialize empty state for the first run
|
||||
function _sponge_install --on-event sponge_install
|
||||
set --global _sponge_current_command ''
|
||||
set --global _sponge_current_command_exit_code 0
|
||||
set --global _sponge_current_command_previously_in_history false
|
||||
end
|
||||
|
||||
# Clean up variables
|
||||
function _sponge_uninstall --on-event sponge_uninstall
|
||||
_sponge_clear_state
|
||||
set --erase sponge_version
|
||||
end
|
||||
@@ -26,11 +26,11 @@ if status is-interactive
|
||||
# type -q fnm; and fnm env --use-on-cd --shell fish | source
|
||||
type -q load_nvm; and load_nvm >/dev/stderr
|
||||
|
||||
# Intialize other tools if available
|
||||
# Initialize other tools if available
|
||||
type -q zoxide; and zoxide init fish | source
|
||||
|
||||
# Start tmux if not already running and not in SSH
|
||||
open-tmux # defined in functions/open-tmux.fish
|
||||
#open-tmux # defined in functions/open-tmux.fish
|
||||
end
|
||||
|
||||
# Added by LM Studio CLI (lms)
|
||||
@@ -40,7 +40,7 @@ set -gx PATH $PATH $HOME/.lmstudio/bin
|
||||
# vim: ft=fish ts=4 sw=4 et:
|
||||
|
||||
# opencode
|
||||
fish_add_path /Users/ivuorinen/.opencode/bin
|
||||
fish_add_path $HOME/.opencode/bin
|
||||
|
||||
# Added by OrbStack: command-line tools and integration
|
||||
# This won't be added again if you remove it.
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
#!/usr/bin/env fish
|
||||
|
||||
# XDG Base Directory Specification
|
||||
set -q XDG_CONFIG_HOME; or set -x XDG_CONFIG_HOME "$HOME/.config"
|
||||
set -q XDG_DATA_HOME; or set -x XDG_DATA_HOME "$HOME/.local/share"
|
||||
|
||||
@@ -1,12 +1,4 @@
|
||||
jorgebucaran/fisher
|
||||
ilancosman/tide@v6
|
||||
jethrokuan/z
|
||||
halostatue/fish-macos@v7
|
||||
danhper/fish-ssh-agent
|
||||
halostatue/fish-brew@v3
|
||||
edc/bass
|
||||
meaningful-ooo/sponge
|
||||
nickeb96/puffer-fish
|
||||
jgusta/paths
|
||||
patrickf1/fzf.fish
|
||||
ivuorinen/phpenv.fish
|
||||
|
||||
@@ -1,53 +0,0 @@
|
||||
# @halostatue/fish-macos/functions/__macos_app_bundleid.fish:v7.0.1
|
||||
|
||||
function __macos_app_bundleid
|
||||
argparse --name 'app bundleid' x/exact a/all h/help q/quiet s/short -- $argv
|
||||
or return 1
|
||||
|
||||
if set --query _flag_help
|
||||
echo 'Usage: app bundleid [options] pattern...
|
||||
|
||||
Shows the bundle identifier for each of the applications found for the
|
||||
pattern (see `app find` for how applications are found).
|
||||
|
||||
Options:
|
||||
-x, --exact Perform exact matches only
|
||||
-a, --all Show all matches
|
||||
-q, --quiet Suppress error output
|
||||
-s, --short Prints out the bundle IDs only
|
||||
-h, --help Show this help
|
||||
|
||||
Examples:
|
||||
> app bundleid 1password
|
||||
/Applications/1Password for Safari.app: com.1password.safari
|
||||
/Applications/1Password.app: com.1password.1password
|
||||
|
||||
> app bundleid -x 1password
|
||||
/Applications/1Password.app: com.1password.1password'
|
||||
return 0
|
||||
end
|
||||
|
||||
if test (count $argv) -eq 0
|
||||
echo >&2 'app bundleid: Not enough arguments.'
|
||||
__macos_app_bundleid --help >&2
|
||||
return 1
|
||||
end
|
||||
|
||||
set --function apps (__macos_app_find $_flag_exact $_flag_all $argv)
|
||||
or return 1
|
||||
|
||||
for app in $apps
|
||||
set --local bundle_id (mdls -name kMDItemCFBundleIdentifier -r $app)
|
||||
|
||||
if test -z $bundle_id
|
||||
set --query _flag_quiet
|
||||
or echo >&2 'Error getting bundle ID for "'$app'"'
|
||||
else
|
||||
if set --query _flag_short
|
||||
echo $bundle_id
|
||||
else
|
||||
echo $app: $bundle_id
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -1,85 +0,0 @@
|
||||
# @halostatue/fish-macos/functions/__macos_app_find.fish:v7.0.1
|
||||
|
||||
function __macos_app_find
|
||||
argparse --name 'app find' x/exact a/all q/quiet h/help -- $argv
|
||||
or return 1
|
||||
|
||||
if set --query _flag_help
|
||||
echo 'Usage: app find [options] pattern...
|
||||
|
||||
Shows installed apps by the provided pattern or patterns. Searches for
|
||||
apps in /Applications, /Applications/Setapp, /Applications/Utilities,
|
||||
~/Applications, /Appliciations/Xcode.app/Contents/Applications,
|
||||
/Developer/Applications, and /System/Applications.
|
||||
|
||||
Options:
|
||||
-x, --exact Perform exact matches only
|
||||
-a, --all Show all matches
|
||||
-q, --quiet Do not print matches
|
||||
-h, --help Show this help
|
||||
|
||||
Examples:
|
||||
> app find --all 1password
|
||||
/Applications/1Password for Safari.app
|
||||
/Applications/1Password.app
|
||||
|
||||
> app find --exact 1password
|
||||
/Applications/1Password.app'
|
||||
return 0
|
||||
end
|
||||
|
||||
if test (count $argv) -eq 0
|
||||
echo >&2 'app find: Not enough arguments.'
|
||||
__macos_app_find --help >&2
|
||||
return 1
|
||||
end
|
||||
|
||||
set --function a Applications
|
||||
set --function paths \
|
||||
/$a \
|
||||
~/$a \
|
||||
/$a/Setapp \
|
||||
/$a/Utilities \
|
||||
/$a/Xcode.app/Contents/$a \
|
||||
/Developer/Applications \
|
||||
/System/Applications
|
||||
|
||||
set --function found 0
|
||||
|
||||
for pattern in $argv
|
||||
set pattern (string replace '\.app/?$' '' $pattern)
|
||||
set --local apps {$paths}/*.app {$paths}/*.localized/*.app
|
||||
for candidate in $apps
|
||||
set --local found_item 0
|
||||
|
||||
if set --query _flag_exact
|
||||
if string match --ignore-case --entire --quiet /$pattern.app $candidate
|
||||
set found_item 1
|
||||
end
|
||||
else if string match --ignore-case --entire --quiet $pattern $candidate
|
||||
set found_item 1
|
||||
end
|
||||
|
||||
if test $found_item -eq 1
|
||||
set --query _flag_quiet
|
||||
or echo $candidate
|
||||
|
||||
set found (math $found + $found_item)
|
||||
|
||||
set --query _flag_quiet
|
||||
and return 0
|
||||
|
||||
set --query _flag_all
|
||||
or return 0
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
test $found -gt 0
|
||||
and return 0
|
||||
|
||||
set --query _flag_quiet
|
||||
or echo >&2 'No applications found.'
|
||||
return 1
|
||||
end
|
||||
@@ -1,110 +0,0 @@
|
||||
# @halostatue/fish-macos/functions/__macos_app_frontmost.fish:v7.0.1
|
||||
|
||||
function __macos_app_frontmost::info
|
||||
set --function value (lsappinfo info -only $argv[2] $argv[1] | string split =)[2]
|
||||
or return 1
|
||||
|
||||
string replace --all '"' '' $value
|
||||
return 0
|
||||
end
|
||||
|
||||
function __macos_app_frontmost
|
||||
argparse --name 'app frontmost' \
|
||||
h/help b/bundle-id p/path n/name P/pid a/all \
|
||||
-- $argv
|
||||
or return 1
|
||||
|
||||
if set --query _flag_help
|
||||
echo 'Usage: app frontmost [options]
|
||||
|
||||
Retrieves details about the front-most application.
|
||||
|
||||
Options:
|
||||
-b, --bundle-id Shows the app bundle ID
|
||||
-p, --path Shows the app path
|
||||
-n, --name Shows the app name
|
||||
-P, --pid Shows the PID of the app
|
||||
-a, --all Shows all details
|
||||
-h, --help Show this help
|
||||
|
||||
Example:
|
||||
> app frontmost
|
||||
iTerm2'
|
||||
return 0
|
||||
end
|
||||
|
||||
set --function front (lsappinfo front)
|
||||
or return 1
|
||||
|
||||
set --function items 0
|
||||
|
||||
if set --query _flag_all
|
||||
set items 4
|
||||
else
|
||||
set --query _flag_bundle_id _flag_path _flag_name _flag_pid
|
||||
set --local missing $status
|
||||
|
||||
switch $missing
|
||||
case 0
|
||||
set _flag_all 1
|
||||
set items 4
|
||||
case 4
|
||||
set _flag_name 1
|
||||
set items 1
|
||||
case '*'
|
||||
set items (math 4 - $missing)
|
||||
end
|
||||
end
|
||||
|
||||
if set --query _flag_name || set --query _flag_all
|
||||
set --function name (__macos_app_frontmost::info $front name)
|
||||
or return 1
|
||||
end
|
||||
|
||||
if set --query _flag_bundle_id || set --query _flag_all
|
||||
set --function bundle_id (__macos_app_frontmost::info $front bundleID)
|
||||
or return 1
|
||||
end
|
||||
|
||||
if set --query _flag_path || set --query _flag_all
|
||||
set --function bundle_path (__macos_app_frontmost::info $front bundlepath)
|
||||
or return 1
|
||||
end
|
||||
|
||||
if set --query _flag_pid || set --query _flag_all
|
||||
set --function pid (__macos_app_frontmost::info $front pid)
|
||||
or return 1
|
||||
end
|
||||
|
||||
if set --query _flag_all
|
||||
printf "%s: %s %s (%s)\n" $name $bundle_id $bundle_path $pid
|
||||
else
|
||||
if set --query _flag_name
|
||||
printf "%s" $name
|
||||
test $items -gt 1 && printf ": "
|
||||
set items (math $items - 1)
|
||||
end
|
||||
|
||||
if set --query _flag_bundle_id
|
||||
printf "%s" $bundle_id
|
||||
test $items -gt 1 && printf " "
|
||||
set items (math $items - 1)
|
||||
end
|
||||
|
||||
if set --query _flag_path
|
||||
printf "%s" $bundle_path
|
||||
test $items -gt 1 && printf " "
|
||||
set items (math $items - 1)
|
||||
end
|
||||
|
||||
if set --query _flag_pid
|
||||
if test $items -gt 1
|
||||
printf "(%s)" $pid
|
||||
else
|
||||
printf "%s" $pid
|
||||
end
|
||||
end
|
||||
|
||||
printf "\n"
|
||||
end
|
||||
end
|
||||
@@ -1,94 +0,0 @@
|
||||
# @halostatue/fish-macos/functions/__macos_app_icon.fish:v7.0.1
|
||||
|
||||
function __macos_app_icon
|
||||
argparse --name 'app quit' x/exact h/help 'o/output=' 'w/width=' -- $argv
|
||||
or return 1
|
||||
|
||||
if set --query _flag_help
|
||||
echo 'Usage: app icon [options] pattern...
|
||||
|
||||
Extracts macOS app icons as PNG (see `app find` for how applications
|
||||
are found).
|
||||
|
||||
Options:
|
||||
-x, --exact Perform exact matches only
|
||||
-oOUTPUT Output to the file or directory specified
|
||||
--output OUTPUT Output to the file or directory specified
|
||||
-wWIDTH Outputs to a maximum of WIDTH pixels
|
||||
--width WIDTH Outputs to a maximum of WIDTH pixels
|
||||
-h, --help Show this help'
|
||||
return 0
|
||||
end
|
||||
|
||||
if test (count $argv) -eq 0
|
||||
echo >&2 'app icon: Not enough arguments.'
|
||||
__macos_app_icon --help >&2
|
||||
return 1
|
||||
end
|
||||
|
||||
|
||||
if set --query _flag_exact
|
||||
set --function apps (__macos_app_find --exact $argv)
|
||||
or return 1
|
||||
else
|
||||
set --function apps (__macos_app_find --all $argv)
|
||||
or return 1
|
||||
end
|
||||
|
||||
set --function app_count (count $apps)
|
||||
|
||||
set --function output_path $PWD
|
||||
if not test -z $_flag_output
|
||||
if test -e $_flag_output
|
||||
if test -f $_flag_output
|
||||
if test $app_count -gt 1
|
||||
echo >&2 'app icon: More than one application found, but only one output file specified.'
|
||||
return 1
|
||||
end
|
||||
|
||||
set output_path (dirname $_flag_output)
|
||||
set output_file (basename $_flag_output)
|
||||
else if test -d $_flag_output
|
||||
set output_path $_flag_output
|
||||
else
|
||||
echo >&2 'app icon: Output to a non-file or directory specified.'
|
||||
return 1
|
||||
end
|
||||
else
|
||||
set output_path $_flag_output
|
||||
mkdir -p $output_path
|
||||
end
|
||||
end
|
||||
|
||||
for app in $apps
|
||||
set --local icon $app/Contents/Resources/(
|
||||
defaults read $app/Contents/Info CFBundleIconFile |
|
||||
string replace --regex '\.icns$' ''
|
||||
).icns
|
||||
|
||||
set --local name (basename $app .app)_icon.png
|
||||
set --local tmp $TMPDIR/$name
|
||||
set --local max_width (sips -g pixelWidth $icon | tail -1 | awk '{ print $2; }')
|
||||
|
||||
set --local outfile
|
||||
set --local width
|
||||
|
||||
if test -z $output_file
|
||||
set outfile $output_path/$name
|
||||
else
|
||||
set outfile $output_path/$output_file
|
||||
end
|
||||
|
||||
if test -z $_flag_width
|
||||
set width $max_width
|
||||
else if test $_flag_width -gt $max_width
|
||||
set width $max_width
|
||||
else
|
||||
set width $_flag_width
|
||||
end
|
||||
|
||||
sips -s format png --resampleHeightWidthMax $width $icon --out $outfile >/dev/null 2>&1
|
||||
|
||||
echo Wrote $app icon to $outfile.
|
||||
end
|
||||
end
|
||||
@@ -1,42 +0,0 @@
|
||||
# @halostatue/fish-macos/functions/__macos_app_quit.fish:v7.0.1
|
||||
|
||||
function __macos_app_quit
|
||||
argparse --name 'app quit' x/exact r/restart h/help -- $argv
|
||||
or return 1
|
||||
|
||||
if set --query _flag_help
|
||||
echo 'Usage: app quit [options] pattern...
|
||||
|
||||
Quits apps identified by the provided pattern or patterns (see
|
||||
`app find` for how applications are found).
|
||||
|
||||
Options:
|
||||
-x, --exact Quits only applications with exact matches
|
||||
-r, --restart Restarts the application that was quit
|
||||
-h, --help Show this help'
|
||||
return 0
|
||||
end
|
||||
|
||||
if test (count $argv) -eq 0
|
||||
echo >&2 'app bundleid: Not enough arguments.'
|
||||
__macos_app_quit --help >&2
|
||||
return 1
|
||||
end
|
||||
|
||||
if set --query _flag_exact
|
||||
set --function apps (__macos_app_find --exact $argv)
|
||||
or return 1
|
||||
else
|
||||
set --function apps (__macos_app_find --all $argv)
|
||||
or return 1
|
||||
end
|
||||
|
||||
for app in $apps
|
||||
printf 'quit app "%s"' $app | osascript >/dev/null
|
||||
|
||||
if set --query _flag_restart
|
||||
sleep 2
|
||||
open -a $app
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -1,18 +0,0 @@
|
||||
# @halostatue/fish-macos/functions/__macos_finder_cd.fish:v7.0.1
|
||||
|
||||
function __macos_finder_cd
|
||||
argparse --name 'finder cd' h/help -- $argv
|
||||
or return 1
|
||||
|
||||
if set --query _flag_help
|
||||
echo 'Usage: finder cd [options] [window#]
|
||||
|
||||
Changes the current path to the path of the Finder window.
|
||||
|
||||
Options:
|
||||
-h, --help Show this help'
|
||||
return 0
|
||||
end
|
||||
|
||||
cd (__macos_finder_pwd::get $argv[1])
|
||||
end
|
||||
@@ -1,30 +0,0 @@
|
||||
# @halostatue/fish-macos/functions/__macos_finder_clean.fish:v7.0.1
|
||||
|
||||
function __macos_finder_clean
|
||||
argparse --name 'finder clean' h/help -- $argv
|
||||
or return 1
|
||||
|
||||
if set --query _flag_help
|
||||
echo 'Usage: finder clean [options] [path...]
|
||||
|
||||
Removes .DS_Store files from the paths provided, or the current path if
|
||||
one is not provided.
|
||||
|
||||
Options:
|
||||
-h, --help Show this help'
|
||||
return 0
|
||||
end
|
||||
|
||||
if set --query argv[1]
|
||||
set --function paths $argv
|
||||
else
|
||||
set --function paths .
|
||||
end
|
||||
|
||||
for path in $paths
|
||||
test -d $path
|
||||
or continue
|
||||
|
||||
find $path -type f -name '*.DS_Store' -ls -delete
|
||||
end
|
||||
end
|
||||
@@ -1,18 +0,0 @@
|
||||
# @halostatue/fish-macos/functions/__macos_finder_column.fish:v7.0.1
|
||||
|
||||
function __macos_finder_column
|
||||
argparse --name 'finder column' h/help -- $argv
|
||||
or return 1
|
||||
|
||||
if set --query _flag_help
|
||||
echo 'Usage: finder column [options] [window#]
|
||||
|
||||
Updates the Finder window to PWD using column view.
|
||||
|
||||
Options:
|
||||
-h, --help Show this help'
|
||||
return 0
|
||||
end
|
||||
|
||||
__macos_finder_pwd::update --column $argv
|
||||
end
|
||||
@@ -1,44 +0,0 @@
|
||||
# @halostatue/fish-macos/functions/__macos_finder_desktop_icons.fish:v7.0.1
|
||||
|
||||
function __macos_finder_desktop_icons
|
||||
argparse --name 'finder desktop-icons' h/help -- $argv
|
||||
or return 1
|
||||
|
||||
if set --query _flag_help
|
||||
echo 'Usage: finder desktop-icons [options] STATE
|
||||
|
||||
Shows or hides the desktop icons. If not specified, shows the current state.
|
||||
|
||||
States:
|
||||
off Hides the desktop icons
|
||||
on Shows the desktop icons
|
||||
[status] Shows desktop icon visibility
|
||||
toggle Toggles desktop icon visibility
|
||||
|
||||
Options:
|
||||
-h, --help Show this help'
|
||||
return 0
|
||||
end
|
||||
|
||||
set --function action (string lower -- $argv[1])
|
||||
set --function key CreateDesktop
|
||||
|
||||
switch $action
|
||||
case off
|
||||
__macos_finder_defaults::set $key false
|
||||
case on
|
||||
__macos_finder_defaults::set $key true
|
||||
case toggle
|
||||
if test (__macos_mac_defaults_query com.apple.Finder $key 1) -eq 1
|
||||
__macos_finder_defaults::set $key false
|
||||
else
|
||||
__macos_finder_defaults::set $key true
|
||||
end
|
||||
case status ''
|
||||
if test (__macos_mac_defaults_query com.apple.Finder $key 1) -eq 1
|
||||
echo 'Desktop icons are hidden.'
|
||||
else
|
||||
echo 'Desktop icons are visible.'
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -1,45 +0,0 @@
|
||||
# @halostatue/fish-macos/functions/__macos_finder_hidden.fish:v7.0.1
|
||||
|
||||
function __macos_finder_hidden
|
||||
argparse --name 'finder hidden' h/help -- $argv
|
||||
or return 1
|
||||
|
||||
if set --query _flag_help
|
||||
echo 'Usage: finder hidden [options] STATE
|
||||
|
||||
Shows or hides files that are normally hidden from the Finder. If not
|
||||
specified, shows the current state.
|
||||
|
||||
States:
|
||||
off Hides files that are normally hidden from the Finder
|
||||
on Shows files that are normally hidden from the Finder
|
||||
[status] Shows the status of the hidden files setting
|
||||
toggle Toggles the hidden files setting
|
||||
|
||||
Options:
|
||||
-h, --help Show this help'
|
||||
return 0
|
||||
end
|
||||
|
||||
set --function action (string lower -- $argv[1])
|
||||
set --function key AppleShowAllFiles
|
||||
|
||||
switch $action
|
||||
case off
|
||||
__macos_finder_defaults::set $key false
|
||||
case on
|
||||
__macos_finder_defaults::set $key true
|
||||
case toggle
|
||||
if test (__macos_mac_defaults_query com.apple.Finder $key 0) -eq 1
|
||||
__macos_finder_defaults::set $key false
|
||||
else
|
||||
__macos_finder_defaults::set $key true
|
||||
end
|
||||
case status ''
|
||||
if test (__macos_mac_defaults_query com.apple.Finder $key 0) -eq 1
|
||||
echo 'Hidden files are visible in finder.'
|
||||
else
|
||||
echo 'Hidden files are hidden in finder.'
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -1,18 +0,0 @@
|
||||
# @halostatue/fish-macos/functions/__macos_finder_icon.fish:v7.0.1
|
||||
|
||||
function __macos_finder_icon
|
||||
argparse --name 'finder icon' h/help -- $argv
|
||||
or return 1
|
||||
|
||||
if set --query _flag_help
|
||||
echo 'Usage: finder icon [options] [window#]
|
||||
|
||||
Updates the Finder window to PWD using icon view.
|
||||
|
||||
Options:
|
||||
-h, --help Show this help'
|
||||
return 0
|
||||
end
|
||||
|
||||
__macos_finder_pwd::update --icon $argv
|
||||
end
|
||||
@@ -1,18 +0,0 @@
|
||||
# @halostatue/fish-macos/functions/__macos_finder_list.fish:v7.0.1
|
||||
|
||||
function __macos_finder_list
|
||||
argparse --name 'finder list' h/help -- $argv
|
||||
or return 1
|
||||
|
||||
if set --query _flag_help
|
||||
echo 'Usage: finder list [options] [window#]
|
||||
|
||||
Updates the Finder window to PWD using list view.
|
||||
|
||||
Options:
|
||||
-h, --help Show this help'
|
||||
return 0
|
||||
end
|
||||
|
||||
__macos_finder_pwd::update --list $argv
|
||||
end
|
||||
@@ -1,18 +0,0 @@
|
||||
# @halostatue/fish-macos/functions/__macos_finder_pushd.fish:v7.0.1
|
||||
|
||||
function __macos_finder_pushd
|
||||
argparse --name 'finder pushd' h/help -- $argv
|
||||
or return 1
|
||||
|
||||
if set --query _flag_help
|
||||
echo 'Usage: finder pushd [options] [window#]
|
||||
|
||||
Changes the current path to the path of the Finder window with pushd.
|
||||
|
||||
Options:
|
||||
-h, --help Show this help'
|
||||
return 0
|
||||
end
|
||||
|
||||
pushd (__macos_finder_pwd::get $argv[1])
|
||||
end
|
||||
@@ -1,18 +0,0 @@
|
||||
# @halostatue/fish-macos/functions/__macos_finder_pwd.fish:v7.0.1
|
||||
|
||||
function __macos_finder_pwd
|
||||
argparse --name 'finder pwd' h/help -- $argv
|
||||
or return 1
|
||||
|
||||
if set --query _flag_help
|
||||
echo 'Usage: finder pwd [options] [window#]
|
||||
|
||||
Prints the path of the Finder window.
|
||||
|
||||
Options:
|
||||
-h, --help Show this help'
|
||||
return 0
|
||||
end
|
||||
|
||||
__macos_finder_pwd::get $argv[1]
|
||||
end
|
||||
@@ -1,60 +0,0 @@
|
||||
# @halostatue/fish-macos/functions/__macos_finder_quarantine.fish:v7.0.1
|
||||
|
||||
function __macos_finder_quarantine::run
|
||||
set --query argv[1]
|
||||
or return 1
|
||||
|
||||
set --function databases ~/Library/Preferences/com.apple.LaunchServices.QuarantineEventsV*
|
||||
set --function cmd sqlite3 -separator ' | '
|
||||
|
||||
for db in $databases
|
||||
$cmd $db $argv
|
||||
end
|
||||
end
|
||||
|
||||
function __macos_finder_quarantine
|
||||
argparse --name 'finder quarantine' h/help -- $argv
|
||||
or return 1
|
||||
|
||||
if set --query _flag_help
|
||||
echo 'Usage: finder [options] [SUBCOMMAND] [FILE...]
|
||||
|
||||
Manage quarantine events.
|
||||
|
||||
Subcommands:
|
||||
[show] Shows quarantine events by agent and URL.
|
||||
clean FILE... Removes quarantine attributes from the specified file(s).
|
||||
At least one file is required.
|
||||
clear Clears all quarantine events.
|
||||
|
||||
Options:
|
||||
-h, --help Show this help'
|
||||
return 0
|
||||
end
|
||||
|
||||
set --function verb (string lower -- $argv[1])
|
||||
set --erase argv[1]
|
||||
|
||||
switch $verb
|
||||
case show ''
|
||||
__macos_finder_quarantine::run "
|
||||
SELECT LSQuarantineAgentName, LSQuarantineDataURLString
|
||||
FROM LSQuarantineEvent
|
||||
WHERE LSQuarantineDataURLString != ''
|
||||
ORDER BY LSQuarantineAgentName, LSQuarantineDataURLString;"
|
||||
case clear
|
||||
__macos_finder_quarantine::run 'DELETE FROM LSQuarantineEvent;'
|
||||
case clean
|
||||
if not set --query argv[1]
|
||||
echo >&2 'finder quarantine clean requires at least one file parameter'
|
||||
return 1
|
||||
end
|
||||
|
||||
for attr in com.apple.{metadata:{kMDItemDownloadedDate,kMDItemWhereFroms},quarantine}
|
||||
xattr -r -d $attr $argv
|
||||
end
|
||||
case '*'
|
||||
echo >&2 "finder quarantine: unknown command '"$verb"'. Use 'show', 'clear', or 'clean'."
|
||||
return 1
|
||||
end
|
||||
end
|
||||
@@ -1,28 +0,0 @@
|
||||
# @halostatue/fish-macos/functions/__macos_finder_selected.fish:v7.0.1
|
||||
|
||||
function __macos_finder_selected
|
||||
argparse --name 'finder selected' h/help -- $argv
|
||||
or return 1
|
||||
|
||||
if set --query _flag_help
|
||||
echo 'Usage: finder selected [options] [window#]
|
||||
|
||||
Print the selected files on the command-line.
|
||||
|
||||
Options:
|
||||
-h, --help Show this help'
|
||||
return 0
|
||||
end
|
||||
|
||||
echo '
|
||||
tell application "Finder" to set theSelection to selection
|
||||
set output to ""
|
||||
set itemCount to count theSelection
|
||||
repeat with itemIndex from 1 to itemCount
|
||||
if itemIndex is less than itemCount then set theDelimiter to "\n"
|
||||
if itemIndex is itemCount then set theDelimiter to ""
|
||||
set currentItem to (item itemIndex of theSelection as alias)
|
||||
set currentItem to POSIX path of currentItem
|
||||
set output to output & currentItem & theDelimiter
|
||||
end repeat' | osascript
|
||||
end
|
||||
@@ -1,26 +0,0 @@
|
||||
# @halostatue/fish-macos/functions/__macos_finder_track.fish:v7.0.1
|
||||
|
||||
function __macos_finder_track
|
||||
argparse --name 'finder track' h/help -- $argv
|
||||
or return 1
|
||||
|
||||
if set --query _flag_help
|
||||
echo 'Usage: finder track [options]
|
||||
|
||||
Makes the first Finder window track with the shell PWD. This should be used
|
||||
in a single shell instance only, and updates only when the PWD value is
|
||||
updated.
|
||||
|
||||
Options:
|
||||
-h, --help Show this help'
|
||||
return 0
|
||||
end
|
||||
|
||||
if not functions --query __macos_finder_tracking
|
||||
function __macos_finder_tracking --on-variable PWD
|
||||
__macos_finder_pwd::update
|
||||
end
|
||||
end
|
||||
|
||||
__macos_finder_pwd::update
|
||||
end
|
||||
@@ -1,18 +0,0 @@
|
||||
# @halostatue/fish-macos/functions/__macos_finder_untrack.fish:v7.0.1
|
||||
|
||||
function __macos_finder_untrack
|
||||
argparse --name 'finder untrack' h/help -- $argv
|
||||
or return 1
|
||||
|
||||
if set --query _flag_help
|
||||
echo 'Usage: finder untrack [options]
|
||||
|
||||
Unlinks the shell PWD from the first Finder window.
|
||||
|
||||
Options:
|
||||
-h, --help Show this help'
|
||||
return 0
|
||||
end
|
||||
|
||||
functions --erase __macos_finder_tracking
|
||||
end
|
||||
@@ -1,18 +0,0 @@
|
||||
# @halostatue/fish-macos/functions/__macos_finder_update.fish:v7.0.1
|
||||
|
||||
function __macos_finder_update
|
||||
argparse --name 'finder update' h/help -- $argv
|
||||
or return 1
|
||||
|
||||
if set --query _flag_help
|
||||
echo 'Usage: finder update [options] [window#]
|
||||
|
||||
Updates the Finder window to PWD.
|
||||
|
||||
Options:
|
||||
-h, --help Show this help'
|
||||
return 0
|
||||
end
|
||||
|
||||
__macos_finder_pwd::update $argv
|
||||
end
|
||||
@@ -1,45 +0,0 @@
|
||||
# @halostatue/fish-macos/functions/__macos_mac_airdrop.fish:v7.0.1
|
||||
|
||||
function __macos_mac_airdrop
|
||||
argparse --name 'mac airdrop' h/help -- $argv
|
||||
or return 1
|
||||
|
||||
if set --query _flag_help
|
||||
echo 'Usage: mac airdrop STATE
|
||||
|
||||
Turns AirDrop on or off. Requires administrative permissions and
|
||||
executes with sudo.
|
||||
|
||||
States:
|
||||
off Disables AirDrop.
|
||||
on Enables AirDrop.
|
||||
[status] Shows the status of AirDrop.
|
||||
toggle Toggles the status of AirDrop.
|
||||
|
||||
Options:
|
||||
-h, --help Show this help'
|
||||
return 0
|
||||
end
|
||||
|
||||
set --function subcommand (string lower -- $argv[1])
|
||||
set --erase argv[1]
|
||||
|
||||
switch $subcommand
|
||||
case on
|
||||
sudo ifconfig awdl0 up
|
||||
case off
|
||||
sudo ifconfig awdl0 down
|
||||
case status ''
|
||||
ifconfig awdl0 | awk '/status:/ { print $2; }'
|
||||
case toggle
|
||||
if test (__macos_mac_airdrop status) == active
|
||||
__macos_mac_airdrop off
|
||||
else
|
||||
__macos_mac_airdrop on
|
||||
end
|
||||
case '*'
|
||||
echo >&2 'mac airdrop: unknown state.'
|
||||
__macos_mac_airdrop --help >&2
|
||||
return 1
|
||||
end
|
||||
end
|
||||
@@ -1,75 +0,0 @@
|
||||
# @halostatue/fish-macos/functions/__macos_mac_airport.fish:v7.0.1
|
||||
|
||||
function __macos_mac_airport::ssid
|
||||
__macos_mac_airport::run -I | string replace --filter --regex '\s+SSID: (\S+)' '$1'
|
||||
end
|
||||
|
||||
function __macos_mac_airport::run
|
||||
/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport \
|
||||
$argv
|
||||
end
|
||||
|
||||
function __macos_mac_airport
|
||||
argparse --name 'mac airport' h/help -- $argv
|
||||
or return 1
|
||||
|
||||
if set --query _flag_help
|
||||
echo 'Usage: mac airport STATE
|
||||
mac airport SUBCOMMAND [SSID]
|
||||
|
||||
Performs various WiFi (AirPort) operations. If no state or subcommand is
|
||||
provided, the scan subcommand will be run by default. Otherwise a state (off,
|
||||
on, toggle) or a subcommand must be provided.
|
||||
|
||||
States:
|
||||
off Disables the WiFi adapter.
|
||||
on Enables the WiFi adapter.
|
||||
toggle Toggles the status of the WiFi adapter.
|
||||
|
||||
Subcommands:
|
||||
password [SSID] Shows the password of the current or specified SSID.
|
||||
scan Scans for WiFi networks..
|
||||
ssid Shows the current WiFi network SSID.
|
||||
status Shows the status of the WiFi adapter.
|
||||
|
||||
Options:
|
||||
-h, --help Show this help'
|
||||
return 0
|
||||
end
|
||||
|
||||
set --function cmd (string lower -- $argv[1])
|
||||
set --erase argv[1]
|
||||
|
||||
switch $cmd
|
||||
case scan ''
|
||||
printf "Scanning...\r"
|
||||
__macos_mac_airport::run -s
|
||||
case network ssid
|
||||
__macos_mac_airport::ssid
|
||||
case off
|
||||
networksetup -setairportpower en0 off
|
||||
case on
|
||||
networksetup -setairportpower en0 on
|
||||
case status
|
||||
networksetup -getairportpower en0 | string replace --regex '^[^:]+: ' '' | string lower
|
||||
case toggle
|
||||
if test (__macos_mac_airport status) == on
|
||||
__macos_mac_airport off
|
||||
else
|
||||
__macos_mac_airport on
|
||||
end
|
||||
case password
|
||||
set --local ssid
|
||||
if set --query argv[1]
|
||||
set ssid $argv[1]
|
||||
else
|
||||
set ssid (__macos_mac_airport::ssid)
|
||||
end
|
||||
|
||||
security find-generic-password -D "AirPort network password" -l $ssid -gw
|
||||
case '*'
|
||||
echo >&2 'mac airport: Unknown command.'
|
||||
__macos_mac_airport --help >&2
|
||||
return 1
|
||||
end
|
||||
end
|
||||
@@ -1,38 +0,0 @@
|
||||
# @halostatue/fish-macos/functions/__macos_mac_brightness.fish:v7.0.1
|
||||
|
||||
function __macos_mac_brightness
|
||||
argparse --name 'mac brightness' h/help -- $argv
|
||||
or return 1
|
||||
|
||||
if set --query _flag_help
|
||||
echo 'Usage: mac brightness [options] DIRECTION
|
||||
|
||||
Adjust the screen brightness level.
|
||||
|
||||
Direction:
|
||||
up Increases the screen brightness level.
|
||||
down Decreases the screen brightness level.
|
||||
|
||||
Options:
|
||||
-h, --help Show this help'
|
||||
return 0
|
||||
end
|
||||
|
||||
set --function direction (string lower -- $argv[1])
|
||||
set --erase argv[1]
|
||||
|
||||
switch $direction
|
||||
case down
|
||||
echo 'tell application "System Events"
|
||||
key code 145
|
||||
end tell' | osascript >/dev/null
|
||||
case up ''
|
||||
echo 'tell application "System Events"
|
||||
key code 144
|
||||
end tell' | osascript >/dev/null
|
||||
case '*'
|
||||
echo >&2 'mac brightness: Unknown direction'
|
||||
__macos_mac_brightness --help >&2
|
||||
return 1
|
||||
end
|
||||
end
|
||||
@@ -1,9 +0,0 @@
|
||||
# @halostatue/fish-macos/functions/__macos_mac_defaults_query.fish:v7.0.1
|
||||
|
||||
function __macos_mac_defaults_query
|
||||
if set --function value (defaults read $argv[1] $argv[2] 2>/dev/null)
|
||||
echo $value
|
||||
else
|
||||
echo $argv[3]
|
||||
end
|
||||
end
|
||||
@@ -1,19 +0,0 @@
|
||||
# @halostatue/fish-macos/functions/__macos_mac_flushdns.fish:v7.0.1
|
||||
|
||||
function __macos_mac_flushdns
|
||||
argparse --name 'mac flushdns' h/help -- $argv
|
||||
or return 1
|
||||
|
||||
if set --query _flag_help
|
||||
echo 'Usage: mac flushdns [options]
|
||||
|
||||
Flushes the DNS cache. Requires sudo.
|
||||
|
||||
Options:
|
||||
-h, --help Show this help'
|
||||
return 0
|
||||
end
|
||||
|
||||
sudo dscacheutil -flushcache
|
||||
and sudo killall -HUP mDNSResponder
|
||||
end
|
||||
@@ -1,62 +0,0 @@
|
||||
# @halostatue/fish-macos/functions/__macos_mac_font_smoothing.fish:v7.0.1
|
||||
|
||||
function __macos_mac_font_smoothing
|
||||
argparse --name 'mac font-smoothing' h/help -- $argv
|
||||
or return 1
|
||||
|
||||
if set --query _flag_help
|
||||
echo 'Usage: mac font-smoothing [options] off|on [APP...]
|
||||
|
||||
Enables or disables font smoothing. If no apps are provided, sets the
|
||||
global font smoothing preference. If apps are provided, font smoothing
|
||||
will be set for each app. See `app bundleid` for how apps are resolved.
|
||||
|
||||
States:
|
||||
off Turns off font smoothing
|
||||
on Turns on font smoothing
|
||||
|
||||
Options:
|
||||
-h, --help Show this help'
|
||||
return 0
|
||||
end
|
||||
|
||||
set --function state (string lower -- $argv[1])
|
||||
set --erase argv[1]
|
||||
|
||||
switch $state
|
||||
case on
|
||||
if test (count $argv) -eq 0
|
||||
defaults delete -g CGFontRenderingFontSmoothingDisabled
|
||||
else
|
||||
for app in (__macos_app_bundleid --exact --short --all $argv)
|
||||
defaults delete $app CGFontRenderingFontSmoothingDisabled
|
||||
|
||||
if test $app = com.microsoft.VSCode
|
||||
defaults delete $app.helper CGFontRenderingFontSmoothingDisabled
|
||||
defaults delete $app.helper.EH CGFontRenderingFontSmoothingDisabled
|
||||
defaults delete $app.helper.NP CGFontRenderingFontSmoothingDisabled
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
case off
|
||||
if test (count $argv) -eq 0
|
||||
defaults write -g CGFontRenderingFontSmoothingDisabled -bool false
|
||||
else
|
||||
for app in (__macos_app_bundleid --exact --short --all $argv)
|
||||
defaults write $app CGFontRenderingFontSmoothingDisabled -bool false
|
||||
|
||||
if test $app = com.microsoft.VSCode
|
||||
defaults write $app.helper CGFontRenderingFontSmoothingDisabled -bool false
|
||||
defaults write $app.helper.EH CGFontRenderingFontSmoothingDisabled -bool false
|
||||
defaults write $app.helper.NP CGFontRenderingFontSmoothingDisabled -bool false
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
case '*'
|
||||
echo >&2 'mac font-smoothing: Unknown state.'
|
||||
__macos_mac_font_smoothing --help >&2
|
||||
return 1
|
||||
end
|
||||
end
|
||||
@@ -1,20 +0,0 @@
|
||||
# @halostatue/fish-macos/functions/__macos_mac_lsclean.fish:v7.0.1
|
||||
|
||||
function __macos_mac_lsclean
|
||||
argparse --name 'mac lsclean' h/help -- $argv
|
||||
or return 1
|
||||
|
||||
if set --query _flag_help
|
||||
echo 'Usage: mac lsclean [options]
|
||||
|
||||
Cleans the LaunchServices registration list.
|
||||
|
||||
Options:
|
||||
-h, --help Show this help'
|
||||
return 0
|
||||
end
|
||||
|
||||
/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister \
|
||||
-kill -r -domain local -domain system -domain user
|
||||
and killall Finder
|
||||
end
|
||||
@@ -1,68 +0,0 @@
|
||||
# @halostatue/fish-macos/functions/__macos_mac_mail.fish:v7.0.1
|
||||
|
||||
# Speed up Mail.app by vacuuming the Envelope Index
|
||||
# - Code from: http://web.archive.org/web/20071008123746/http://www.hawkwings.net/2007/03/03/scripts-to-automate-the-mailapp-envelope-speed-trick/
|
||||
# - Originally by "pmbuko" with modifications by Romulo
|
||||
# - Updated by Brett Terpstra 2012
|
||||
# - Updated by Mathias Törnblom 2015 to support V3 in El Capitan and still keep backwards compatibility
|
||||
# - Updated by Andrei Miclaus 2017 to support V4 in Sierra
|
||||
# - Updated by Austin Ziegler 2022 to not actually care what the OS version is (and translated to fish). The only
|
||||
# restriction is that you must have opened Mail.app at least once on any OS upgrade so that if any version changes
|
||||
# have happened, Mail.app has taken care of that for you.
|
||||
function __macos_mac_mail
|
||||
argparse --name 'mac mail' h/help -- $argv
|
||||
or return 1
|
||||
|
||||
if set --query _flag_help
|
||||
echo 'Usage: mac mail [options] SUBCOMMAND [arg]
|
||||
|
||||
Performs operations on Mail.app configuration and database.
|
||||
|
||||
Before running vacuum after any OS upgrade, Mail.app must have been opened
|
||||
at least once so that the database and index formats have been updated.
|
||||
|
||||
Subcommands:
|
||||
vacuum Vacuums the envelope index to improve performance.
|
||||
attachments inline Sets Mail.app attachment handling to inline.
|
||||
attachments icon Sets Mail.app attachment handling to icon.
|
||||
|
||||
Options:
|
||||
-h, --help Show this help'
|
||||
return 0
|
||||
end
|
||||
|
||||
set --function subcommand (string lower -- $argv[1])
|
||||
set --erase argv[1]
|
||||
|
||||
switch $subcommand
|
||||
case vacuum
|
||||
set --function mail_version (
|
||||
path filter --type dir ~/Library/Mail/* |
|
||||
path basename |
|
||||
string match --all --entire --regex V\\d
|
||||
)
|
||||
set --function mail_path ~/Library/Mail/$mail_version/MailData/Envelope\ Index
|
||||
|
||||
osascript -e 'tell application "Mail" to quit'
|
||||
|
||||
set --function before (ls -lnah $mail_path | awk '{ print $5; }')
|
||||
/usr/bin/sqlite3 $mail_path vacuum
|
||||
set --function after (ls -lnah $mail_path | awk '{ print $5; }')
|
||||
|
||||
printf "Mail index before: %s\nMail index after: %s\n" $before $after
|
||||
osascript -e 'tell application "Mail" to activate'
|
||||
|
||||
case attachments
|
||||
switch (string lower -- $argv[1])
|
||||
case inline
|
||||
defaults delete com.apple.mail DisableInlineAttachmentViewing
|
||||
case icon
|
||||
defaults write com.apple.mail DisableInlineAttachmentViewing -bool true
|
||||
end
|
||||
|
||||
case '*'
|
||||
echo >&2 'mac mail: Unknown command.'
|
||||
__macos_mac_mail --help >&2
|
||||
return 1
|
||||
end
|
||||
end
|
||||
@@ -1,66 +0,0 @@
|
||||
# @halostatue/fish-macos/functions/__macos_mac_proxy_icon.fish:v7.0.1
|
||||
|
||||
function __macos_mac_proxy_icon
|
||||
argparse --name 'mac proxy-icon' h/help q/query -- $argv
|
||||
or return 1
|
||||
|
||||
if set --query _flag_help
|
||||
echo 'Usage: mac proxy-icon [options] STATE
|
||||
|
||||
Enables or disables the visibility of the proxy icon without delay. macOS
|
||||
versions older than Monterey always show the proxy icon.
|
||||
|
||||
States:
|
||||
FLOAT Sets the display of the proxy icon to FLOAT fractional seconds.
|
||||
off Sets the display of the proxy icon to default.
|
||||
on Sets the display of the proxy icon to 0 seconds.
|
||||
[status] Shows the duration of the proxy icon display.
|
||||
toggle Toggles the display of the proxy icon.
|
||||
|
||||
Options:
|
||||
-q, --query When getting status, suppresses output.
|
||||
-h, --help Show this help'
|
||||
return 0
|
||||
end
|
||||
|
||||
set --function state (string lower -- $argv[1])
|
||||
set --erase argv[1]
|
||||
|
||||
switch $state
|
||||
case status ''
|
||||
set --function value (__macos_mac_defaults_query -g NSToolbarTitleViewRolloverDelay 0.5)
|
||||
|
||||
if set --query _flag_query
|
||||
test $value -eq 0
|
||||
else if test $value -eq 0
|
||||
printf "immediate (0 seconds)\n"
|
||||
else
|
||||
printf "%0.2f seconds\n" $value
|
||||
end
|
||||
|
||||
case toggle
|
||||
if __macos_mac_proxy_icon --query status
|
||||
__macos_mac_proxy_icon off
|
||||
else
|
||||
__macos_mac_proxy_icon on
|
||||
end
|
||||
|
||||
case on
|
||||
defaults write -g NSToolbarTitleViewRolloverDelay -float 0
|
||||
and killall Finder
|
||||
|
||||
case off
|
||||
defaults delete -g NSToolbarTitleViewRolloverDelay
|
||||
and killall Finder
|
||||
|
||||
case '*'
|
||||
if string match --regex '^\\d+$|^\\d*\.\\d+$' $state
|
||||
defaults write -g NSToolbarTitleViewRolloverDelay -float $state
|
||||
and killall Finder
|
||||
else
|
||||
echo >&2 'mac proxy-icon: Unknown state.'
|
||||
__macos_mac_proxy_icon --help >&2
|
||||
return 1
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -1,22 +0,0 @@
|
||||
# @halostatue/fish-macos/functions/__macos_mac_serialnumber.fish:v7.0.1
|
||||
|
||||
function __macos_mac_serialnumber
|
||||
argparse --name 'mac serialnumber' h/help c/copy -- $argv
|
||||
or return 1
|
||||
|
||||
if set --query _flag_help
|
||||
echo 'Usage: mac serialnumber [options]
|
||||
|
||||
Gets the serial number for the current macOS device.
|
||||
|
||||
Options:
|
||||
-c, --copy Copy to the clipboard
|
||||
-h, --help Show this help'
|
||||
return 0
|
||||
end
|
||||
|
||||
set --function serial (ioreg -l | string replace --filter --regex --all '^.*"IOPlatformSerialNumber"\s+=\s+"([^"]+)"' '$1')
|
||||
|
||||
set --query _flag_copy && echo $serial | pbcopy
|
||||
echo $serial
|
||||
end
|
||||
@@ -1,42 +0,0 @@
|
||||
# @halostatue/fish-macos/functions/__macos_mac_touchid.fish:v7.0.1
|
||||
|
||||
function __macos_mac_touchid
|
||||
argparse --name 'mac touchid' h/help q/quiet -- $argv
|
||||
or return 1
|
||||
|
||||
if set --query _flag_help
|
||||
echo 'Usage: mac touchid SUBSYSTEM [STATE]
|
||||
|
||||
Enables or disables Touch ID support. Requires administrative permissions
|
||||
and executes with sudo.
|
||||
|
||||
Subsystems:
|
||||
sudo Manages Touch ID support for sudo
|
||||
|
||||
States:
|
||||
off Disables Touch ID.
|
||||
on Enables Touch ID.
|
||||
[status] Shows the status of Touch ID.
|
||||
toggle Toggles the status of Touch ID.
|
||||
|
||||
Options:
|
||||
-h, --help Show this help'
|
||||
return 0
|
||||
end
|
||||
|
||||
set --function subsystem (string lower -- $argv[1])
|
||||
set --erase argv[1]
|
||||
|
||||
if set --query _flag_quiet
|
||||
set --append argv --quiet
|
||||
end
|
||||
|
||||
switch $subsystem
|
||||
case sudo
|
||||
__macos_mac_touchid_sudo $argv
|
||||
case '*'
|
||||
echo >&2 'mac touchid: unknown subsystem.'
|
||||
__macos_mac_touchid --help >&2
|
||||
return 1
|
||||
end
|
||||
end
|
||||
@@ -1,195 +0,0 @@
|
||||
# @halostatue/fish-macos/functions/__macos_mac_touchid_sudo.fish:v7.0.1
|
||||
|
||||
# Massively simplified. This version _only_ works if /etc/pam.d/sudo includes `auth
|
||||
# include sudo_local` and requires manual removal of `pam_reattach` and `pam_tid` from
|
||||
# `/etc/pam.d/sudo` _manually_ if present.
|
||||
|
||||
function __macos_mac_touchid_sudo::check_supported
|
||||
if string match -rq '^\s*auth\s+include\s+sudo_local$' </etc/pam.d/sudo
|
||||
return 0
|
||||
end
|
||||
|
||||
echo "Unsupported sudo configuration, cannot find 'auth include sudo_local'. \
|
||||
If your macOS installation supports 'include', add this at the top:" |
|
||||
fmt -s >&2
|
||||
printf >&2 "\n auth include sudo_local\n\n"
|
||||
printf >&2 "Once this has been added, try again.\n"
|
||||
|
||||
return 1
|
||||
end
|
||||
|
||||
function __macos_mac_touchid_sudo::check_old_install
|
||||
set --function found
|
||||
|
||||
string match -rq '^\s*auth\s+sufficient\s+pam_tid\.so' </etc/pam.d/sudo
|
||||
and set --append found pam_tid
|
||||
|
||||
string match -rq '^\s*auth\s+optional\s+.+pam_reattach\.so' </etc/pam.d/sudo
|
||||
and set --append found pam_reattach
|
||||
|
||||
if set --query found[1]
|
||||
set found (string join ' and ' $found)
|
||||
printf >&2 "Sudo support for "$found" present in /etc/pam.d/sudo.\n\n"
|
||||
echo "This is unsupported by 'mac touchid sudo' and must be manually \
|
||||
removed before continuing." | fmt -s >&2
|
||||
|
||||
return 0
|
||||
end
|
||||
|
||||
return 1
|
||||
end
|
||||
|
||||
function __macos_mac_touchid_sudo::print_status
|
||||
set --query _flag_quiet
|
||||
or printf "%-15s: %s\n" $argv
|
||||
end
|
||||
|
||||
function __macos_mac_touchid_sudo::remove_one
|
||||
path is --type file --perm read /etc/pam.d/sudo_local
|
||||
and grep -q $argv[1] /etc/pam.d/sudo_local
|
||||
and sudo sed -i '' -e "/$argv[1]/d" /etc/pam.d/sudo_local
|
||||
end
|
||||
|
||||
function __macos_mac_touchid_sudo::remove
|
||||
osascript -e 'tell application "System Preferences" to quit'
|
||||
|
||||
for ext in pam_tid pam_reattach
|
||||
__macos_mac_touchid_sudo::remove_one {$ext} /etc/pam.d/sudo_local
|
||||
and __macos_mac_touchid_sudo::print_status $ext disabled
|
||||
end
|
||||
|
||||
if ! test -s /etc/pam.d/sudo_local
|
||||
# If /etc/pam.d/sudo_local is empty, remove it.
|
||||
sudo rm -f /etc/pam.d/sudo_local
|
||||
end
|
||||
end
|
||||
|
||||
function __macos_mac_touchid_sudo::add
|
||||
set --function targets
|
||||
|
||||
test -f /etc/pam.d/sudo_local
|
||||
or sudo touch /etc/pam.d/sudo_local
|
||||
|
||||
if set --query argv[1]
|
||||
set --function reattach $argv[1]
|
||||
|
||||
if string match -rq '^\s*auth\s+optional\s+'$argv[1] </etc/pam.d/sudo_local
|
||||
if string match -rq '^\s*auth\s+sufficient\s+pam_tid\.so' </etc/pam.d/sudo_local
|
||||
__macos_mac_touchid_sudo::print_status pam_reattach enabled
|
||||
__macos_mac_touchid_sudo::print_status pam_tid enabled
|
||||
|
||||
return 0
|
||||
end
|
||||
end
|
||||
|
||||
set --append targets pam_reattach pam_tid
|
||||
else if string match -rq '^\s*auth\s+sufficient\s+pam_tid\.so' </etc/pam.d/sudo_local
|
||||
__macos_mac_touchid_sudo::print_status pam_tid enabled
|
||||
else
|
||||
set --append targets pam_tid
|
||||
end
|
||||
|
||||
osascript -e 'tell application "System Preferences" to quit'
|
||||
|
||||
for target in $targets
|
||||
if grep -q $target /etc/pam.d/sudo_local
|
||||
__macos_mac_touchid_sudo::remove_one $target /etc/pam.d/sudo_local
|
||||
end
|
||||
end
|
||||
|
||||
if set --query reattach
|
||||
printf "%-10s %-14s %s\n" \
|
||||
auth optional $reattach \
|
||||
auth sufficient pam_tid.so |
|
||||
sudo tee -a /etc/pam.d/sudo_local >/dev/null
|
||||
and begin
|
||||
__macos_mac_touchid_sudo::print_status pam_reattach enabled
|
||||
__macos_mac_touchid_sudo::print_status pam_tid enabled
|
||||
end
|
||||
else
|
||||
printf "%-10s %-14s %s\n" auth sufficient pam_tid.so |
|
||||
sudo tee -a /etc/pam.d/sudo_local >/dev/null
|
||||
and __macos_mac_touchid_sudo::print_status pam_tid enabled
|
||||
end
|
||||
end
|
||||
|
||||
function __macos_mac_touchid_sudo
|
||||
argparse --name 'mac touchid sudo' h/help q/quiet -- $argv
|
||||
or return 1
|
||||
|
||||
if set --query _flag_help
|
||||
echo 'Usage: mac touchid sudo [STATE]
|
||||
|
||||
Enables or disables Touch ID support for sudo. Requires administrative
|
||||
permissions to edit /etc/pam.d/sudo_local and executes with sudo.
|
||||
|
||||
If pam_reattach is installed, this will be managed as well. Note that if
|
||||
pam_reattach is installed using sudo, it is imperative that Touch ID
|
||||
support be disabled first or you may be in a situation where you cannot
|
||||
use sudo. Note that MacPorts-installed pam_reattach will never be used.
|
||||
|
||||
States:
|
||||
off Disables Touch ID.
|
||||
on Enables Touch ID.
|
||||
[status] Shows the status of Touch ID.
|
||||
toggle Toggles the status of Touch ID.
|
||||
|
||||
Options:
|
||||
-h, --help Show this help'
|
||||
return 0
|
||||
end
|
||||
|
||||
|
||||
__macos_mac_touchid_sudo::check_supported
|
||||
or return
|
||||
|
||||
__macos_mac_touchid_sudo::check_old_install
|
||||
and return
|
||||
|
||||
set --function subcommand (string lower -- $argv[1])
|
||||
set --erase argv[1]
|
||||
|
||||
switch $subcommand
|
||||
case on
|
||||
set --local reattach /opt/local /opt/homebrew /usr/local /usr
|
||||
set reattach (path filter --type file $reattach/lib/pam/pam_reattach.so)
|
||||
|
||||
if set --query reattach[1]
|
||||
set reattach (string replace --all --regex / \\/ $reattach[1])
|
||||
end
|
||||
|
||||
__macos_mac_touchid_sudo::add $reattach
|
||||
|
||||
case off
|
||||
__macos_mac_touchid_sudo::remove
|
||||
|
||||
case status ''
|
||||
set --local pam_tid disabled
|
||||
set --local pam_reattach disabled
|
||||
|
||||
grep -q pam_tid.so /etc/pam.d/sudo_local
|
||||
and set pam_tid enabled
|
||||
|
||||
grep -q pam_reattach.so /etc/pam.d/sudo_local
|
||||
and set pam_reattach enabled
|
||||
|
||||
if set --query _flag_quiet
|
||||
test $pam_tid = enabled
|
||||
else
|
||||
__macos_mac_touchid_sudo::print_status pam_tid $pam_tid
|
||||
__macos_mac_touchid_sudo::print_status pam_reattach $pam_reattach
|
||||
end
|
||||
|
||||
case toggle
|
||||
if __macos_mac_touchid_sudo status --quiet
|
||||
__macos_mac_touchid_sudo off
|
||||
else
|
||||
__macos_mac_touchid_sudo on
|
||||
end
|
||||
|
||||
case '*'
|
||||
echo >&2 'mac touchid: unknown state.'
|
||||
__macos_mac_touchid_sudo --help >&2
|
||||
return 1
|
||||
end
|
||||
end
|
||||
@@ -1,60 +0,0 @@
|
||||
# @halostatue/fish-macos/functions/__macos_mac_transparency.fish:v7.0.1
|
||||
|
||||
function __macos_mac_transparency
|
||||
argparse --name 'mac transparency' h/help q/query -- $argv
|
||||
or return 1
|
||||
|
||||
if set --query _flag_help
|
||||
echo 'Usage: mac transparency [options] STATE
|
||||
|
||||
Enables or disables interface transparency by setting the universal
|
||||
access "reduce transparency" setting.
|
||||
|
||||
States:
|
||||
off Disables interface transparency
|
||||
on Enables interface transparency
|
||||
[status] Shows the status of interface transparency
|
||||
toggle Toggles interface transparency
|
||||
|
||||
Options:
|
||||
-q, --query When getting status, suppresses output.
|
||||
-h, --help Show this help'
|
||||
return 0
|
||||
end
|
||||
|
||||
set function state (string lower -- $argv[1])
|
||||
set --erase argv[1]
|
||||
|
||||
switch $state
|
||||
case status ''
|
||||
set function value (__macos_mac_defaults_query com.apple.universalaccess reduceTransparency 0)
|
||||
|
||||
if set --query _flag_query
|
||||
test $value -eq 0
|
||||
else
|
||||
if test $value -eq 0
|
||||
echo on
|
||||
else
|
||||
echo off
|
||||
end
|
||||
end
|
||||
|
||||
case on
|
||||
defaults delete com.apple.universalaccess reduceTransparency
|
||||
|
||||
case off
|
||||
defaults write com.apple.universalaccess reduceTransparency -bool true
|
||||
|
||||
case toggle
|
||||
if __macos_mac_transparency status --query
|
||||
__macos_mac_transparency off
|
||||
else
|
||||
__macos_mac_transparency on
|
||||
end
|
||||
|
||||
case '*'
|
||||
echo >&2 'mac transparency: unknown state'
|
||||
__macos_mac_transparency --help >&2
|
||||
return 1
|
||||
end
|
||||
end
|
||||
@@ -1,86 +0,0 @@
|
||||
# @halostatue/fish-macos/functions/__macos_mac_version.fish:v7.0.1
|
||||
|
||||
function __macos_mac_version
|
||||
argparse \
|
||||
--exclusive s,v \
|
||||
--exclusive l,v \
|
||||
--exclusive s,c \
|
||||
--exclusive l,c \
|
||||
--exclusive v,c \
|
||||
h/help s/simple l/lowercase v/version c/comparable -- $argv
|
||||
|
||||
if set --query _flag_help
|
||||
echo 'Usage: mac version [options]
|
||||
|
||||
Shows the current mac version.
|
||||
|
||||
Options:
|
||||
-s, --simple Removes spaces from the version displayed
|
||||
-l, --lowercase Converts the version to all lowercase
|
||||
-c, --comparable Outputs the comparable version value
|
||||
-v, --version Outputs the macOS version (same as sw_vers -productVersion)'
|
||||
return 0
|
||||
end
|
||||
|
||||
set --function os_version (sw_vers -productVersion)
|
||||
|
||||
if set --query _flag_version
|
||||
echo $os_version
|
||||
return $status
|
||||
end
|
||||
|
||||
set os_version (__macos_version_to_comparable $os_version)
|
||||
or return 1
|
||||
|
||||
if set --query _flag_comparable
|
||||
echo $os_version
|
||||
return 0
|
||||
end
|
||||
|
||||
switch $os_version
|
||||
case 1005000
|
||||
set os_version Leopard
|
||||
case 1006000
|
||||
set os_version Snow Leopard
|
||||
case 1007000
|
||||
set os_version Lion
|
||||
case 1008000
|
||||
set os_version Mountain Lion
|
||||
case 1009000
|
||||
set os_version Mavericks
|
||||
case 1010000
|
||||
set os_version Yosemite
|
||||
case 1011000
|
||||
set os_version El Capitan
|
||||
case 1012000
|
||||
set os_version Sierra
|
||||
case 1013000
|
||||
set os_version High Sierra
|
||||
case 1014000
|
||||
set os_version Mojave
|
||||
case 1015000
|
||||
set os_version Catalina
|
||||
case 1100000
|
||||
set os_version Big Sur
|
||||
case 1200000
|
||||
set os_version Monterey
|
||||
case 1300000
|
||||
set os_version Ventura
|
||||
case 1400000
|
||||
set os_version Sonoma
|
||||
case 1500000
|
||||
set os_version Sequoia
|
||||
case '*'
|
||||
return 1
|
||||
end
|
||||
|
||||
if set --query _flag_simple
|
||||
set os_version (string replace --all ' ' '' "$os_version")
|
||||
end
|
||||
|
||||
if set --query _flag_lowercase
|
||||
set os_version (string lower -- "$os_version")
|
||||
end
|
||||
|
||||
echo $os_version
|
||||
end
|
||||
@@ -1,45 +0,0 @@
|
||||
# @halostatue/fish-macos/functions/__macos_mac_vol.fish:v7.0.1
|
||||
|
||||
function __macos_mac_vol
|
||||
argparse --name 'mac vol' h/help -- $argv
|
||||
or return 1
|
||||
|
||||
if set --query _flag_help
|
||||
echo 'Usage: mac vol [options] LEVEL
|
||||
|
||||
Control the volume level.
|
||||
|
||||
Levels:
|
||||
mute Mutes the volume level.
|
||||
unmute Unmutes the volume level.
|
||||
0 .. 100 Sets the volume level at LEVEL %.
|
||||
[show] Shows the current volume level.
|
||||
|
||||
Options:
|
||||
-h, --help Show this help'
|
||||
return 0
|
||||
end
|
||||
|
||||
set --function action (string lower -- $argv[1])
|
||||
set --erase argv[1]
|
||||
|
||||
switch $action
|
||||
case mute
|
||||
osascript -e 'set volume output muted true'
|
||||
case unmute
|
||||
osascript -e 'set volume output muted false'
|
||||
case (seq 0 100)
|
||||
osascript -e "set volume output volume "$action
|
||||
case show ''
|
||||
if test (osascript -e 'output muted of (get volume settings)') = true
|
||||
echo muted
|
||||
else
|
||||
osascript -e "output volume of (get volume settings)"
|
||||
end
|
||||
|
||||
case '*'
|
||||
echo >&2 'mac vol: Unknown level'
|
||||
__macos_mac_vol --help >&2
|
||||
return 1
|
||||
end
|
||||
end
|
||||
@@ -1,23 +0,0 @@
|
||||
function __ssh_agent_is_started -d "check if ssh agent is already started"
|
||||
if test -n "$SSH_CONNECTION"
|
||||
# This is an SSH session
|
||||
ssh-add -l > /dev/null 2>&1
|
||||
if test $status -eq 0 -o $status -eq 1
|
||||
# An SSH agent was forwarded
|
||||
return 0
|
||||
end
|
||||
end
|
||||
|
||||
if begin; test -f "$SSH_ENV"; and test -z "$SSH_AGENT_PID"; end
|
||||
source $SSH_ENV > /dev/null
|
||||
end
|
||||
|
||||
if test -z "$SSH_AGENT_PID"
|
||||
return 1
|
||||
end
|
||||
|
||||
ssh-add -l > /dev/null 2>&1
|
||||
if test $status -eq 2
|
||||
return 1
|
||||
end
|
||||
end
|
||||
@@ -1,5 +0,0 @@
|
||||
function __ssh_agent_start -d "start a new ssh agent"
|
||||
ssh-agent -c | sed 's/^echo/#echo/' > $SSH_ENV
|
||||
chmod 600 $SSH_ENV
|
||||
source $SSH_ENV > /dev/null
|
||||
end
|
||||
@@ -169,6 +169,6 @@ function __z -d "Jump to a recent directory."
|
||||
echo "Not sure how to open file manager"; and return 1
|
||||
end
|
||||
else
|
||||
pushd "$target"
|
||||
cd "$target"
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,43 +0,0 @@
|
||||
function _fzf_configure_bindings_help --description "Prints the help message for fzf_configure_bindings."
|
||||
echo "\
|
||||
USAGE:
|
||||
fzf_configure_bindings [--COMMAND=[KEY_SEQUENCE]...]
|
||||
|
||||
DESCRIPTION
|
||||
fzf_configure_bindings installs key bindings for fzf.fish's commands and erases any bindings it
|
||||
previously installed. It installs bindings for both default and insert modes. fzf.fish executes
|
||||
it without options on fish startup to install the out-of-the-box key bindings.
|
||||
|
||||
By default, commands are bound to a mnemonic key sequence, shown below. Each command's binding
|
||||
can be configured using a namesake corresponding option:
|
||||
COMMAND | DEFAULT KEY SEQUENCE | CORRESPONDING OPTION
|
||||
Search Directory | Ctrl+Alt+F (F for file) | --directory
|
||||
Search Git Log | Ctrl+Alt+L (L for log) | --git_log
|
||||
Search Git Status | Ctrl+Alt+S (S for status) | --git_status
|
||||
Search History | Ctrl+R (R for reverse) | --history
|
||||
Search Processes | Ctrl+Alt+P (P for process) | --processes
|
||||
Search Variables | Ctrl+V (V for variable) | --variables
|
||||
Override a command's binding by specifying its corresponding option with the desired key
|
||||
sequence. Disable a command's binding by specifying its corresponding option with no value.
|
||||
|
||||
Because fzf_configure_bindings erases bindings it previously installed, it can be cleanly
|
||||
executed multiple times. Once the desired fzf_configure_bindings command has been found, add it
|
||||
to your config.fish in order to persist the customized bindings.
|
||||
|
||||
In terms of validation, fzf_configure_bindings fails if passed unknown options. It expects an
|
||||
equals sign between an option's name and value. However, it does not validate key sequences.
|
||||
|
||||
Pass -h or --help to print this help message and exit.
|
||||
|
||||
EXAMPLES
|
||||
Default bindings but bind Search Directory to Ctrl+F and Search Variables to Ctrl+Alt+V
|
||||
\$ fzf_configure_bindings --directory=\cf --variables=\e\cv
|
||||
Default bindings but disable Search History
|
||||
\$ fzf_configure_bindings --history=
|
||||
An agglomeration of different options
|
||||
\$ fzf_configure_bindings --git_status=\cg --history=\ch --variables= --processes=
|
||||
|
||||
SEE Also
|
||||
To learn more about fish key bindings, see bind(1) and fish_key_reader(1).
|
||||
"
|
||||
end
|
||||
@@ -1,15 +0,0 @@
|
||||
# helper function for _fzf_search_variables
|
||||
function _fzf_extract_var_info --argument-names variable_name set_show_output --description "Extract and reformat lines pertaining to \$variable_name from \$set_show_output."
|
||||
# Extract only the lines about the variable, all of which begin with either
|
||||
# $variable_name: ...or... $variable_name[
|
||||
string match --regex "^\\\$$variable_name(?::|\[).*" <$set_show_output |
|
||||
|
||||
# Strip the variable name prefix, including ": " for scope info lines
|
||||
string replace --regex "^\\\$$variable_name(?:: )?" '' |
|
||||
|
||||
# Distill the lines of values, replacing...
|
||||
# [1]: |value|
|
||||
# ...with...
|
||||
# [1] value
|
||||
string replace --regex ": \|(.*)\|" ' $1'
|
||||
end
|
||||
@@ -1,49 +0,0 @@
|
||||
# helper for _fzf_search_git_status
|
||||
# arg should be a line from git status --short, e.g.
|
||||
# MM functions/_fzf_preview_changed_file.fish
|
||||
# D README.md
|
||||
# R LICENSE -> "New License"
|
||||
function _fzf_preview_changed_file --argument-names path_status --description "Show the git diff of the given file."
|
||||
# remove quotes because they'll be interpreted literally by git diff
|
||||
# no need to requote when referencing $path because fish does not perform word splitting
|
||||
# https://fishshell.com/docs/current/fish_for_bash_users.html
|
||||
set -f path (string unescape (string sub --start 4 $path_status))
|
||||
# first letter of short format shows index, second letter shows working tree
|
||||
# https://git-scm.com/docs/git-status/2.35.0#_short_format
|
||||
set -f index_status (string sub --length 1 $path_status)
|
||||
set -f working_tree_status (string sub --start 2 --length 1 $path_status)
|
||||
|
||||
set -f diff_opts --color=always
|
||||
|
||||
if test $index_status = '?'
|
||||
_fzf_report_diff_type Untracked
|
||||
_fzf_preview_file $path
|
||||
else if contains {$index_status}$working_tree_status DD AU UD UA DU AA UU
|
||||
# Unmerged statuses taken directly from git status help's short format table
|
||||
# Unmerged statuses are mutually exclusive with other statuses, so if we see
|
||||
# these, then safe to assume the path is unmerged
|
||||
_fzf_report_diff_type Unmerged
|
||||
git diff $diff_opts -- $path
|
||||
else
|
||||
if test $index_status != ' '
|
||||
_fzf_report_diff_type Staged
|
||||
|
||||
# renames are only detected in the index, never working tree, so only need to test for it here
|
||||
# https://stackoverflow.com/questions/73954214
|
||||
if test $index_status = R
|
||||
# diff the post-rename path with the original path, otherwise the diff will show the entire file as being added
|
||||
set -f orig_and_new_path (string split --max 1 -- ' -> ' $path)
|
||||
git diff --staged $diff_opts -- $orig_and_new_path[1] $orig_and_new_path[2]
|
||||
# path currently has the form of "original -> current", so we need to correct it before it's used below
|
||||
set path $orig_and_new_path[2]
|
||||
else
|
||||
git diff --staged $diff_opts -- $path
|
||||
end
|
||||
end
|
||||
|
||||
if test $working_tree_status != ' '
|
||||
_fzf_report_diff_type Unstaged
|
||||
git diff $diff_opts -- $path
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -1,43 +0,0 @@
|
||||
# helper function for _fzf_search_directory and _fzf_search_git_status
|
||||
function _fzf_preview_file --description "Print a preview for the given file based on its file type."
|
||||
# because there's no way to guarantee that _fzf_search_directory passes the path to _fzf_preview_file
|
||||
# as one argument, we collect all the arguments into one single variable and treat that as the path
|
||||
set -f file_path $argv
|
||||
|
||||
if test -L "$file_path" # symlink
|
||||
# notify user and recurse on the target of the symlink, which can be any of these file types
|
||||
set -l target_path (realpath "$file_path")
|
||||
|
||||
set_color yellow
|
||||
echo "'$file_path' is a symlink to '$target_path'."
|
||||
set_color normal
|
||||
|
||||
_fzf_preview_file "$target_path"
|
||||
else if test -f "$file_path" # regular file
|
||||
if set --query fzf_preview_file_cmd
|
||||
# need to escape quotes to make sure eval receives file_path as a single arg
|
||||
eval "$fzf_preview_file_cmd '$file_path'"
|
||||
else
|
||||
bat --style=numbers --color=always "$file_path"
|
||||
end
|
||||
else if test -d "$file_path" # directory
|
||||
if set --query fzf_preview_dir_cmd
|
||||
# see above
|
||||
eval "$fzf_preview_dir_cmd '$file_path'"
|
||||
else
|
||||
# -A list hidden files as well, except for . and ..
|
||||
# -F helps classify files by appending symbols after the file name
|
||||
command ls -A -F "$file_path"
|
||||
end
|
||||
else if test -c "$file_path"
|
||||
_fzf_report_file_type "$file_path" "character device file"
|
||||
else if test -b "$file_path"
|
||||
_fzf_report_file_type "$file_path" "block device file"
|
||||
else if test -S "$file_path"
|
||||
_fzf_report_file_type "$file_path" socket
|
||||
else if test -p "$file_path"
|
||||
_fzf_report_file_type "$file_path" "named pipe"
|
||||
else
|
||||
echo "$file_path doesn't exist." >&2
|
||||
end
|
||||
end
|
||||
@@ -1,18 +0,0 @@
|
||||
# helper for _fzf_preview_changed_file
|
||||
# prints out something like
|
||||
# ╭────────╮
|
||||
# │ Staged │
|
||||
# ╰────────╯
|
||||
function _fzf_report_diff_type --argument-names diff_type --description "Print a distinct colored header meant to preface a git patch."
|
||||
# number of "-" to draw is the length of the string to box + 2 for padding
|
||||
set -f repeat_count (math 2 + (string length $diff_type))
|
||||
set -f line (string repeat --count $repeat_count ─)
|
||||
set -f top_border ╭$line╮
|
||||
set -f btm_border ╰$line╯
|
||||
|
||||
set_color yellow
|
||||
echo $top_border
|
||||
echo "│ $diff_type │"
|
||||
echo $btm_border
|
||||
set_color normal
|
||||
end
|
||||
@@ -1,6 +0,0 @@
|
||||
# helper function for _fzf_preview_file
|
||||
function _fzf_report_file_type --argument-names file_path file_type --description "Explain the file type for a file."
|
||||
set_color red
|
||||
echo "Cannot preview '$file_path': it is a $file_type."
|
||||
set_color normal
|
||||
end
|
||||
@@ -1,33 +0,0 @@
|
||||
function _fzf_search_directory --description "Search the current directory. Replace the current token with the selected file paths."
|
||||
# Directly use fd binary to avoid output buffering delay caused by a fd alias, if any.
|
||||
# Debian-based distros install fd as fdfind and the fd package is something else, so
|
||||
# check for fdfind first. Fall back to "fd" for a clear error message.
|
||||
set -f fd_cmd (command -v fdfind || command -v fd || echo "fd")
|
||||
set -f --append fd_cmd --color=always $fzf_fd_opts
|
||||
|
||||
set -f fzf_arguments --multi --ansi $fzf_directory_opts
|
||||
set -f token (commandline --current-token)
|
||||
# expand any variables or leading tilde (~) in the token
|
||||
set -f expanded_token (eval echo -- $token)
|
||||
# unescape token because it's already quoted so backslashes will mess up the path
|
||||
set -f unescaped_exp_token (string unescape -- $expanded_token)
|
||||
|
||||
# If the current token is a directory and has a trailing slash,
|
||||
# then use it as fd's base directory.
|
||||
if string match --quiet -- "*/" $unescaped_exp_token && test -d "$unescaped_exp_token"
|
||||
set --append fd_cmd --base-directory=$unescaped_exp_token
|
||||
# use the directory name as fzf's prompt to indicate the search is limited to that directory
|
||||
set --prepend fzf_arguments --prompt="Directory $unescaped_exp_token> " --preview="_fzf_preview_file $expanded_token{}"
|
||||
set -f file_paths_selected $unescaped_exp_token($fd_cmd 2>/dev/null | _fzf_wrapper $fzf_arguments)
|
||||
else
|
||||
set --prepend fzf_arguments --prompt="Directory> " --query="$unescaped_exp_token" --preview='_fzf_preview_file {}'
|
||||
set -f file_paths_selected ($fd_cmd 2>/dev/null | _fzf_wrapper $fzf_arguments)
|
||||
end
|
||||
|
||||
|
||||
if test $status -eq 0
|
||||
commandline --current-token --replace -- (string escape -- $file_paths_selected | string join ' ')
|
||||
end
|
||||
|
||||
commandline --function repaint
|
||||
end
|
||||
@@ -1,36 +0,0 @@
|
||||
function _fzf_search_git_log --description "Search the output of git log and preview commits. Replace the current token with the selected commit hash."
|
||||
if not git rev-parse --git-dir >/dev/null 2>&1
|
||||
echo '_fzf_search_git_log: Not in a git repository.' >&2
|
||||
else
|
||||
if not set --query fzf_git_log_format
|
||||
# %h gives you the abbreviated commit hash, which is useful for saving screen space, but we will have to expand it later below
|
||||
set -f fzf_git_log_format '%C(bold blue)%h%C(reset) - %C(cyan)%ad%C(reset) %C(yellow)%d%C(reset) %C(normal)%s%C(reset) %C(dim normal)[%an]%C(reset)'
|
||||
end
|
||||
|
||||
set -f preview_cmd 'git show --color=always --stat --patch {1}'
|
||||
if set --query fzf_diff_highlighter
|
||||
set preview_cmd "$preview_cmd | $fzf_diff_highlighter"
|
||||
end
|
||||
|
||||
set -f selected_log_lines (
|
||||
git log --no-show-signature --color=always --format=format:$fzf_git_log_format --date=short | \
|
||||
_fzf_wrapper --ansi \
|
||||
--multi \
|
||||
--scheme=history \
|
||||
--prompt="Git Log> " \
|
||||
--preview=$preview_cmd \
|
||||
--query=(commandline --current-token) \
|
||||
$fzf_git_log_opts
|
||||
)
|
||||
if test $status -eq 0
|
||||
for line in $selected_log_lines
|
||||
set -f abbreviated_commit_hash (string split --field 1 " " $line)
|
||||
set -f full_commit_hash (git rev-parse $abbreviated_commit_hash)
|
||||
set -f --append commit_hashes $full_commit_hash
|
||||
end
|
||||
commandline --current-token --replace (string join ' ' $commit_hashes)
|
||||
end
|
||||
end
|
||||
|
||||
commandline --function repaint
|
||||
end
|
||||
@@ -1,41 +0,0 @@
|
||||
function _fzf_search_git_status --description "Search the output of git status. Replace the current token with the selected file paths."
|
||||
if not git rev-parse --git-dir >/dev/null 2>&1
|
||||
echo '_fzf_search_git_status: Not in a git repository.' >&2
|
||||
else
|
||||
set -f preview_cmd '_fzf_preview_changed_file {}'
|
||||
if set --query fzf_diff_highlighter
|
||||
set preview_cmd "$preview_cmd | $fzf_diff_highlighter"
|
||||
end
|
||||
|
||||
set -f selected_paths (
|
||||
# Pass configuration color.status=always to force status to use colors even though output is sent to a pipe
|
||||
git -c color.status=always status --short |
|
||||
_fzf_wrapper --ansi \
|
||||
--multi \
|
||||
--prompt="Git Status> " \
|
||||
--query=(commandline --current-token) \
|
||||
--preview=$preview_cmd \
|
||||
--nth="2.." \
|
||||
$fzf_git_status_opts
|
||||
)
|
||||
if test $status -eq 0
|
||||
# git status --short automatically escapes the paths of most files for us so not going to bother trying to handle
|
||||
# the few edges cases of weird file names that should be extremely rare (e.g. "this;needs;escaping")
|
||||
set -f cleaned_paths
|
||||
|
||||
for path in $selected_paths
|
||||
if test (string sub --length 1 $path) = R
|
||||
# path has been renamed and looks like "R LICENSE -> LICENSE.md"
|
||||
# extract the path to use from after the arrow
|
||||
set --append cleaned_paths (string split -- "-> " $path)[-1]
|
||||
else
|
||||
set --append cleaned_paths (string sub --start=4 $path)
|
||||
end
|
||||
end
|
||||
|
||||
commandline --current-token --replace -- (string join ' ' $cleaned_paths)
|
||||
end
|
||||
end
|
||||
|
||||
commandline --function repaint
|
||||
end
|
||||
@@ -1,39 +0,0 @@
|
||||
function _fzf_search_history --description "Search command history. Replace the command line with the selected command."
|
||||
# history merge incorporates history changes from other fish sessions
|
||||
# it errors out if called in private mode
|
||||
if test -z "$fish_private_mode"
|
||||
builtin history merge
|
||||
end
|
||||
|
||||
if not set --query fzf_history_time_format
|
||||
# Reference https://devhints.io/strftime to understand strftime format symbols
|
||||
set -f fzf_history_time_format "%m-%d %H:%M:%S"
|
||||
end
|
||||
|
||||
# Delinate time from command in history entries using the vertical box drawing char (U+2502).
|
||||
# Then, to get raw command from history entries, delete everything up to it. The ? on regex is
|
||||
# necessary to make regex non-greedy so it won't match into commands containing the char.
|
||||
set -f time_prefix_regex '^.*? │ '
|
||||
# Delinate commands throughout pipeline using null rather than newlines because commands can be multi-line
|
||||
set -f commands_selected (
|
||||
builtin history --null --show-time="$fzf_history_time_format │ " |
|
||||
_fzf_wrapper --read0 \
|
||||
--print0 \
|
||||
--multi \
|
||||
--scheme=history \
|
||||
--prompt="History> " \
|
||||
--query=(commandline) \
|
||||
--preview="string replace --regex '$time_prefix_regex' '' -- {} | fish_indent --ansi" \
|
||||
--preview-window="bottom:3:wrap" \
|
||||
$fzf_history_opts |
|
||||
string split0 |
|
||||
# remove timestamps from commands selected
|
||||
string replace --regex $time_prefix_regex ''
|
||||
)
|
||||
|
||||
if test $status -eq 0
|
||||
commandline --replace -- $commands_selected
|
||||
end
|
||||
|
||||
commandline --function repaint
|
||||
end
|
||||
@@ -1,32 +0,0 @@
|
||||
function _fzf_search_processes --description "Search all running processes. Replace the current token with the pid of the selected process."
|
||||
# Directly use ps command because it is often aliased to a different command entirely
|
||||
# or with options that dirty the search results and preview output
|
||||
set -f ps_cmd (command -v ps || echo "ps")
|
||||
# use all caps to be consistent with ps default format
|
||||
# snake_case because ps doesn't seem to allow spaces in the field names
|
||||
set -f ps_preview_fmt (string join ',' 'pid' 'ppid=PARENT' 'user' '%cpu' 'rss=RSS_IN_KB' 'start=START_TIME' 'command')
|
||||
set -f processes_selected (
|
||||
$ps_cmd -A -opid,command | \
|
||||
_fzf_wrapper --multi \
|
||||
--prompt="Processes> " \
|
||||
--query (commandline --current-token) \
|
||||
--ansi \
|
||||
# first line outputted by ps is a header, so we need to mark it as so
|
||||
--header-lines=1 \
|
||||
# ps uses exit code 1 if the process was not found, in which case show an message explaining so
|
||||
--preview="$ps_cmd -o '$ps_preview_fmt' -p {1} || echo 'Cannot preview {1} because it exited.'" \
|
||||
--preview-window="bottom:4:wrap" \
|
||||
$fzf_processes_opts
|
||||
)
|
||||
|
||||
if test $status -eq 0
|
||||
for process in $processes_selected
|
||||
set -f --append pids_selected (string split --no-empty --field=1 -- " " $process)
|
||||
end
|
||||
|
||||
# string join to replace the newlines outputted by string split with spaces
|
||||
commandline --current-token --replace -- (string join ' ' $pids_selected)
|
||||
end
|
||||
|
||||
commandline --function repaint
|
||||
end
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user