restructered the code, reorganized packages, fixed some bugs :)

This commit is contained in:
Marcus 2023-06-13 20:01:21 +02:00
parent 6c3cb7b25b
commit dce671026b
2 changed files with 64 additions and 31 deletions

View file

@ -2,38 +2,50 @@
declare -A packages declare -A packages
# the first three array entries are numbered because they have to be ordered
# install base desktop stuff # install base desktop stuff
packages[base]="ttf-mscorefonts-installer fonts-ubuntu fonts-ubuntu-console packages[0-base]="linux-headers-amd64 plymouth build-essential
flatpak flatpak-xdg-utils linux-headers-amd64 plymouth build-essential p7zip-full unrar unzip neofetch ecryptfs-utils"
p7zip-full unrar unzip shotwell neofetch"
# install desktop base
packages[1-desktop-base]="ttf-mscorefonts-installer fonts-ubuntu fonts-ubuntu-console fonts-liberation2
fonts-noto-core fonts-noto-extra fonts-noto-ui-core fonts-noto-ui-extra fonts-dejavu fonts-hack
flatpak flatpak-xdg-utils gnome-software-plugin-flatpak shotwell network-manager-openvpn-gnome brasero
dconf-editor thunderbird"
# install gnome base # install gnome base
packages[gnome]="task-gnome-desktop task-german-desktop packages[2-desktop-gnome]="task-gnome-desktop task-german-desktop
gnome-shell-extension-manager gnome-tweaks gnome-shell-extensions gnome-shell-extension-manager gnome-tweaks gnome-shell-extensions
gnome-shell-extension-desktop-icons-ng gnome-shell-extension-dashtodock gnome-shell-extension-desktop-icons-ng gnome-shell-extension-dashtodock
gnome-shell-extension-appindicator gnome-shell-extension-system-monitor gnome-shell-extension-appindicator gnome-shell-extension-system-monitor
gnome-shell-extension-panel-osd gnome-shell-extension-panel-osd
yaru-theme-gnome-shell yaru-theme-gtk yaru-theme-icon yaru-theme-sound yaru-theme-gnome-shell yaru-theme-gtk yaru-theme-icon yaru-theme-sound
yaru-theme-unity yaru-theme-unity"
gnome-software-plugin-flatpak
brasero dconf-editor network-manager-openvpn-gnome
thunderbird thunderbird-l10n-de"
# install admin and dev tools # install admin and dev tools
packages[admin]="htop iotop sysstat lm-sensors git mc vim btop btrfs-progs packages[admin]="htop iotop sysstat lm-sensors git mc vim btop btrfs-progs
curl wget debootstrap geany geany-plugins lnav mtr-tiny ncdu nmap ppp curl wget debootstrap geany geany-plugins lnav mtr-tiny ncdu nmap ppp
pandoc pwgen remmina rsync screen socat stress strace tcpdump ufw borgbackup borgmatic " pandoc pwgen remmina rsync screen socat stress strace tcpdump ufw borgbackup borgmatic colordiff
ansible"
# install nice programs # install nice programs
packages[nice]="wine:i386 winetricks chromium dosbox gimp vlc barrier audacity packages[nice]="wine:i386 winetricks chromium dosbox gimp vlc barrier audacity
keepassxc audacious clementine nextcloud-desktop arduino qv4l2 guvcview keepassxc audacious clementine nextcloud-desktop arduino qv4l2 guvcview
solaar steam-installer" solaar steam-installer"
# you can just add your own packages like shown above and below, just add
# a new array :)
# install games # install games
#packages[game]="openarena" #packages[game]="openarena"
# ham radio # ham radio
#packages[ham]="direwolf gqrx-sdr ax25-tools ax25-apps js8call" #packages[ham]="direwolf gqrx-sdr ax25-tools ax25-apps js8call"
# lol stuff :) # lol stuff :)
#packages[lol]="lolcat" #packages[lol]="lolcat"
# packages for xubuntuish XFCE
#packages[desktop-xfce]="gnome-keyring seahorse python3-keyring mugshot elementary-xfce-icon-theme
#lightdm-settings lightdm-gtk-greeter-settings"

View file

@ -65,8 +65,16 @@ else
package_categories="$@" package_categories="$@"
fi fi
message warn "Do you want to install these categories?" # sort the category list, some of them have to be in order
message warn "${YELLOW}$package_categories${ENDCOLOR}" package_categories="$(echo $package_categories | xargs -n1 | sort | xargs)"
message "This script makes a fresh Debian-Gnome installation more 'ubuntuish'"
message "look'n'feel for the current running user ($USER)."
message ""
message "Do you want to install these package categories?"
message "${YELLOW}$package_categories${ENDCOLOR}"
message "You can also specify only a few to install, e.g. '${YELLOW}0-base admin${ENDCOLOR}':"
message "./$0 0-base admin"
confirm_continue confirm_continue
message "Continue with installation..." message "Continue with installation..."
@ -103,61 +111,76 @@ fi
# iterate through $packages # iterate through $packages
for categorie in $package_categories for category in $package_categories
do do
message "Packages category: ${YELLOW}${categorie}${ENDCOLOR}" message "Packages category: ${YELLOW}${category}${ENDCOLOR}"
message "Packages contained: " message "Packages contained: "
message "${GREEN}${packages[$categorie]}${ENDCOLOR}" message "${GREEN}${packages[$category]}${ENDCOLOR}"
message "running pre-tasks" message "running pre-tasks"
# pre installation steps for categories # pre installation steps for categories
case $categorie in case $category in
nice) nice)
sudo dpkg --add-architecture i386 || error sudo dpkg --add-architecture i386 || error
sudo apt update || error sudo apt update || error
;; ;;
esac esac
# package installation #
message "installing packages" message "installing packages"
sudo apt install -y ${packages[$categorie]} || error sudo apt install -y ${packages[$category]} || error
message "running post-tasks" message "running post-tasks"
# post installation steps for categories # post installation steps for categories
case $categorie in case $category in
base) 0-base)
message "sed default grub option" 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 sudo sed -i 's/GRUB_CMDLINE_LINUX_DEFAULT=.*$/GRUB_CMDLINE_LINUX_DEFAULT=\"quiet splash mem_sleep_default=deep\"/g' /etc/default/grub || error
sudo update-grub sudo update-grub
;; ;;
gnome)
1-desktop-base)
message "add flathub.org flatpak repository" message "add flathub.org flatpak repository"
sudo flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo || error sudo flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo || error
message "install firefox flatpak and gradience" message "install firefox flatpak and gradience"
sudo flatpak install org.mozilla.firefox com.github.GradienceTeam.Gradience || error sudo flatpak install org.mozilla.firefox com.github.GradienceTeam.Gradience || error
message "set firefox flatpak to default" message "set firefox flatpak to default"
xdg-settings set default-web-browser org.mozilla.firefox xdg-settings set default-web-browser org.mozilla.firefox.desktop
message "linking ~/.mozilla to flatpak env" message "linking ~/.mozilla to flatpak env"
mkdir -p $HOME/.mozilla mkdir -p $HOME/.mozilla
mkdir -p $HOME/.var/app/org.mozilla.firefox/ mkdir -p $HOME/.var/app/org.mozilla.firefox/
ln -s $HOME/.mozilla $HOME/.var/app/org.mozilla.firefox/.mozilla ln -s $HOME/.mozilla $HOME/.var/app/org.mozilla.firefox/.mozilla
message "placing font fix for firefox flatpak" message "apply font fix for firefox flatpak"
mkdir -p $HOME/.var/app/org.mozilla.firefox/config/fontconfig/ mkdir -p $HOME/.var/app/org.mozilla.firefox/config/fontconfig/
echo "<?xml version='1.0'?> cat << EOF > $HOME/.var/app/org.mozilla.firefox/config/fontconfig/fonts.conf
<?xml version='1.0'?>
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'> <!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
<fontconfig> <fontconfig>
<!-- Disable bitmap fonts. --> <!-- Disable bitmap fonts. -->
<selectfont><rejectfont><pattern> <selectfont><rejectfont><pattern>
<patelt name="scalable"><bool>false</bool></patelt> <patelt name="scalable"><bool>false</bool></patelt>
</pattern></rejectfont></selectfont> </pattern></rejectfont></selectfont>
</fontconfig>" > $HOME/.var/app/org.mozilla.firefox/config/fontconfig/fonts.conf </fontconfig>
EOF
message "setting gtk legacy default to dark" message "setting gtk legacy default to dark"
mkdir -p $HOME/.config/gtk-{3,4}.0 mkdir -p $HOME/.config/gtk-{3,4}.0
echo "[Settings] cat << EOF | tee $HOME/.config/gtk-3.0/settings.ini > $HOME/.config/gtk-4.0/settings.ini
gtk-application-prefer-dark-theme=1" | tee $HOME/.config/gtk-3.0/settings.ini > $HOME/.config/gtk-4.0/settings.ini [Settings]
gtk-application-prefer-dark-theme=1
EOF
# fix big cursor issue in qt apps
message "Set XCURSOR_SIZE=24 in /etc/environment to fix Big cursor bug in QT"
grep "XCURSOR_SIZE" /etc/environment || echo "XCURSOR_SIZE=24" | sudo tee -a /etc/environment > /dev/null
;;
2-desktop-gnome)
message "allow user-extensions"
gsettings set org.gnome.shell disable-user-extensions false
message "enable gnome shell extensions" message "enable gnome shell extensions"
gnome-extensions enable ubuntu-appindicators@ubuntu.com gnome-extensions enable ubuntu-appindicators@ubuntu.com
@ -167,9 +190,7 @@ gtk-application-prefer-dark-theme=1" | tee $HOME/.config/gtk-3.0/settings.ini >
gnome-extensions enable system-monitor@paradoxxx.zero.gmail.com gnome-extensions enable system-monitor@paradoxxx.zero.gmail.com
gnome-extensions enable ding@rastersoft.com gnome-extensions enable ding@rastersoft.com
gsettings set org.gnome.shell disable-user-extensions false message "apply settings for dash-to-dock"
message "set gsettings"
# dash-to-dock # 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 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 background-opacity 0.64000000000000001
@ -182,9 +203,11 @@ gtk-application-prefer-dark-theme=1" | tee $HOME/.config/gtk-3.0/settings.ini >
gsettings set org.gnome.shell.extensions.dash-to-dock transparency-mode 'FIXED' gsettings set org.gnome.shell.extensions.dash-to-dock transparency-mode 'FIXED'
gsettings set org.gnome.shell.extensions.dash-to-dock running-indicator-style 'DOTS' gsettings set org.gnome.shell.extensions.dash-to-dock running-indicator-style 'DOTS'
message "apply settings for panel-osd"
# panel-osd # panel-osd
gsettings set org.gnome.shell.extensions.panel-osd x-pos 100.0 gsettings set org.gnome.shell.extensions.panel-osd x-pos 100.0
message "apply settings for gnome desktop"
# desktop # 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 '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 picture-uri-dark 'file:///usr/share/backgrounds/gnome/dune-d.svg'
@ -200,8 +223,6 @@ gtk-application-prefer-dark-theme=1" | tee $HOME/.config/gtk-3.0/settings.ini >
gsettings set org.gnome.desktop.interface gtk-theme 'Yaru-dark' gsettings set org.gnome.desktop.interface gtk-theme 'Yaru-dark'
gsettings set org.gnome.desktop.interface icon-theme 'Yaru-dark' gsettings set org.gnome.desktop.interface icon-theme 'Yaru-dark'
# fix big cursor issue in qt apps
grep "XCURSOR_SIZE" /etc/environment || echo "XCURSOR_SIZE=24" | sudo tee -a /etc/environment
;; ;;
esac esac