Score
0
Watch 6 Star 13 Fork 2

oclip / oclip-clientLua

Create your Gitee Account
Explore and code with more than 5 million developers,Free private repositories !:)
Sign up
This repository doesn't specify license. Without author's permission, this code is only for learning and cannot be used for other purposes.
Clone or download
install.sh 706 Bytes
Copy Edit Web IDE Raw Blame History
涵曦 authored 2019-10-28 22:08 . Create install.sh
#!/usr/bin/env bash
config=$HOME/.oclip
cat > $config << EOF
token=$1
passwd=$2
domain=oclip.hanxi.info
EOF
bin=$HOME/.local/bin
mkdir -p $bin
oclip=$bin/oclip
rm -f $oclip
curl -Lo $oclip https://github.com/hanxi/oclip-client/raw/master/platform/linux/oclip 2>/dev/null
chmod +x $oclip
#insert ~/.local/bin into $PATH
old_path_len=${#PATH}
sub_path=${PATH#$bin}
new_path_len=${#sub_path}
#echo $old_path_len
#echo $new_path_len
if [ $old_path_len -eq $new_path_len ]; then
profile=$HOME/.bashrc
touch $profile
bin='$HOME/.local/bin'
sed -i "\:export PATH=\$PATH\:$bin:d" $profile
echo "export PATH=\$PATH:$bin" >> $profile
. $profile
fi
echo 'Hello World.' | oclip -i
oclip -h

Comment ( 0 )

Sign in for post a comment