From e918bec089fbb96d55bc2b7a4ee32a89c3fea9f4 Mon Sep 17 00:00:00 2001 From: honjow Date: Mon, 16 Oct 2023 14:33:38 +0800 Subject: [PATCH] add install scripts --- README.md | 13 ++++++++++--- install.sh | 30 ++++++++++++++++++++++++++++++ package.json | 2 +- 3 files changed, 41 insertions(+), 4 deletions(-) create mode 100644 install.sh diff --git a/README.md b/README.md index c015765..5f2dd84 100644 --- a/README.md +++ b/README.md @@ -2,12 +2,19 @@ 用于[decky-loader](https://github.com/SteamDeckHomebrew/decky-loader)的插件 为安装了[holoiso](https://github.com/theVakhovskeIsTaken/holoiso)的手持设备提供性能设置调整 -## 安装 +## 手动安装 1. 安装[decky-loader](https://github.com/SteamDeckHomebrew/decky-loader) 2. 下载[Releases](https://github.com/Gawah/PowerControl/releases)页面的PowerControl.tar.gz -3. 解压到/home/xxxx/homebrew/plugins/下 -4. 进入游戏模式,即可在decky页面使用该插件 +3. 调整插件目录权限 `chmod -R 777 ${HOME}/homebrew/plugins` +4. 解压到/home/xxxx/homebrew/plugins/下 +5. 重启 decky-loader, `sudo systemctl restart plugin_loader.service` +6. 进入游戏模式,即可在decky页面使用该插件 + +## 一键安装 +``` +curl -L https://raw.githubusercontent.com/mengmeet/PowerControl/main/install.sh | sh +``` ## 功能 1. 开关睿频 diff --git a/install.sh b/install.sh new file mode 100644 index 0000000..feecc7c --- /dev/null +++ b/install.sh @@ -0,0 +1,30 @@ +#!/bin/bash + +# check if jq is installed +if ! [ -x "$(command -v jq)" ]; then + echo 'Error: jq is not installed.' >&2 + exit 1 +fi + +# Download latest release +RELEASE=$(curl -s 'https://api.github.com/repos/mengmeet/PowerControl/releases/latest') +RELEASE_VERSION=$(echo "$RELEASE" | jq -r '.tag_name') +RELEASE_URL=$(echo "$RELEASE" | jq -r '.assets[0].browser_download_url') +curl -L -o /tmp/PowerControl.tar.gz "$RELEASE_URL" + +echo "Installing PowerControl $RELEASE_VERSION" + +# remove old version +chmod -R 777 ${HOME}/homebrew/plugins +rm -rf ${HOME}/homebrew/plugins/PowerControl + +# Extract +tar -xzf /tmp/PowerControl.tar.gz -C ${HOME}/homebrew/plugins + +# Cleanup +rm -f /tmp/PowerControl.tar.gz + +echo "PowerControl $RELEASE_VERSION installed" + +# restart plugin_loader +sudo systemctl restart plugin_loader.service diff --git a/package.json b/package.json index ae15cb8..faf9a87 100755 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "PowerControl", - "version": "2.0.5", + "version": "2.0.7", "description": "PowerControl plugin.", "scripts": { "build": "shx rm -rf dist && rollup -c",