Files
qtile-debian-install/start.sh
2024-05-09 11:56:36 +02:00

125 lines
3.6 KiB
Bash

#!/bin/bash
# whiptail colors
export NEWT_COLORS='
root=white,gray
window=white,lightgray
border=black,lightgray
shadow=white,black
button=white,blue
actbutton=black,red
compactbutton=black,
title=black,
roottext=black,magenta
textbox=black,lightgray
acttextbox=gray,white
entry=lightgray,gray
disentry=gray,lightgray
checkbox=black,lightgray
actcheckbox=white,blue
emptyscale=,black
fullscale=,red
listbox=black,lightgray
actlistbox=lightgray,gray
actsellistbox=white,blue'
echo "-'-'-'-'-'-'-'-'-'-'-'-'-'-'-'-'-'-'-'-'-'-'-'-'-'-'-'-'-'-'-"
echo " "
echo " Enter your user password, to continue if necessary"
echo " "
echo "-'-'-'-'-'-'-'-'-'-'-'-'-'-'-'-'-'-'-'-'-'-'-'-'-'-'-'-'-'-'-"
# Start install
sudo apt update && sudo apt install -y git wget curl whiptail
# Install start screen
if (whiptail --title "Installation of the Martin Qtile desktop" --yesno "Do you want to start the installation ?" 10 60); then
echo "Okay, let's start"
else
exit 1
fi
# Core System
sudo apt install -y xserver-xorg xinit arandr autorandr
sudo apt install -y sddm --no-install-recommends
# Qtile Core Dependencies
sudo apt install -y python3-pip python3-xcffib python3-cairocffi python3-cffi libpangocairo-1.0-0
# Set User folders via xdg-user-dirs-update.
xdg-user-dirs-update
# Yshui Picom install
sudo apt install -y libconfig-dev libdbus-1-dev libegl-dev libev-dev libgl-dev libepoxy-dev libpcre2-dev libpixman-1-dev libx11-xcb-dev libxcb1-dev libxcb-composite0-dev libxcb-damage0-dev libxcb-dpms0-dev libxcb-glx0-dev libxcb-image0-dev libxcb-present-dev libxcb-randr0-dev libxcb-render0-dev libxcb-render-util0-dev libxcb-shape0-dev libxcb-util-dev libxcb-xfixes0-dev libxext-dev meson ninja-build uthash-dev
cd /tmp
git clone https://github.com/yshui/picom
cd picom
meson setup --buildtype=release build && ninja -C build && sudo ninja -C build install
mkdir -p ~/.config/picom
cp picom.sample.conf ~/.config/picom/picom.conf
# Qtile Pip Installing From Source
cd /tmp
git clone https://github.com/qtile/qtile.git && cd qtile && pip install . --break-system-packages
sudo mkdir -p /usr/share/xsessions/
sudo bash -c 'cat << EOF >> /usr/share/xsessions/qtile.desktop
[Desktop Entry]
Name=Qtile
Comment=Qtile Session
Exec=qtile start
Type=Application
Keywords=wm;tiling
EOF'
# Edit GRUB BOOT TIMEOUT
sudo sed -i 's+GRUB_TIMEOUT=5+GRUB_TIMEOUT=1+g' /etc/default/grub && sudo update-grub
# XRDP Install yes-no
questions=("Do you want to install XRDP")
commands=("sudo apt install -y xrdp && echo "qtile start" > .xsession && sudo systemctl restart xrdp.service")
# Array to store user choices
choices=()
# Loop through questions
for i in "${!questions[@]}"; do
# Display the question using whiptail
choice=$(whiptail --title "Question $((i+1))" --yesno "${questions[$i]}" 10 60 3>&1 1>&2 2>&3)
# Check the exit status of whiptail
if [ $? -eq 0 ]; then
choices+=("yes")
else
choices+=("no")
fi
done
# Execute commands based on user choices
for i in "${!choices[@]}"; do
case ${choices[$i]} in
"yes" )
echo "Executing $((i+1))..."
# Replace the command below with the actual command you want to execute
eval "${commands[$i]}"
;;
"no" )
echo "Skipping $((i+1))."
;;
esac
done
##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### #####
# Install closing screen
if (whiptail --title "Installation Complete" --yesno "Installation is complete, Do you want to restart the computer?" 10 60); then
sudo reboot
else
echo "You chose not to restart the computer, Installation complete."
fi