This commit is contained in:
Anton 2025-12-02 10:07:11 -03:00 committed by GitHub
commit dcffffa74e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 17 additions and 0 deletions

View file

@ -39,6 +39,7 @@ plugins=(... macos)
| `rmdsstore` | Remove .DS_Store files recursively in a directory |
| `btrestart` | Restart the Bluetooth daemon |
| `freespace` | Erases purgeable disk space with 0s on the selected disk |
| `pbfile` | Copy the file reference to the macOS pasteboard |
## Acknowledgements

View file

@ -314,3 +314,19 @@ source "${0:h:A}/music"
# Spotify control function
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"
}