diff --git a/README.md b/README.md index 1b53dde..871f1c7 100755 --- a/README.md +++ b/README.md @@ -1,10 +1,10 @@ # debian -Server (Debian Stable) system general configuration, prepares the system on first boot or anytime. +Debian 13 NETig configuration for `server` or `desktop` profiles. ## Usage -Run the `run.sh` script. +Run the `run.sh` script and choose your profile. ## Manual tasks @@ -20,3 +20,7 @@ And add the following content : # Run the NETig backup script at 4h every monday 0 4 * * mon /usr/local/sbin/netig-srv-backup ``` + +### Desktop + +There is nothing to do, your system is ready to enjoy ! diff --git a/config/qt5ct/qt5ct.conf b/config/qt5ct/qt5ct.conf new file mode 100644 index 0000000..d32e476 --- /dev/null +++ b/config/qt5ct/qt5ct.conf @@ -0,0 +1,32 @@ +[Appearance] +color_scheme_path=/usr/share/qt6ct/colors/airy.conf +custom_palette=false +icon_theme=Papirus-Dark +standard_dialogs=default +style=Adwaita-Dark + +[Fonts] +fixed="Monospace,10,-1,5,400,0,0,0,0,0,0,0,0,0,0,1" +general="Sans Serif,10,-1,5,400,0,0,0,0,0,0,0,0,0,0,1" + +[Interface] +activate_item_on_single_click=1 +buttonbox_layout=0 +cursor_flash_time=1200 +dialog_buttons_have_icons=1 +double_click_interval=400 +gui_effects=@Invalid() +keyboard_scheme=2 +menus_have_icons=true +show_shortcuts_in_context_menus=true +stylesheets=@Invalid() +toolbutton_style=4 +underline_shortcut=1 +wheel_scroll_lines=3 + +[SettingsWindow] +geometry=@ByteArray(\x1\xd9\xd0\xcb\0\x3\0\0\0\0\x3\xf6\0\0\x1\x33\0\0\x6\xde\0\0\x4\x3\0\0\x3\xfb\0\0\x1P\0\0\x6\xd9\0\0\x3\xfe\0\0\0\0\0\0\0\0\a\x80\0\0\x3\xfb\0\0\x1P\0\0\x6\xd9\0\0\x3\xfe) + +[Troubleshooting] +force_raster_widgets=1 +ignored_applications=@Invalid() diff --git a/config/qt6ct/qt6ct.conf b/config/qt6ct/qt6ct.conf new file mode 100644 index 0000000..d32e476 --- /dev/null +++ b/config/qt6ct/qt6ct.conf @@ -0,0 +1,32 @@ +[Appearance] +color_scheme_path=/usr/share/qt6ct/colors/airy.conf +custom_palette=false +icon_theme=Papirus-Dark +standard_dialogs=default +style=Adwaita-Dark + +[Fonts] +fixed="Monospace,10,-1,5,400,0,0,0,0,0,0,0,0,0,0,1" +general="Sans Serif,10,-1,5,400,0,0,0,0,0,0,0,0,0,0,1" + +[Interface] +activate_item_on_single_click=1 +buttonbox_layout=0 +cursor_flash_time=1200 +dialog_buttons_have_icons=1 +double_click_interval=400 +gui_effects=@Invalid() +keyboard_scheme=2 +menus_have_icons=true +show_shortcuts_in_context_menus=true +stylesheets=@Invalid() +toolbutton_style=4 +underline_shortcut=1 +wheel_scroll_lines=3 + +[SettingsWindow] +geometry=@ByteArray(\x1\xd9\xd0\xcb\0\x3\0\0\0\0\x3\xf6\0\0\x1\x33\0\0\x6\xde\0\0\x4\x3\0\0\x3\xfb\0\0\x1P\0\0\x6\xd9\0\0\x3\xfe\0\0\0\0\0\0\0\0\a\x80\0\0\x3\xfb\0\0\x1P\0\0\x6\xd9\0\0\x3\xfe) + +[Troubleshooting] +force_raster_widgets=1 +ignored_applications=@Invalid() diff --git a/config/sources.list b/config/sources.list deleted file mode 100644 index 25a0464..0000000 --- a/config/sources.list +++ /dev/null @@ -1,11 +0,0 @@ -deb http://deb.debian.org/debian bookworm main contrib non-free-firmware -# deb-src http://deb.debian.org/debian bookworm main contrib non-free-firmware - -deb http://deb.debian.org/debian bookworm-updates main contrib non-free-firmware -# deb-src http://deb.debian.org/debian bookworm-updates main contrib non-free-firmware - -# deb http://deb.debian.org/debian bookworm-backports main contrib non-free-firmware -# deb-src http://deb.debian.org/debian bookworm-backports main contrib non-free-firmware - -deb http://security.debian.org/debian-security bookworm-security main contrib non-free-firmware -# deb-src http://security.debian.org/debian-security bookworm-security main contrib non-free-firmware diff --git a/modules/desktop.sh b/modules/desktop.sh new file mode 100755 index 0000000..b448c80 --- /dev/null +++ b/modules/desktop.sh @@ -0,0 +1,25 @@ +#!/bin/bash + +echo +echo " => Desktop" +echo + +# Disable all managed interfaces excerpt loopback from /etc/network/interfaces file to allow NetworkManager to manage them +sed -i '/# The primary network interface/Q' /etc/network/interfaces + +# Qt5ct and qt6ct configuration +grep -E "(export QT_QPA_PLATFORMTHEME=qt5ct)" /etc/environment > /dev/null 2>&1 +if [ $? -ne 0 ]; then + echo "export QT_QPA_PLATFORMTHEME=qt5ct" >> /etc/environment +fi + +# Copy user config files +if [ ! -d ~/.config ]; then + mkdir ~/.config +fi +cp -r config/* ~/.config + +if [ ! -d /etc/skel/.config ]; then + mkdir /etc/skel/.config +fi +cp -r config/* /etc/skel/.config diff --git a/modules/docker.sh b/modules/docker.sh index 12454c5..4f56b01 100755 --- a/modules/docker.sh +++ b/modules/docker.sh @@ -1,16 +1,10 @@ #!/bin/bash -############# -### Docker - echo echo " => Docker" echo -if [ -f /usr/bin/docker ] -then - echo " -> Already done !" -else +if [ ! -f /usr/bin/docker ]; then # Add Docker's official GPG key mkdir -p /etc/apt/keyrings curl -fsSL https://download.docker.com/linux/debian/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg --yes diff --git a/modules/pkgs.sh b/modules/pkgs.sh index 24558cc..164af89 100755 --- a/modules/pkgs.sh +++ b/modules/pkgs.sh @@ -1,15 +1,44 @@ #!/bin/bash -####################### -### Install packages - echo echo " => Packages" echo -pkglist="git - htop - tree - rsync" +base="git + htop + tree + rsync" -apt-get install $pkglist -y +server="" + +desktop="adwaita-qt + adwaita-qt6 + qt5ct + qt6ct + xfce4 + firefox-esr + firefox-esr-l10n-fr + libreoffice + libreoffice-l10n-fr + thunderbird + thunderbird-l10n-fr + vlc" + +if [ $profile = server ]; then + pkglist="$base + $server" +fi + +if [ $profile = desktop ]; then + pkglist="$base + $server + $desktop" +fi + +for i in $pkglist +do + dpkg -l $i > /dev/null 2>&1 + if [ $? -ne 0 ]; then + apt-get install $i -y + fi +done diff --git a/modules/repos.sh b/modules/repos.sh index 813267e..4ce55eb 100755 --- a/modules/repos.sh +++ b/modules/repos.sh @@ -1,10 +1,12 @@ #!/bin/bash -########################### -### Repos configuration - echo -echo " => Repos configuration" +echo " => Repositories" echo -cp config/sources.list /etc/apt/sources.list +grep -E "(contrib|non-free)" /etc/apt/sources.list > /dev/null 2>&1 +if [ $? -ne 0 ]; then + sed -i "s/http:\/\/deb.debian.org\/debian\/ trixie main non-free-firmware/& contrib non-free/" /etc/apt/sources.list + sed -i "s/http:\/\/security.debian.org\/debian-security trixie-security main non-free-firmware/& contrib non-free/" /etc/apt/sources.list + sed -i "s/http:\/\/deb.debian.org\/debian\/ trixie-updates main non-free-firmware/& contrib non-free/" /etc/apt/sources.list +fi diff --git a/modules/scripts.sh b/modules/scripts.sh index 1ceff49..7d6a732 100755 --- a/modules/scripts.sh +++ b/modules/scripts.sh @@ -1,8 +1,5 @@ #!/bin/bash -################### -### Copy scripts - echo echo " => Scripts" echo diff --git a/modules/update.sh b/modules/updates.sh similarity index 56% rename from modules/update.sh rename to modules/updates.sh index 6c860d5..f9d6e2a 100755 --- a/modules/update.sh +++ b/modules/updates.sh @@ -1,10 +1,7 @@ #!/bin/bash -############# -### Update - echo -echo " => Update" +echo " => Updates" echo apt-get update diff --git a/modules/volumes.sh b/modules/volumes.sh index 22e2a4d..7a84c3f 100755 --- a/modules/volumes.sh +++ b/modules/volumes.sh @@ -1,26 +1,17 @@ #!/bin/bash -########################## -### Volumes mountpoints - echo -echo " => Volumes mountpoints" +echo " => Volumes" echo -if [ -d /var/netig/srv ] -then - echo " -> Already done !" -else +if [ ! -d /var/netig/srv ]; then mkdir -p /var/netig/srv echo echo " => Adjust /etc/fstab accordingly !" echo fi -if [ -d /var/netig/bak ] -then - echo " -> Already done !" -else +if [ ! -d /var/netig/bak ]; then mkdir -p /var/netig/bak echo echo " => Adjust /etc/fstab accordingly !" diff --git a/modules/zram.sh b/modules/zram.sh index 2e34de6..3d65693 100755 --- a/modules/zram.sh +++ b/modules/zram.sh @@ -1,16 +1,11 @@ #!/bin/bash -########### -### ZRAM - echo echo " => ZRAM" echo -if [ -f /usr/bin/zramswap ] -then - echo " -> Already done !" -else +dpkg -l zram-tools > /dev/null 2>&1 +if [ $? -ne 0 ]; then apt-get install zram-tools -y sed -i '/#ALGO=lz4/s/^#//g' /etc/default/zramswap sed -i '/#PERCENT=50/s/^#//g' /etc/default/zramswap diff --git a/run.sh b/run.sh index afa5c0b..c9f68e9 100755 --- a/run.sh +++ b/run.sh @@ -10,13 +10,36 @@ then fi # Post-installation -modules="repos.sh - update.sh - pkgs.sh - docker.sh - zram.sh - scripts.sh - volumes.sh" +while true +do + echo + echo "Is it a server or a desktop machine ? (server/desktop)" + read -p "> " answer + export profile=$answer + case $answer in + server) + modules="repos.sh + updates.sh + pkgs.sh + docker.sh + zram.sh + scripts.sh + volumes.sh" + break + ;; + desktop) + modules="repos.sh + updates.sh + pkgs.sh + zram.sh + desktop.sh" + break + ;; + * ) + echo "Please answer server/desktop." + ;; + esac +done for i in $modules do @@ -25,4 +48,5 @@ done # End message echo -echo "Post-installation done !" +echo "Successfully completed !" +echo