mirror of
https://github.com/kxgx/2.13-Ink-screen-clock.git
synced 2026-03-15 07:03:16 +08:00
Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2d9959cd77 | ||
|
|
10f8b8182b | ||
|
|
469aec331a | ||
|
|
a8247c1932 | ||
|
|
f37acd5a20 | ||
|
|
6836c448be | ||
|
|
2efc2c4f5d | ||
|
|
01f62f696b |
22
README.md
22
README.md
@@ -66,6 +66,7 @@ sudo reboot
|
||||
--zh 设置系统语言为zh_CN,UTF-8
|
||||
--cn 替换apt镜像源为中国镜像源
|
||||
--gitcn 克隆中国仓库
|
||||
--pip-offline pip依赖离线安装
|
||||
--pisugar-wifi-conf 安装pisugar-wifi-conf
|
||||
--pisugar-power-manager 安装pisugar-power-manager
|
||||
--version <tag> 版本号(使用方法 --version + 仓库标签,格式例如 v1.x.x ,可以是主仓库main)
|
||||
@@ -73,22 +74,29 @@ sudo reboot
|
||||
```
|
||||
###
|
||||
```Bash
|
||||
#中国源默认设置
|
||||
#中国源默认设置(不加参数)
|
||||
curl -sSL https://gitee.com/xingguangk/2.13-Ink-screen-clock/raw/main/bin/install.sh | sudo bash
|
||||
```
|
||||
```Bash
|
||||
#中国源全参数设置(不使用--debug参数)
|
||||
curl -sSL https://gitee.com/xingguangk/2.13-Ink-screen-clock/raw/main/bin/install.sh | sudo bash -s -- --zh --cn --gitcn --pisugar-power-manager --pisugar-wifi-conf --version <tag>
|
||||
#中国源参数设置(不使用--debug参数,替换cn镜像源,pip在线安装,不安装pisugar)
|
||||
curl -sSL https://gitee.com/xingguangk/2.13-Ink-screen-clock/raw/main/bin/install.sh | sudo bash -s -- --zh --cn --gitcn --version <tag>
|
||||
```
|
||||
```Bash
|
||||
#默认源默认设置
|
||||
#中国源参数设置(不使用--debug参数,替换cn镜像源,pip依赖离线安装,不安装pisugar)
|
||||
curl -sSL https://gitee.com/xingguangk/2.13-Ink-screen-clock/raw/main/bin/install.sh | sudo bash -s -- --zh --cn --gitcn --pip-offline --version <tag>
|
||||
```
|
||||
```Bash
|
||||
#默认源默认设置(不加参数)
|
||||
curl -sSL https://github.com/kxgx/2.13-Ink-screen-clock/raw/main/bin/install.sh | sudo bash
|
||||
```
|
||||
```Bash
|
||||
#默认源全参数设置(不使用--debug参数)
|
||||
curl -sSL https://github.com/kxgx/2.13-Ink-screen-clock/raw/main/bin/install.sh | sudo bash -s -- --zh --cn --gitcn --pisugar-power-manager --pisugar-wifi-conf --version <tag>
|
||||
#默认源默认设置(不使用--debug参数,替换cn镜像源,pip在线安装,不安装pisugar)
|
||||
curl -sSL https://github.com/kxgx/2.13-Ink-screen-clock/raw/main/bin/install.sh | sudo bash -s -- --zh --cn --gitcn --version <tag>
|
||||
```
|
||||
```Bash
|
||||
#默认源默认设置(不使用--debug参数,替换cn镜像源,pip依赖离线安装,不安装pisugar)
|
||||
curl -sSL https://github.com/kxgx/2.13-Ink-screen-clock/raw/main/bin/install.sh | sudo bash -s -- --zh --cn --gitcn --pip-offline --version <tag>
|
||||
```
|
||||
|
||||
## 需要安装的软件和依赖:
|
||||
参考
|
||||
微雪电子 https://www.waveshare.net/wiki/2.13inch_e-Paper_HAT+#Raspberry_Pi
|
||||
|
||||
@@ -18,6 +18,8 @@ USE_CN_GIT=false
|
||||
USE_PISUGAR_WIFI_CONF=false
|
||||
# 检查是否安装pisugar-power-manager
|
||||
USE_PISUGAR_POWER_MANAGER=false
|
||||
# 检查是否使用离线安装pip依赖
|
||||
USE_OFFLINE_PIP=false
|
||||
|
||||
# 解析命令行参数
|
||||
while [ "$#" -gt 0 ]; do
|
||||
@@ -31,6 +33,9 @@ while [ "$#" -gt 0 ]; do
|
||||
--gitcn)
|
||||
USE_CN_GIT=true
|
||||
;;
|
||||
--pip-offline)
|
||||
USE_OFFLINE_PIP=true
|
||||
;;
|
||||
--pisugar-wifi-conf)
|
||||
USE_PISUGAR_WIFI_CONF=true
|
||||
;;
|
||||
@@ -203,23 +208,7 @@ install_packages() {
|
||||
fi
|
||||
}
|
||||
|
||||
# 安装pip包函数
|
||||
install_pip_packages() {
|
||||
echo "正在安装pip软件包"
|
||||
if ! sudo pip3 install -i "$PIPY_MIRROR" spidev borax pillow requests Flask; then
|
||||
echo "pip软件包安装失败,如果是最新版系统或是非lite系统" >&2
|
||||
echo "请手动运行sudo pip3 install -i "$PIPY_MIRROR" spidev borax pillow requests --break-system-packages" >&2
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
# 复制服务文件并设置为开机启动
|
||||
setup_service() {
|
||||
local service_path="raspi_e-Paper.service"
|
||||
local service1_path="e-Paper_clean.service"
|
||||
local service_file_path="$HOME/2.13-Ink-screen-clock/bin/$service_path"
|
||||
local service1_file_path="$HOME/2.13-Ink-screen-clock/bin/$service1_path"
|
||||
|
||||
install_Ink-screen-clock() {
|
||||
# 检查墨水屏时钟仓库是否存在
|
||||
if [ ! -d "$HOME/2.13-Ink-screen-clock" ]; then
|
||||
echo "正在克隆仓库"
|
||||
@@ -234,6 +223,41 @@ setup_service() {
|
||||
else
|
||||
echo "仓库文件夹已存在,跳过克隆"
|
||||
fi
|
||||
}
|
||||
|
||||
# 安装pip包函数
|
||||
install_oline_pip_packages() {
|
||||
echo "正在安装pip软件包"
|
||||
if ! sudo pip3 install -i "$PIPY_MIRROR" -r "$HOME/2.13-Ink-screen-clock/bin/requirements.txt"; then
|
||||
echo "pip软件包安装失败,如果是最新版系统或是非lite系统" >&2
|
||||
echo "请手动运行sudo pip3 install -i "$PIPY_MIRROR" -r "$HOME/2.13-Ink-screen-clock/bin/requirements.txt" --break-system-packages" >&2
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
install_offline_pip_packages() {
|
||||
echo "正在安装pip软件包"
|
||||
if ! sudo pip3 install --no-index --find-links="$HOME/2.13-Ink-screen-clock/bin/vendor" -r "$HOME/2.13-Ink-screen-clock/bin/requirements.txt"; then
|
||||
echo "pip软件包安装失败,如果是最新版系统或是非lite系统" >&2
|
||||
echo "请手动运行sudo pip3 install --no-index --find-links="$HOME/2.13-Ink-screen-clock/bin/vendor" -r "$HOME/2.13-Ink-screen-clock/bin/requirements.txt" --break-system-packages" >&2
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
install_pip_packages() {
|
||||
if [ "$USE_OFFLINE_PIP" = true ]; then
|
||||
install_offline_pip_packages
|
||||
else
|
||||
install_oline_pip_packages
|
||||
fi
|
||||
}
|
||||
|
||||
# 复制服务文件并设置为开机启动
|
||||
setup_service() {
|
||||
local service_path="raspi_e-Paper.service"
|
||||
local service1_path="e-Paper_clean.service"
|
||||
local service_file_path="$HOME/2.13-Ink-screen-clock/bin/$service_path"
|
||||
local service1_file_path="$HOME/2.13-Ink-screen-clock/bin/$service1_path"
|
||||
|
||||
# 检查服务文件是否存在
|
||||
if [ -f "$service_file_path" ] && [ -f "$service1_file_path" ]; then
|
||||
@@ -306,6 +330,7 @@ if [ -f /etc/debian_version ]; then
|
||||
echo "执行Debian 11 (Bullseye) 相关操作"
|
||||
update_sources_list "bullseye"
|
||||
install_packages
|
||||
install_Ink-screen-clock
|
||||
install_pip_packages
|
||||
setup_service
|
||||
#install_webui
|
||||
@@ -316,6 +341,7 @@ if [ -f /etc/debian_version ]; then
|
||||
echo "执行Debian 12 (Bookworm) 相关操作"
|
||||
update_sources_list "bookworm"
|
||||
install_packages
|
||||
install_Ink-screen-clock
|
||||
install_pip_packages
|
||||
setup_service
|
||||
#install_webui
|
||||
|
||||
8
bin/requirements.txt
Normal file
8
bin/requirements.txt
Normal file
@@ -0,0 +1,8 @@
|
||||
borax==4.1.2
|
||||
certifi==2025.1.31
|
||||
charset-normalizer==3.4.1
|
||||
idna==3.10
|
||||
pillow==11.1.0
|
||||
requests==2.32.3
|
||||
spidev==3.6
|
||||
urllib3==2.3.0
|
||||
BIN
bin/vendor/borax-4.1.2-py3-none-any.whl
vendored
Normal file
BIN
bin/vendor/borax-4.1.2-py3-none-any.whl
vendored
Normal file
Binary file not shown.
BIN
bin/vendor/certifi-2025.1.31-py3-none-any.whl
vendored
Normal file
BIN
bin/vendor/certifi-2025.1.31-py3-none-any.whl
vendored
Normal file
Binary file not shown.
BIN
bin/vendor/charset_normalizer-3.4.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
vendored
Normal file
BIN
bin/vendor/charset_normalizer-3.4.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
vendored
Normal file
Binary file not shown.
BIN
bin/vendor/idna-3.10-py3-none-any.whl
vendored
Normal file
BIN
bin/vendor/idna-3.10-py3-none-any.whl
vendored
Normal file
Binary file not shown.
BIN
bin/vendor/pillow-11.1.0-cp39-cp39-manylinux_2_28_aarch64.whl
vendored
Normal file
BIN
bin/vendor/pillow-11.1.0-cp39-cp39-manylinux_2_28_aarch64.whl
vendored
Normal file
Binary file not shown.
BIN
bin/vendor/requests-2.32.3-py3-none-any.whl
vendored
Normal file
BIN
bin/vendor/requests-2.32.3-py3-none-any.whl
vendored
Normal file
Binary file not shown.
BIN
bin/vendor/spidev-3.6.tar.gz
vendored
Normal file
BIN
bin/vendor/spidev-3.6.tar.gz
vendored
Normal file
Binary file not shown.
BIN
bin/vendor/urllib3-2.3.0-py3-none-any.whl
vendored
Normal file
BIN
bin/vendor/urllib3-2.3.0-py3-none-any.whl
vendored
Normal file
Binary file not shown.
Reference in New Issue
Block a user