Last active
April 3, 2024 00:16
-
-
Save Speyll/852a81e28565a7dca2777a78da36eaa9 to your computer and use it in GitHub Desktop.
Short, simple and easy to understand shell scripts to automate Debian post-installation with a wayland setup, you can play around with it as you see fit.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Debian Linux Post-Installation Script for Wayland | |
# Author: Speyll | |
# Last-update: 03-04-2024 | |
# Enable debugging output and exit on error | |
set -x | |
# Add multilib and nonfree repositories | |
sudo apt-get install --no-install-recommends -y \ | |
deb-multimedia-keyring \ | |
firmware-misc-nonfree \ | |
libdvd-pkg | |
# Update package lists and upgrade existing packages | |
sudo apt-get update -y | |
sudo apt-get upgrade -y | |
# Install GPU drivers | |
install_gpu_driver() { | |
gpu_driver="" | |
case "$(lspci | grep -E 'VGA|3D')" in | |
*Intel*) gpu_driver="intel-media-va-driver intel-media-va-driver-non-free" ;; | |
*AMD*) gpu_driver="mesa-va-drivers libvdpau-va-gl1 libvdpau-driver-all" ;; | |
*NVIDIA*)gpu_driver="mesa-va-drivers nvidia-driver libvdpau-va-gl1 libvdpau-driver-all nvidia-vdpau-driver libnvcuvid1 libnvidia-encode1" ;; | |
esac | |
for pkg in $gpu_driver; do | |
[ -n "$pkg" ] && sudo apt-get install --no-install-recommends -y "$pkg" | |
done | |
} | |
install_gpu_driver | |
# Install CPU microcode updates | |
if lspci | grep -q 'Intel'; then | |
sudo apt-get install --no-install-recommends -y intel-microcode ##amd64-microcode | |
fi | |
# Install other packages | |
install_packages() { | |
sudo apt-get install --no-install-recommends -y \ | |
wayland dbus git curl acpi rsync \ | |
pipewire pipewire-audio wireplumber \ | |
fonts-noto-color-emoji fonts-noto-core fonts-hack-otf fonts-font-awesome \ | |
nano sway foot yambar wlsunset tofi brightnessctl \ | |
grim slurp wl-clipboard cliphist imv swaybg xdg-utils mpv ffmpeg \ | |
mako libnotify nnn unzip p7zip-rar pcmanfm-qt ffmpegthumbnailer \ | |
breeze-gtk-theme breeze-icon-theme breeze-cursor-theme qt5ct \ | |
qt5-wayland dbus-glib wireguard bluez network-manager dbus | |
} | |
install_packages | |
# Set up PipeWire autostart | |
sudo mkdir -p /etc/xdg/autostart | |
sudo tee /etc/xdg/autostart/pipewire.desktop >/dev/null <<EOT | |
[Desktop Entry] | |
Type=Application | |
Name=PipeWire | |
Comment=Session Manager | |
NoDisplay=true | |
Exec=/usr/bin/pipewire | |
EOT | |
# Enable and start bluetooth service | |
sudo systemctl enable bluetooth | |
sudo systemctl start bluetooth | |
# Set up ACPI | |
sudo systemctl enable acpid | |
sudo systemctl start acpid | |
# Set up NetworkManager | |
sudo systemctl stop wpa_supplicant | |
sudo systemctl disable wpa_supplicant | |
sudo systemctl disable systemd-networkd | |
sudo systemctl mask systemd-networkd | |
sudo systemctl stop systemd-networkd | |
sudo systemctl enable dbus | |
sudo systemctl start dbus | |
sudo systemctl enable NetworkManager | |
sudo systemctl start NetworkManager | |
# Clone and set up dotfiles | |
git clone https://github.com/speyll/dotfiles "$HOME/dotfiles" | |
cp -r "$HOME/dotfiles/."* "$HOME/" | |
rm -rf "$HOME/dotfiles" | |
chmod -R +X "$HOME/.local/bin" "$HOME/.local/share/applications" "$HOME/.config/autostart/" | |
chmod +x "$HOME/.config/yambar/sway-switch-keyboard.sh" "$HOME/.config/yambar/xkb-layout.sh" "$HOME/.config/autostart/*" "$HOME/.local/bin/*" | |
ln -s "$HOME/.config/mimeapps.list" "$HOME/.local/share/applications/" | |
# Add user to sudo group for sudo access | |
sudo echo "%sudo ALL=(ALL:ALL) NOPASSWD: /usr/bin/halt, /usr/bin/poweroff, /usr/bin/reboot, /usr/bin/shutdown, /usr/bin/zzz, /usr/bin/ZZZ" | sudo tee -a /etc/sudoers.d/sudo |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment