mirror of
https://github.com/tumillanino/miasma-os.git
synced 2026-04-11 07:15:31 +00:00
moved etc into usr folder
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
# copyfile plugin
|
||||
|
||||
Puts the contents of a file in your system clipboard so you can paste it anywhere.
|
||||
|
||||
To use, add `copyfile` to your plugins array:
|
||||
|
||||
```zsh
|
||||
plugins=(... copyfile)
|
||||
```
|
||||
|
||||
Then you can run the command `copyfile <filename>` to copy the file named `filename`.
|
||||
@@ -0,0 +1,19 @@
|
||||
# Copies the contents of a given file to the system or X Windows clipboard
|
||||
#
|
||||
# Usage: copyfile <file>
|
||||
function copyfile {
|
||||
emulate -L zsh
|
||||
|
||||
if [[ -z "$1" ]]; then
|
||||
echo "Usage: copyfile <file>"
|
||||
return 1
|
||||
fi
|
||||
|
||||
if [[ ! -f "$1" ]]; then
|
||||
echo "Error: '$1' is not a valid file."
|
||||
return 1
|
||||
fi
|
||||
|
||||
clipcopy $1
|
||||
echo ${(%):-"%B$1%b copied to clipboard."}
|
||||
}
|
||||
Reference in New Issue
Block a user