-
Notifications
You must be signed in to change notification settings - Fork 50
/
install-GUI.sh
84 lines (69 loc) · 3.17 KB
/
install-GUI.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
#!/bin/bash
# A simple script to install the rEFInd customization GUI
sudo steamos-readonly disable
echo -e "Installing SteamDeck rEFInd...\n"
CURRENT_WD=$(pwd)
mkdir -p $HOME/.local/SteamDeck_rEFInd
cp -rf $CURRENT_WD/GUI/ $HOME/.local/SteamDeck_rEFInd
cp -rf $CURRENT_WD/icons/ $HOME/.local/SteamDeck_rEFInd
cp -rf $CURRENT_WD/backgrounds/ $HOME/.local/SteamDeck_rEFInd
cp -rf $CURRENT_WD/scripts/ $HOME/.local/SteamDeck_rEFInd
cp -f $CURRENT_WD/refind-GUI.conf $HOME/.local/SteamDeck_rEFInd/GUI/refind.conf
chmod +x $HOME/.local/SteamDeck_rEFInd/scripts/*.sh
#Clean up old installation...
ls -l $HOME/.SteamDeck_rEFInd
OLD_INSTALL_FOUND=$?
if [ $OLD_INSTALL_FOUND == 0 ]; then
rm -rf $HOME/.SteamDeck_rEFInd
fi
#Clean up old icon...
ls -l $HOME/Desktop/refind_GUI.desktop
OLD_ICON_FOUND=$?
if [ $OLD_ICON_FOUND == 0 ]; then
rm -f $HOME/Desktop/refind_GUI.desktop
fi
# Thanks to Maclay74 steam-patch for the following syntax
RELEASE=$(curl -s 'https://api.github.com/repos/jlobue10/SteamDeck_rEFInd/releases' | jq -r "first(.[] | select(.prerelease == "false"))")
VERSION=$(jq -r '.tag_name' <<< ${RELEASE} )
DOWNLOAD_URL=$(jq -r '.assets[].browser_download_url | select(endswith("x86_64.pkg.tar.zst"))' <<< ${RELEASE})
printf "Installing version %s...\n" "${VERSION}"
wget $DOWNLOAD_URL
sudo pacman -Qs SteamDeck_rEFInd
STEAMDECK_REFIND_STATUS=$?
if [ $STEAMDECK_REFIND_STATUS == 0 ]; then
sudo pacman -R --noconfirm SteamDeck_rEFInd
fi
ls -l /etc/systemd/system/bootnext-refind.service
OLD_REFIND_SERVICE=$?
if [ $OLD_REFIND_SERVICE == 0 ]; then
sudo systemctl disable --now bootnext-refind.service
# Force removing old service file from previous versions
echo -e "\nRemoving old bootnext-refind.servce\n"
sudo rm /etc/systemd/system/bootnext-refind.service
fi
ls -l /etc/systemd/system/rEFInd_bg_randomizer.service
OLD_BGRAND_SERVICE=$?
if [ $OLD_BGRAND_SERVICE == 0 ]; then
sudo systemctl disable --now rEFInd_bg_randomizer.service
# Force removing old service file from previous versions
echo -e "\nRemoving old rEFInd_bg_randomizer.service\n"
sudo rm /etc/systemd/system/rEFInd_bg_randomizer.service
fi
INSTALL_PKG="$(ls | grep pkg.tar.zst)"
sudo pacman -U --noconfirm $INSTALL_PKG
# Leaving passwordless sudo stuff to try to fix another day...
#Create file for passwordless sudo for config file, background and icon installation
#cat > $HOME/.local/SteamDeck_rEFInd/install_config_from_GUI <<EOF
#$USER ALL = NOPASSWD: /usr/bin/install_config_from_GUI.sh
#EOF
#chmod 0666 $HOME/.local/SteamDeck_rEFInd/install_config_from_GUI
#sudo cp $HOME/.local/SteamDeck_rEFInd/install_config_from_GUI /etc/sudoers.d 2>/dev/null
sudo systemctl daemon-reload
sudo systemctl enable --now bootnext-refind.service
sudo steamos-readonly enable
cp -f /usr/bin/SteamDeck_rEFInd $HOME/.local/SteamDeck_rEFInd/GUI/SteamDeck_rEFInd
cp -f /usr/share/applications/SteamDeck_rEFInd.desktop $HOME/.local/SteamDeck_rEFInd/GUI/SteamDeck_rEFInd.desktop
cp -f $HOME/.local/SteamDeck_rEFInd/GUI/SteamDeck_rEFInd.desktop $HOME/Desktop/SteamDeck_rEFInd.desktop
chmod +x $HOME/.local/SteamDeck_rEFInd/GUI/SteamDeck_rEFInd.desktop
chmod +x $HOME/Desktop/SteamDeck_rEFInd.desktop
echo -e "Installation complete...\n"