generated from SteamDeckHomebrew/decky-plugin-template
-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
41 additions
and
4 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
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