feat(just): combine install decky and get alt handheld recipes to setup-decky

This commit is contained in:
HikariKnight 2024-02-29 15:56:06 +01:00
parent 9ec3dcfaee
commit 4ad5e4023d

View File

@ -1,37 +1,58 @@
# vim: set ft=make :
# Install Decky Loader (https://github.com/SteamDeckHomebrew/decky-loader)
get-decky:
#!/usr/bin/bash
export HOME=$(getent passwd ${SUDO_USER:-$USER} | cut -d: -f6)
curl -L https://github.com/SteamDeckHomebrew/decky-installer/releases/latest/download/install_release.sh | sh
sudo chcon -R -t bin_t $HOME/homebrew/services/PluginLoader
# Install SimpleDeckyTDP, a simple TDP plugin for alternative PC handhelds
get-simpledeckytdp:
#!/usr/bin/bash
# Install and configure Decky Loader (https://github.com/SteamDeckHomebrew/decky-loader) and plugins for alternative handhelds
setup-decky ACTION="":
#!/bin/bash
source /usr/lib/ujust/ujust.sh
DECKY_STATE="${b}${red}Not Installed${n}"
if [[ -d $HOME/homebrew/plugins ]]; then
sudo rm -rf $HOME/homebrew/plugins/SimpleDeckyTDP
curl -L $(curl -s https://api.github.com/repos/aarron-lee/SimpleDeckyTDP/releases/latest | grep "browser_download_url" | cut -d '"' -f 4) -o /tmp/SimpleDeckyTDP.tar.gz
sudo tar -xzf /tmp/SimpleDeckyTDP.tar.gz -C $HOME/homebrew/plugins
rm /tmp/SimpleDeckyTDP.tar.gz
sudo sed -i 's/ENABLE_HARDWARE_CONTROL_ON_NON_DECK_HARDWARE=0/ENABLE_HARDWARE_CONTROL_ON_NON_DECK_HARDWARE=1/g' /etc/default/steam-hardware-control
echo 'Installed. Please reboot to apply needed changes.'
else
echo 'Please install Decky Loader by running ujust get-decky first.'
DECKY_STATE="${b}${green}Installed${n}"
fi
# Install HHD Decky Plugin for controlling input on the Lenovo Legion Go and ASUS Ally
get-hhd-decky:
#!/usr/bin/bash
if [[ -d $HOME/homebrew/plugins ]]; then
sudo rm -rf $HOME/homebrew/plugins/hhd-decky
curl -L $(curl -s https://api.github.com/repos/hhd-dev/hhd-decky/releases/latest | grep "browser_download_url" | cut -d '"' -f 4) -o /tmp/hhd-decky.tar.gz
sudo tar -xzf /tmp/hhd-decky.tar.gz -C $HOME/homebrew/plugins
rm /tmp/hhd-decky.tar.gz
echo 'Installed.'
else
echo 'Please install Decky Loader by running ujust get-decky first.'
OPTION={{ ACTION }}
if [ "$OPTION" == "help" ]; then
echo "Usage: ujust configure-watchdog <option>"
echo " <option>: Specify the quick option to skip the prompt"
echo " Use 'install' to select Install Decky"
echo " Use 'simpledeckytdp' to select Get SimpleDeckyTDP"
echo " Use 'hhd-decky' to select Get HHD-decky"
exit 0
elif [ "$OPTION" == "" ]; then
echo "${bold}Setup Decky Loader${normal}"
echo "This lets you setup decky and install some decky plugins for alternative handhelds"
echo "Tip: CTRL+Click on the plugin name to visit the project page for more info"
echo "Decky Loader is $DECKY_STATE"
OPTION=$(
Choose \
"Install Decky" \
"Get $(Urllink "https://github.com/aarron-lee/SimpleDeckyTDP" SimpleDeckyTDP)${n}" \
"Get $(Urllink "https://github.com/hhd-dev/hhd-decky" HHD-Decky)${n}"
)
fi
if [[ "${OPTION,,}" =~ install ]]; then
export HOME=$(getent passwd ${SUDO_USER:-$USER} | cut -d: -f6)
curl -L https://github.com/SteamDeckHomebrew/decky-installer/releases/latest/download/install_release.sh | sh
sudo chcon -R -t bin_t $HOME/homebrew/services/PluginLoader
elif [[ "${OPTION,,}" =~ simpledeckytdp ]]; then
if [[ -d $HOME/homebrew/plugins ]]; then
sudo rm -rf $HOME/homebrew/plugins/SimpleDeckyTDP
curl -L $(curl -s https://api.github.com/repos/aarron-lee/SimpleDeckyTDP/releases/latest | grep "browser_download_url" | cut -d '"' -f 4) -o /tmp/SimpleDeckyTDP.tar.gz
sudo tar -xzf /tmp/SimpleDeckyTDP.tar.gz -C $HOME/homebrew/plugins
rm /tmp/SimpleDeckyTDP.tar.gz
sudo sed -i 's/ENABLE_HARDWARE_CONTROL_ON_NON_DECK_HARDWARE=0/ENABLE_HARDWARE_CONTROL_ON_NON_DECK_HARDWARE=1/g' /etc/default/steam-hardware-control
echo 'Installed. Please reboot to apply needed changes.'
else
echo 'Please install Decky Loader by running "ujust setup-decky install" first.'
fi
elif [[ "${OPTION,,}" =~ hhd-decky ]]; then
if [[ -d $HOME/homebrew/plugins ]]; then
sudo rm -rf $HOME/homebrew/plugins/hhd-decky
curl -L $(curl -s https://api.github.com/repos/hhd-dev/hhd-decky/releases/latest | grep "browser_download_url" | cut -d '"' -f 4) -o /tmp/hhd-decky.tar.gz
sudo tar -xzf /tmp/hhd-decky.tar.gz -C $HOME/homebrew/plugins
rm /tmp/hhd-decky.tar.gz
echo 'Installed.'
else
echo 'Please install Decky Loader by running "ujust setup-decky install" first.'
fi
fi
# Install ROG Ally Theme for CSS Loader (https://github.com/semakusut/SBP-ROG-Ally)