33# functions
44
55patch_nv () {
6- PATCH_CONTENT=$( < " ${HOME} /patch-nvidia" )
7- if grep -Fxf " $PATCH_CONTENT " " $DEST_FILE " > /dev/null; then
8- whiptail --title " Shader Booster" --msgbox " System already patched. Nothing to do" 8 78
9- rm ${HOME} /patch-nvidia
10- exit 0
11- else
12- cat " ${HOME} /patch-nvidia" >> " $DEST_FILE "
13- whiptail --title " Shader Booster" --msgbox " Success! Reboot to apply." 8 78
14- rm ${HOME} /patch-nvidia
15- exit 0
16- fi
6+
7+ cat " ${HOME} /patch-nvidia" >> " ${DEST_FILE} "
8+ whiptail --title " Shader Booster" --msgbox " Success! Reboot to apply." 8 78
9+ rm ${HOME} /patch-nvidia
10+ exit 0
11+
1712}
1813patch_mesa () {
19- PATCH_CONTENT=$( < " $HOME /patch-mesa" )
20- if grep -Fxf " $PATCH_CONTENT " " $DEST_FILE " > /dev/null; then
21- whiptail --title " Shader Booster" --msgbox " System already patched. Nothing to do" 8 78
22- rm ${HOME} /patch-mesa
23- exit 0
24- else
25- cat " ${HOME} /patch-mesa" >> " $DEST_FILE "
26- whiptail --title " Shader Booster" --msgbox " Success! Reboot to apply." 8 78
27- rm ${HOME} /patch-mesa
28- exit 0
29- fi
14+
15+ cat " ${HOME} /patch-mesa" >> " ${DEST_FILE} "
16+ whiptail --title " Shader Booster" --msgbox " Success! Reboot to apply." 8 78
17+ rm ${HOME} /patch-mesa
18+ exit 0
19+
3020}
3121
3222# runtime
3323
3424sudo apt install wget whiptail
3525GPU=$( lspci | grep -i ' .* vga .* nvidia .*' )
36- if [[ -f " $HOME /.bash_profile" ]]; then
37- DEST_FILE=" $HOME /.bash_profile"
26+ if [[ -f " ${ HOME} /.bash_profile" ]]; then
27+ DEST_FILE=" ${ HOME} /.bash_profile"
3828 if [[ $GPU == * ' nvidia ' * ]]; then
3929 cd $HOME
4030 wget -O patch-nvidia https://raw.githubusercontent.com/psygreg/shader-booster/refs/heads/main/patch-nvidia;
@@ -45,7 +35,7 @@ if [[ -f "$HOME/.bash_profile" ]]; then
4535 patch_mesa
4636 fi
4737elif [[ -f " $HOME /.profile" ]]; then
48- DEST_FILE=" $HOME /.profile"
38+ DEST_FILE=" ${ HOME} /.profile"
4939 if [[ $GPU == * ' nvidia ' * ]]; then
5040 cd $HOME
5141 wget -O patch-nvidia https://raw.githubusercontent.com/psygreg/shader-booster/refs/heads/main/patch-nvidia;
@@ -56,7 +46,7 @@ elif [[ -f "$HOME/.profile" ]]; then
5646 patch_mesa
5747 fi
5848elif [[ -f " $HOME /.zshrc" ]]; then
59- DEST_FILE=" $HOME /.zshrc"
49+ DEST_FILE=" ${ HOME} /.zshrc"
6050 if [[ $GPU == * ' nvidia ' * ]]; then
6151 cd $HOME
6252 wget -O patch-nvidia https://raw.githubusercontent.com/psygreg/shader-booster/refs/heads/main/patch-nvidia;
0 commit comments