Lines 2-21
Link Here
|
2 |
# This file is licensed under the GPLv2+. Please see COPYING for more information. |
2 |
# This file is licensed under the GPLv2+. Please see COPYING for more information. |
3 |
|
3 |
|
4 |
clip() { |
4 |
clip() { |
5 |
before="$(pbpaste | openssl base64)" |
5 |
before="$(pbpaste | base64)" |
6 |
echo -n "$1" | pbcopy |
6 |
echo -n "$1" | pbcopy |
7 |
( |
7 |
( |
8 |
sleep 45 |
8 |
sleep 45 |
9 |
now="$(pbpaste | openssl base64)" |
9 |
now="$(pbpaste | base64)" |
10 |
if [[ $now != $(echo -n "$1" | openssl base64) ]]; then |
10 |
if [[ $now != $(echo -n "$1" | base64) ]]; then |
11 |
before="$now" |
11 |
before="$now" |
12 |
fi |
12 |
fi |
13 |
echo "$before" | openssl base64 -d | pbcopy |
13 |
echo "$before" | base64 -d | pbcopy |
14 |
) & disown |
14 |
) & disown |
15 |
echo "Copied $2 to clipboard. Will clear in 45 seconds." |
15 |
echo "Copied $2 to clipboard. Will clear in 45 seconds." |
16 |
} |
16 |
} |
17 |
|
17 |
|
18 |
tmpdir() { |
18 |
tmpdir() { |
|
|
19 |
PATH="${PATH}:/sbin:/usr/sbin" |
19 |
cleanup_tmp() { |
20 |
cleanup_tmp() { |
20 |
[[ -d $tmp_dir ]] || return |
21 |
[[ -d $tmp_dir ]] || return |
21 |
rm -rf "$tmp_file" "$tmp_dir" 2>/dev/null |
22 |
rm -rf "$tmp_file" "$tmp_dir" 2>/dev/null |
Lines 31-34
Link Here
|
31 |
mount -t hfs -o noatime -o nobrowse "$ramdisk_dev" "$tmp_dir" || exit 1 |
32 |
mount -t hfs -o noatime -o nobrowse "$ramdisk_dev" "$tmp_dir" || exit 1 |
32 |
} |
33 |
} |
33 |
|
34 |
|
34 |
GETOPT="$(brew --prefix gnu-getopt 2>/dev/null || echo /usr/local)/bin/getopt" |
35 |
GETOPT="getopt-long" |