mirror of
https://github.com/szymon-jozef/superior_dotfiles.git
synced 2026-09-07 12:10:38 +02:00
Update .local/bin/system_setup.sh
This commit is contained in:
@@ -21,8 +21,43 @@ function install_yay() {
|
|||||||
fi
|
fi
|
||||||
echo "Yay is installed!"
|
echo "Yay is installed!"
|
||||||
}
|
}
|
||||||
# pkgs lists
|
|
||||||
|
|
||||||
|
function show_help() {
|
||||||
|
echo -e "$help_message"
|
||||||
|
exit 0
|
||||||
|
}
|
||||||
|
|
||||||
|
function list_presets() {
|
||||||
|
echo -e "Existing presets:\n\tmiminal - a minimal preset with not a lot of stuff\n\tnormal - preset with everything you could possibly need"
|
||||||
|
exit 0
|
||||||
|
}
|
||||||
|
|
||||||
|
function list_preset_packages() {
|
||||||
|
echo "Preset $preset contains:"
|
||||||
|
echo "${presets[$preset]}"
|
||||||
|
exit 0
|
||||||
|
}
|
||||||
|
|
||||||
|
function install_preset() {
|
||||||
|
install_yay
|
||||||
|
echo "Downloading preset: $preset"
|
||||||
|
yay -Syu ${presets[$preset]} --needed
|
||||||
|
exit 0
|
||||||
|
}
|
||||||
|
|
||||||
|
function uninstall_preset() {
|
||||||
|
reassurance=""
|
||||||
|
read -p "Are you sure you want to do this very stupid thing? Type I AM VERY DUM to continue..." reassurance
|
||||||
|
if [[ $reassurance = "I AM VERY DUM" ]]; then
|
||||||
|
echo "Uninstalling preset: $preset"
|
||||||
|
yay -Rns ${presets[$preset]}
|
||||||
|
else
|
||||||
|
echo "Canceled uninstall"
|
||||||
|
fi
|
||||||
|
exit 0
|
||||||
|
}
|
||||||
|
|
||||||
|
# pkgs lists
|
||||||
HYPRLAND_UI="
|
HYPRLAND_UI="
|
||||||
hyprland
|
hyprland
|
||||||
hyprland-protocols
|
hyprland-protocols
|
||||||
@@ -56,7 +91,6 @@ catppuccin-gtk-theme-latte
|
|||||||
papirus-icon-theme
|
papirus-icon-theme
|
||||||
rose-pine-cursor
|
rose-pine-cursor
|
||||||
rose-pine-hyprcursor
|
rose-pine-hyprcursor
|
||||||
|
|
||||||
"
|
"
|
||||||
|
|
||||||
AUDIO="
|
AUDIO="
|
||||||
@@ -197,16 +231,20 @@ How to use this bad boy:\n\n
|
|||||||
\t--uninstall - uninstall given preset from your system. Possibly very stupid, because presets contain important system packages, like your window manager!\n\n
|
\t--uninstall - uninstall given preset from your system. Possibly very stupid, because presets contain important system packages, like your window manager!\n\n
|
||||||
Thanks for using my super cool script :D
|
Thanks for using my super cool script :D
|
||||||
"
|
"
|
||||||
|
|
||||||
|
# check root
|
||||||
if [ "$EUID" -eq 0 ]; then
|
if [ "$EUID" -eq 0 ]; then
|
||||||
echo -e "${RED}Please do not run this script as root.${RESET}"
|
echo -e "${RED}Please do not run this script as root.${RESET}"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# check args
|
||||||
if [[ -z "$1" ]]; then
|
if [[ -z "$1" ]]; then
|
||||||
echo "You need to give me some arguments... Try --help if you don't know what you're doing"
|
echo "You need to give me some arguments... Try --help if you don't know what you're doing"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# parse args
|
||||||
while [ -n "$1" ]; do
|
while [ -n "$1" ]; do
|
||||||
case $1 in
|
case $1 in
|
||||||
--list-presets)
|
--list-presets)
|
||||||
@@ -245,49 +283,24 @@ while [ -n "$1" ]; do
|
|||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
# show help and exit
|
# execute actions
|
||||||
if [[ "$wants_help" = true ]]; then
|
if [[ "$wants_help" = true ]]; then
|
||||||
echo -e "$help_message"
|
show_help
|
||||||
exit 0
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ "$list_presets" = true ]]; then
|
if [[ "$list_presets" = true ]]; then
|
||||||
echo -e "Existing presets:\n\tmiminal - a minimal preset with not a lot of stuff\n\tnormal - preset with everything you could possibly need"
|
list_presets
|
||||||
exit 0
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
# check if preset was chosen
|
|
||||||
if [[ -v presets[$preset] ]]; then
|
if [[ -v presets[$preset] ]]; then
|
||||||
|
|
||||||
# list and exit
|
|
||||||
if [[ "$list" = true ]]; then
|
if [[ "$list" = true ]]; then
|
||||||
echo "Preset $preset contains:"
|
list_preset_packages
|
||||||
echo "${presets[$preset]}"
|
|
||||||
exit 0
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# check if yay is installed and install it if needed
|
|
||||||
install_yay
|
|
||||||
|
|
||||||
# install given packages
|
|
||||||
if [[ "$install" = true ]]; then
|
if [[ "$install" = true ]]; then
|
||||||
echo "Downloading preset: $preset"
|
install_preset
|
||||||
yay -Syu ${presets[$preset]} --needed
|
|
||||||
exit 0
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# uninstall given preset
|
|
||||||
if [[ "$uninstall" = true ]]; then
|
if [[ "$uninstall" = true ]]; then
|
||||||
reassurance=""
|
uninstall_preset
|
||||||
read -p "Are you sure you want to do this very stupid thing? Type I AM VERY DUM to continue..." reassurance
|
|
||||||
if [[ $reassurance = "I AM VERY DUM" ]]; then
|
|
||||||
echo "Uninstalling preset: $preset"
|
|
||||||
yay -Rns ${presets[$preset]}
|
|
||||||
else
|
|
||||||
echo "Canceled uninstall"
|
|
||||||
fi
|
|
||||||
exit 0
|
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
echo "Given preset does not exists..."
|
echo "Given preset does not exists..."
|
||||||
|
|||||||
Reference in New Issue
Block a user