Add a simple clipboard script
This commit is contained in:
parent
9aa4217f7a
commit
be2989f582
1 changed files with 26 additions and 0 deletions
26
q-clipboard
Executable file
26
q-clipboard
Executable file
|
@ -0,0 +1,26 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
|
||||||
|
if [[ -z "$@" ]]; then
|
||||||
|
echo "^c .*$"
|
||||||
|
elif [[ "$1" == "--hint" ]]; then
|
||||||
|
shift
|
||||||
|
if [[ -f ~/.clipboard.txt ]]; then
|
||||||
|
cat ~/.clipboard.txt | tac
|
||||||
|
fi
|
||||||
|
elif [[ "$1" == "--complete" ]]; then
|
||||||
|
shift
|
||||||
|
if [[ -f ~/.clipboard.txt ]]; then
|
||||||
|
cat ~/.clipboard.txt | tac
|
||||||
|
fi
|
||||||
|
elif [[ "$1" == "--preview" ]]; then
|
||||||
|
shift
|
||||||
|
echo "$1" | base64 -d
|
||||||
|
elif [[ "$1" == "--run" ]]; then
|
||||||
|
shift
|
||||||
|
TEXT="$(echo "$1" | base64 -d)"
|
||||||
|
echo "$TEXT"
|
||||||
|
echo -n "$TEXT" | (nohup wl-copy -n 2>/dev/null &)
|
||||||
|
else
|
||||||
|
echo "Unexpected arguments: $@"
|
||||||
|
fi
|
Loading…
Reference in a new issue