2023-06-12 21:06:54 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
arguments="$@"
|
|
|
|
|
|
|
|
# get the $packages Array
|
|
|
|
. include/packages.inc.sh
|
|
|
|
|
|
|
|
# colors for colored output 8)
|
|
|
|
RED="\e[31m"
|
|
|
|
GREEN="\e[32m"
|
|
|
|
YELLOW="\e[33m"
|
|
|
|
ENDCOLOR="\e[0m"
|
|
|
|
|
|
|
|
function message() {
|
|
|
|
case $1 in
|
|
|
|
warn)
|
|
|
|
MESSAGE_TYPE="${YELLOW}WARN${ENDCOLOR}"
|
|
|
|
;;
|
|
|
|
error)
|
|
|
|
MESSAGE_TYPE="${RED}ERROR${ENDCOLOR}"
|
|
|
|
;;
|
|
|
|
info|*)
|
|
|
|
MESSAGE_TYPE="${GREEN}INFO${ENDCOLOR}"
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
if [ "$1" == "info" ] || [ "$1" == "warn" ] || [ "$1" == "error" ]
|
|
|
|
then
|
|
|
|
MESSAGE=$2
|
|
|
|
else
|
|
|
|
MESSAGE=$1
|
|
|
|
fi
|
|
|
|
|
|
|
|
echo -e "[${MESSAGE_TYPE}] $MESSAGE"
|
|
|
|
}
|
|
|
|
|
|
|
|
error ()
|
|
|
|
{
|
|
|
|
message error "ERROR!!"
|
|
|
|
exit 1
|
|
|
|
}
|
|
|
|
|
|
|
|
###
|
|
|
|
|
|
|
|
if [ -z "$arguments" ]
|
|
|
|
then
|
|
|
|
package_categories="${!packages[@]}"
|
|
|
|
else
|
|
|
|
package_categories="$@"
|
|
|
|
fi
|
|
|
|
|
|
|
|
message warn "Do you want to install these categories?"
|
|
|
|
message warn "${YELLOW}$package_categories${ENDCOLOR}"
|
|
|
|
message warn "Type '${GREEN}yes${ENDCOLOR}' and hit [ENTER] to continue"
|
|
|
|
read -p "=> " continue
|
|
|
|
if [ "$continue" != "yes" ]
|
|
|
|
then
|
|
|
|
message error "Installation aborted."
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
message "Continue with installation..."
|
2023-06-12 21:43:31 +02:00
|
|
|
message "check sources.list"
|
|
|
|
if ! grep "contrib" /etc/apt/sources.list > /dev/null && grep "non-free" /etc/apt/sources.list > /dev/null
|
|
|
|
then
|
2023-06-13 00:58:00 +02:00
|
|
|
message warn "'contrib' and 'non-free' not in your sources.ist, i will deploy my own"
|
|
|
|
echo "" | sudo tee /etc/apt/sources.list
|
|
|
|
|
2023-06-12 21:43:31 +02:00
|
|
|
fi
|
2023-06-12 21:06:54 +02:00
|
|
|
# iterate through $packages
|
2023-06-12 21:28:56 +02:00
|
|
|
for categorie in $package_categories
|
2023-06-12 21:06:54 +02:00
|
|
|
do
|
2023-06-12 21:43:31 +02:00
|
|
|
message "Packages category: ${YELLOW}${categorie}${ENDCOLOR}"
|
2023-06-12 21:06:54 +02:00
|
|
|
message "Packages contained: "
|
2023-06-12 21:43:31 +02:00
|
|
|
message "${GREEN}${packages[$categorie]}${ENDCOLOR}"
|
2023-06-12 21:06:54 +02:00
|
|
|
|
2023-06-12 21:43:31 +02:00
|
|
|
message "running pre-tasks"
|
2023-06-12 21:28:56 +02:00
|
|
|
# pre installation steps for categories
|
|
|
|
case $categorie in
|
2023-06-12 21:06:54 +02:00
|
|
|
nice)
|
2023-06-12 21:43:31 +02:00
|
|
|
sudo dpkg --add-architecture i386 || error
|
|
|
|
sudo apt update || error
|
2023-06-12 21:06:54 +02:00
|
|
|
;;
|
|
|
|
esac
|
2023-06-12 21:28:56 +02:00
|
|
|
|
2023-06-12 21:43:31 +02:00
|
|
|
message "installing packages"
|
|
|
|
sudo apt install -y ${packages[$categorie]} || error
|
|
|
|
|
|
|
|
message "running post-tasks"
|
2023-06-12 21:28:56 +02:00
|
|
|
# post installation steps for categories
|
|
|
|
case $categorie in
|
|
|
|
base)
|
2023-06-12 22:17:10 +02:00
|
|
|
message "sed default grub option"
|
|
|
|
sudo sed -i 's/GRUB_CMDLINE_LINUX_DEFAULT=.*$/GRUB_CMDLINE_LINUX_DEFAULT=\"quiet splash mem_sleep_default=deep\"/g' /etc/default/grub || error
|
2023-06-12 22:19:36 +02:00
|
|
|
sudo update-grub
|
2023-06-12 21:51:38 +02:00
|
|
|
;;
|
|
|
|
gnome)
|
2023-06-12 23:30:58 +02:00
|
|
|
message "add flathub.org flatpak repository"
|
2023-06-12 23:22:04 +02:00
|
|
|
sudo flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo || error
|
2023-06-13 00:42:37 +02:00
|
|
|
|
|
|
|
message "install firefox flatpak and gradience"
|
2023-06-12 22:13:33 +02:00
|
|
|
sudo flatpak install org.mozilla.firefox com.github.GradienceTeam.Gradience || error
|
2023-06-13 00:42:37 +02:00
|
|
|
message "set firefox flatpak to default"
|
|
|
|
xdg-settings set default-web-browser org.mozilla.firefox
|
2023-06-12 23:30:58 +02:00
|
|
|
|
2023-06-12 22:58:34 +02:00
|
|
|
message "linking ~/.mozilla to flatpak env"
|
|
|
|
mkdir -p $HOME/.mozilla
|
|
|
|
mkdir -p $HOME/.var/app/org.mozilla.firefox/
|
2023-06-13 00:58:00 +02:00
|
|
|
ln -s $HOME/.mozilla $HOME/.var/app/org.mozilla.firefox/.mozilla
|
2023-06-12 23:30:58 +02:00
|
|
|
|
2023-06-12 22:58:34 +02:00
|
|
|
message "placing font fix for firefox flatpak"
|
|
|
|
mkdir -p $HOME/.var/app/org.mozilla.firefox/config/fontconfig/
|
|
|
|
echo "<?xml version='1.0'?>
|
|
|
|
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
|
|
|
|
<fontconfig>
|
|
|
|
<!-- Disable bitmap fonts. -->
|
|
|
|
<selectfont><rejectfont><pattern>
|
|
|
|
<patelt name="scalable"><bool>false</bool></patelt>
|
|
|
|
</pattern></rejectfont></selectfont>
|
|
|
|
</fontconfig>" > $HOME/.var/app/org.mozilla.firefox/config/fontconfig/fonts.conf
|
2023-06-12 23:30:58 +02:00
|
|
|
|
2023-06-12 22:58:34 +02:00
|
|
|
message "setting gtk legacy default to dark"
|
2023-06-12 23:30:58 +02:00
|
|
|
mkdir -p $HOME/.config/gtk-{3,4}.0
|
2023-06-12 22:58:34 +02:00
|
|
|
echo "[Settings]
|
2023-06-12 23:30:58 +02:00
|
|
|
gtk-application-prefer-dark-theme=1" | tee $HOME/.config/gtk-3.0/settings.ini > $HOME/.config/gtk-4.0/settings.ini
|
|
|
|
|
|
|
|
message "enable gnome shell extensions"
|
2023-06-12 23:59:47 +02:00
|
|
|
gnome-extensions enable ubuntu-appindicators@ubuntu.com
|
|
|
|
gnome-extensions enable panel-osd@berend.de.schouwer.gmail.com
|
|
|
|
gnome-extensions enable user-theme@gnome-shell-extensions.gcampax.github.com
|
|
|
|
gnome-extensions enable dash-to-dock@micxgx.gmail.com
|
|
|
|
gnome-extensions enable system-monitor@paradoxxx.zero.gmail.com
|
2023-06-13 00:29:16 +02:00
|
|
|
gnome-extensions enable ding@rastersoft.com
|
2023-06-12 23:54:24 +02:00
|
|
|
|
2023-06-13 00:49:55 +02:00
|
|
|
gsettings set org.gnome.shell disable-user-extensions false
|
|
|
|
|
2023-06-12 23:54:24 +02:00
|
|
|
message "set gsettings"
|
|
|
|
# dash-to-dock
|
|
|
|
gsettings set org.gnome.shell.extensions.dash-to-dock autohide-in-fullscreen false
|
|
|
|
gsettings set org.gnome.shell.extensions.dash-to-dock background-opacity 0.64000000000000001
|
|
|
|
gsettings set org.gnome.shell.extensions.dash-to-dock click-action 'focus-or-previews'
|
|
|
|
gsettings set org.gnome.shell.extensions.dash-to-dock dash-max-icon-size 36
|
|
|
|
gsettings set org.gnome.shell.extensions.dash-to-dock dock-fixed true
|
|
|
|
gsettings set org.gnome.shell.extensions.dash-to-dock dock-position 'LEFT'
|
|
|
|
gsettings set org.gnome.shell.extensions.dash-to-dock extend-height true
|
|
|
|
gsettings set org.gnome.shell.extensions.dash-to-dock show-apps-at-top true
|
|
|
|
gsettings set org.gnome.shell.extensions.dash-to-dock transparency-mode 'FIXED'
|
2023-06-13 00:29:16 +02:00
|
|
|
gsettings set org.gnome.shell.extensions.dash-to-dock running-indicator-style 'DOTS'
|
2023-06-12 23:54:24 +02:00
|
|
|
|
|
|
|
# panel-osd
|
|
|
|
gsettings set org.gnome.shell.extensions.panel-osd x-pos 100.0
|
|
|
|
|
|
|
|
# desktop
|
|
|
|
gsettings set org.gnome.desktop.background picture-uri 'file:///usr/share/backgrounds/gnome/dune-l.svg'
|
|
|
|
gsettings set org.gnome.desktop.background picture-uri-dark 'file:///usr/share/backgrounds/gnome/dune-d.svg'
|
|
|
|
gsettings set org.gnome.desktop.background show-desktop-icons true
|
2023-06-13 00:09:22 +02:00
|
|
|
gsettings set org.gnome.desktop.background primary-color '#E66100'
|
2023-06-12 23:54:24 +02:00
|
|
|
gsettings set org.gnome.desktop.interface color-scheme 'prefer-dark'
|
|
|
|
gsettings set org.gnome.desktop.wm.preferences button-layout 'close,minimize,maximize:appmenu'
|
|
|
|
gsettings set org.gnome.desktop.interface cursor-theme 'Yaru'
|
|
|
|
gsettings set org.gnome.desktop.interface enable-hot-corners true
|
|
|
|
gsettings set org.gnome.desktop.interface font-antialiasing 'grayscale'
|
|
|
|
gsettings set org.gnome.desktop.interface font-hinting 'slight'
|
|
|
|
gsettings set org.gnome.desktop.interface font-name 'Ubuntu 11'
|
2023-06-13 00:11:47 +02:00
|
|
|
gsettings set org.gnome.desktop.interface gtk-theme 'Yaru-dark'
|
|
|
|
gsettings set org.gnome.desktop.interface icon-theme 'Yaru-dark'
|
2023-06-13 00:03:44 +02:00
|
|
|
|
|
|
|
# fix big cursor issue in qt apps
|
|
|
|
grep "XCURSOR_SIZE" /etc/environment || echo "XCURSOR_SIZE=24" | sudo tee -a /etc/environment
|
2023-06-12 21:28:56 +02:00
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
2023-06-12 21:06:54 +02:00
|
|
|
done
|