Skip to content

Commit

Permalink
added fedora support
Browse files Browse the repository at this point in the history
  • Loading branch information
AspieSoft committed Apr 28, 2023
1 parent bc5b804 commit 9ed5349
Show file tree
Hide file tree
Showing 15 changed files with 985 additions and 87 deletions.
Binary file modified SpecialModifications.tar.gz
Binary file not shown.
56 changes: 39 additions & 17 deletions bin/common/functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,30 @@ function endLoading() {
}

function runUpdate() {
local loading=$(startLoading "Updating")
(
sudo apt update &>/dev/null
if [ "$1" = "true" ] ; then
sudo apt upgrade -y &>/dev/null
fi
endLoading "$loading"
) &
runLoading "$loading"
unset loading
if [ "$package_manager" = "apt" ]; then
local loading=$(startLoading "Updating")
(
sudo apt update &>/dev/null
if [ "$1" = "true" ] ; then
sudo apt upgrade -y &>/dev/null
fi
endLoading "$loading"
) &
runLoading "$loading"
unset loading
elif [ "$package_manager" = "dnf" ]; then
local loading=$(startLoading "Updating")
(
if [ "$1" = "true" ] ; then
sudo dnf -y update &>/dev/null
else
sudo dnf --assumeno update &>/dev/null
fi
endLoading "$loading"
) &
runLoading "$loading"
unset loading
fi
}

function numberInput() {
Expand Down Expand Up @@ -118,13 +132,21 @@ function ynInput() {
}

function hasPackage() {
local installed=$(dpkg-query -W --showformat='${Status}\n' $1 2>/dev/null|grep "install ok installed") &>/dev/null
if [ "$package_manager" = "apt" ]; then
local installed=$(dpkg-query -W --showformat='${Status}\n' $1 2>/dev/null|grep "install ok installed") &>/dev/null

if [ "$installed" = "" ] ; then
echo "false"
else
echo "true"
fi
if [ "$installed" = "" ]; then
echo "false"
else
echo "true"
fi

unset installed
unset installed
elif [ "$package_manager" = "dnf" ]; then
if rpm -q "$1"; then
echo "false"
else
echo "true"
fi
fi
}
28 changes: 27 additions & 1 deletion bin/scripts/setup/apps.sh → bin/scripts/apt/apps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,32 @@ runLoading "$loading"
runUpdate


# install neofetch
loading=$(startLoading "Installing Neofetch")
(
if [ $(hasPackage "neofetch") = "false" ] ; then
sudo apt -y install neofetch &>/dev/null
fi

endLoading "$loading"
) &
runLoading "$loading"


# install snap
if [ "$installNemo" = true ] ; then
loading=$(startLoading "Installing Snap")
(
if [ $(hasPackage "snapd") = "false" ] ; then
sudo apt -y install snapd &>/dev/null
fi

endLoading "$loading"
) &
runLoading "$loading"
fi


# install nemo
if [ "$installNemo" = true ] ; then
loading=$(startLoading "Finding Nemo")
Expand Down Expand Up @@ -122,7 +148,7 @@ if echo $XDG_CURRENT_DESKTOP | grep GNOME &>/dev/null ; then

# gnome-shell-extension-manager
if [ $(hasPackage "gnome-shell-extension-manager") = "false" ] ; then
loading=$(startLoading "Installing Gnome Tweak Tool")
loading=$(startLoading "Installing Gnome Extension Manager")
(
# sudo apt -y install gnome-shell-extension-manager &>/dev/null
sudo flatpak install -y flathub com.mattjakeman.ExtensionManager &>/dev/null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ loading=$(startLoading "Upgrading preformance")
sudo apt -y install preload &>/dev/null
fi

systemctl start preload &>/dev/null
systemctl enable preload &>/dev/null

sudo add-apt-repository -y ppa:linrunner/tlp &>/dev/null
sudo apt -y update &>/dev/null

Expand All @@ -53,9 +56,17 @@ loading=$(startLoading "Upgrading preformance")
sudo apt -y install tlp-rdw &>/dev/null
fi

sudo systemctl enable tlp &>/dev/null
systemctl start tlp &>/dev/null
systemctl enable tlp &>/dev/null
sudo tlp start &>/dev/null

if [ $(hasPackage "thermald") = "false" ] ; then
sudo apt -y install thermald &>/dev/null
fi

sudo systemctl start thermald &>/dev/null
sudo systemctl enable thermald &>/dev/null

sudo snap install auto-cpufreq &>/dev/null
sudo auto-cpufreq --install &>/dev/null

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ function cleanup() {
}
trap cleanup EXIT

#installExtras="$1"
installOracleJava="$1"
installExtras="$1"
installOracleJava="$2"


# install extras
Expand Down Expand Up @@ -126,6 +126,14 @@ loading=$(startLoading "Installing NPM")
sudo touch "/etc/skel/.zshrc" &>/dev/null
fi

if ! [ -f "$HOME/.profile" ]; then
sudo touch "$HOME/.profile" &>/dev/null
fi

if ! [ -f "/etc/skel/.profile" ]; then
sudo touch "/etc/skel/.profile" &>/dev/null
fi

hasExport=$(sudo grep 'export N_PREFIX="$HOME/.npm"' "$HOME/.zshrc")
if [[ "$hasExport" == "" ]]; then
echo 'export N_PREFIX="$HOME/.npm"' | sudo tee -a "$HOME/.zshrc" &>/dev/null
Expand Down
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 9ed5349

Please sign in to comment.