mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-01-21 00:57:24 +08:00
Merge 742f6af6d3 into 1b4497fc8f
This commit is contained in:
commit
c0010d30e3
@ -39,6 +39,7 @@ plugins=(... macos)
|
|||||||
| `rmdsstore` | Remove .DS_Store files recursively in a directory |
|
| `rmdsstore` | Remove .DS_Store files recursively in a directory |
|
||||||
| `btrestart` | Restart the Bluetooth daemon |
|
| `btrestart` | Restart the Bluetooth daemon |
|
||||||
| `freespace` | Erases purgeable disk space with 0s on the selected disk |
|
| `freespace` | Erases purgeable disk space with 0s on the selected disk |
|
||||||
|
| `pbfile` | Copy the file reference to the macOS pasteboard |
|
||||||
|
|
||||||
## Acknowledgements
|
## Acknowledgements
|
||||||
|
|
||||||
|
|||||||
@ -314,3 +314,19 @@ source "${0:h:A}/music"
|
|||||||
|
|
||||||
# Spotify control function
|
# Spotify control function
|
||||||
source "${0:h:A}/spotify"
|
source "${0:h:A}/spotify"
|
||||||
|
|
||||||
|
# Copy file to the macOS pasteboard
|
||||||
|
function pbfile() {
|
||||||
|
if [[ $# -ne 1 ]]; then
|
||||||
|
echo "Usage: pbfile <file>"
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ ! -e "$1" ]]; then
|
||||||
|
echo "File not found: $1"
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
osascript -e "tell application \"Finder\" to set the clipboard to (POSIX file \"$(realpath "$1")\")"
|
||||||
|
echo "Copied $1 to pasteboard"
|
||||||
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user