-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- 增加预装软件 galculator curl python3-numpy - 预装x11vnc及用来设置开关密码的set-vnc指令 - 增加运行前先对电脑安装的软件 - 安装blinka时增加出错后重试机制 - 多加一些报错即退出的检测位置
- Loading branch information
Showing
14 changed files
with
166 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,6 +13,8 @@ bash-completion | |
systemd-timesyncd | ||
parted | ||
wget | ||
curl | ||
fdisk | ||
|
||
fbterm | ||
locales | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
jedi | ||
numpy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#!/bin/bash | ||
|
||
_set-vnc () { | ||
local cur=${COMP_WORDS[COMP_CWORD]} | ||
if [ $COMP_CWORD -eq 1 ]; then | ||
local functions=$(grep -oP '^[^_]\w+\s*\(\)' /usr/bin/set-vnc | sed 's/()//') | ||
COMPREPLY=($(compgen -W "$functions" -- $cur)) | ||
fi | ||
} | ||
complete -F _set-vnc set-vnc | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
#!/bin/bash | ||
|
||
-h() { | ||
echo -e "\n" | ||
echo -e "set-vnc enable :" | ||
echo -e " enable the x11vnc service \n" | ||
|
||
echo -e "set-vnc disable :" | ||
echo -e " disable the x11vnc service \n" | ||
|
||
echo -e "set-vnc password [newpassword] :" | ||
echo -e " set the x11vnc connect password " | ||
echo -e " examples: \n\tset-vnc password pi\n" | ||
|
||
echo -e "set-vnc port [newport] :" | ||
echo -e " set the x11vnc connect port" | ||
echo -e " examples: \n\tset-vnc port 5900\n" | ||
|
||
} | ||
enable() { | ||
systemctl enable x11vnc.service | ||
echo -e "\n\nplease reboot\n" | ||
} | ||
|
||
disable() { | ||
systemctl disable x11vnc.service | ||
echo -e "\n\nplease reboot\n" | ||
} | ||
password() { | ||
if [ ! -z "$1" ]; then | ||
x11vnc -storepasswd $1 /etc/x11vnc.pwd | ||
else | ||
echo "Command error!" | ||
fi | ||
} | ||
port() { | ||
|
||
if [[ $1 =~ ^[0-9]{1,5}$ ]]; then | ||
sed -i -r "s/(-rfbport[[:space:]]{1,5})[0-9]{1,5}/\1$1/" /lib/systemd/system/x11vnc.service | ||
echo "ok" | ||
else | ||
echo "Command error!" | ||
fi | ||
echo -e "\n\nplease reboot\n" | ||
|
||
|
||
|
||
} | ||
FUNCTION_NAME=$1 | ||
VALUE=$2 | ||
|
||
|
||
# 检查是否有同名的函数 | ||
if declare -F "$FUNCTION_NAME" >/dev/null; then | ||
$FUNCTION_NAME $VALUE | ||
else | ||
-h | ||
fi | ||
|
||
# set-vnc enable | ||
# set-vnc disable | ||
# set-vnc password | ||
# set-vnc port |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
[Unit] | ||
Description=Expand partition size | ||
After=graphical.target | ||
|
||
[Service] | ||
Type=oneshot | ||
ExecStart=x11vnc -display :0 -auth guess -rfbport 5900 -rfbauth /etc/x11vnc.pwd -capslock -nomodtweak -repeat -forever | ||
RemainAfterExit=yes | ||
StandardOutput=null | ||
|
||
[Install] | ||
WantedBy=graphical.target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
PATH_PWD="$(dirname "$(realpath "${BASH_SOURCE[0]}")")" | ||
|
||
mv set-vnc /usr/bin/ | ||
chmod +x /usr/bin/set-vnc | ||
|
||
mv completion-set-vnc /etc/bash_completion.d/set-vnc | ||
chmod +x /etc/bash_completion.d/set-vnc | ||
# source /etc/bash_completion.d/set-vnc | ||
|
||
bash_str="source /etc/bash_completion.d/set-vnc" | ||
if ! grep -q ${bash_str} /etc/bash.bashrc; then | ||
echo ${bash_str} >> /etc/bash.bashrc | ||
fi | ||
mv x11vnc.service /lib/systemd/system/ | ||
x11vnc -storepasswd pi /etc/x11vnc.pwd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters