Update install.sh

This commit is contained in:
2024-05-13 18:40:17 +02:00
parent 52a937a301
commit 6ce0075f6f

View File

@@ -45,7 +45,7 @@ if ! dpkg -s whiptail >/dev/null 2>&1; then
echo -e "${RED} Enter your user password, to continue if necessary"
echo -e "${RED} "
echo -e "${RED}-'-'-'-'-'-'-'-'-'-'-'-'-'-'-'-'-'-'-'-'-'-'-'-'-'-'-'-'-'-'-"
echo -e "${RED} "
echo -e "${RED} ${NC}"
sudo apt update
sudo apt install -y whiptail
else
@@ -99,7 +99,7 @@ echo -e "${RED} Preparation before starting the installation..."
echo -e "${RED} Enter your user password, to continue if necessary"
echo -e "${RED} "
echo -e "${RED}-'-'-'-'-'-'-'-'-'-'-'-'-'-'-'-'-'-'-'-'-'-'-'-'-'-'-'-'-'-'-"
echo -e "${RED} "
echo -e "${RED} ${NC}"
sudo apt update
@@ -119,8 +119,8 @@ sudo apt install -y nitrogen dunst notify-osd xarchiver mpv flameshot speedcrunc
# Audio on system - https://alsa.opensrc.org - https://wiki.debian.org/ALSA
# See hardware run: "pacmd list-sinks" or "lspci | grep -i audio" or... sudo dmesg | grep 'snd\|firmware\|audio'
# Test file run: "aplay /usr/share/sounds/alsa/Noise.wav"
sudo adduser $USER audio
# Test file run: "aplay /usr/share/sounds/alsa/Front_Center.wav"
# sudo adduser $USER audio
sudo alsactl init
systemctl --user enable pulseaudio
@@ -134,7 +134,7 @@ if [ "$CPUVENDOR" == "GenuineIntel" ]; then
sudo apt install -y intel-microcode
fi
else
echo -e "${GREEN} Intel Microcode OK"
echo -e "${GREEN} Intel Microcode OK${NC}"
fi
if [ "$CPUVENDOR" == "AuthenticAMD" ]; then
@@ -142,7 +142,7 @@ if [ "$CPUVENDOR" == "AuthenticAMD" ]; then
sudo apt install -y amd64-microcode
fi
else
echo -e "${GREEN} Amd64 Microcode OK"
echo -e "${GREEN} Amd64 Microcode OK${NC}"
fi
unset LC_ALL # unset the LC_ALL=C
# CPU Microcode install end
@@ -152,7 +152,7 @@ unset LC_ALL # unset the LC_ALL=C
# Qtile Core Dependencies apt install
sudo apt install -y python3-pip python3-xcffib python3-cairocffi python3-cffi libpangocairo-1.0-0 python-dbus-dev libxkbcommon-dev libxkbcommon-x11-dev python3-venv
sudo apt install -y python3-pip python3-xcffib python3-cairocffi python3-cffi libpangocairo-1.0-0 python-dbus-dev libxkbcommon-dev libxkbcommon-x11-dev python3-venv python3-psutil
# Set User folders via xdg-user-dirs-update.
@@ -170,8 +170,9 @@ xdg-user-dirs-update
#cp picom.sample.conf ~/.config/picom/picom.conf
echo -e "${GREEN} Install Qtile from source via github and Pip"
echo -e "${YELLOW} Install Qtile from source via github and Pip${NC}"
cd /tmp/
sudo rm -rf qtile
git clone https://github.com/qtile/qtile.git && cd qtile && pip install . --break-system-packages --no-warn-script-location
sudo mkdir -p /usr/share/xsessions/
@@ -190,8 +191,7 @@ touch ~/.xsession && echo "qtile start" > ~/.xsession
# Qtile Autostart.sh file
mkdir -p ~/.config/qtile/
if [ ! -f ~/.config/qtile/autostart.sh ]; then
#touch ~/.config/qtile/autostart.sh
cat <<QTILEAUTOSTART > ~/.config/qtile/autostart.sh
cat << QTILEAUTOSTART > ~/.config/qtile/autostart.sh
#!/bin/sh
pgrep -x picom > /dev/null || picom -b &
amixer set Master 10% &
@@ -208,12 +208,12 @@ else
echo "File autostart.sh already exists."
fi
# MPD START - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
echo -e "${YELLOW} MPD START - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -${NC}"
mkdir -p ~/.config/mpd/playlists
mkdir -p ~/.local/state/mpd
if [ ! -f ~/.config/mpd/mpd.conf ]; then
cat <<MPDCONFIG > ~/.config/mpd/mpd.conf
cat << MPDCONFIG > ~/.config/mpd/mpd.conf
# ~/.config/mpd/mpd.conf or /etc/mpd.conf
# Example: /usr/share/doc/mpd/mpdconf.example
@@ -268,8 +268,14 @@ audio_output {
# device "default:CARD=Audio"
#}
# MPD End of config
MPDCONFIG
else
echo "mpd.conf already exists."
fi
# sudo systemctl enable mpd
#systemctl enable --now --user mpd.service
#systemctl enable --now --user mpd
@@ -282,10 +288,10 @@ MPDCONFIG
# mpd --stderr --no-daemon --verbose
# aplay --list-pcm
# MPD END - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
echo -e "${YELLOW} MPD END - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ${NC}"
# Wallpapers START - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
echo -e "${YELLOW} Wallpapers START - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ${NC}"
if [ ! -d ~/Wallpapers ]; then
mkdir -p ~/Wallpapers
@@ -349,8 +355,9 @@ else
echo "Nitrogen config file already exists."
fi
echo -e "${YELLOW} Wallpapers END - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ${NC}"
# Nerd Fonts START - https://www.nerdfonts.com/font-downloads - https://www.nerdfonts.com/cheat-sheet - - -
echo -e "${YELLOW} Nerd Fonts START - https://www.nerdfonts.com/font-downloads - https://www.nerdfonts.com/cheat-sheet - - - ${NC}"
if [ ! -d ~/.fonts ]; then
mkdir -p ~/.fonts
@@ -364,10 +371,10 @@ unzip -q -n /tmp/DejaVuSansMono.zip -d ~/.fonts
rm -f ~/.fonts/*.md
rm -f ~/.fonts/*.txt
# Nerd Fonts END - https://www.nerdfonts.com/font-downloads - - - - - - - - - - - - - - - - -
echo -e "${YELLOW} Nerd Fonts END - https://www.nerdfonts.com/font-downloads - - - - - - - - - - - - - - - - -"
# Themes START ------------------------------------------------------------------
echo -e "${YELLOW} Themes START ------------------------------------------------------------------"
# ls -d /usr/share/themes/*
# ls -d /usr/share/icons/*
# ls -d /usr/share/
@@ -376,6 +383,7 @@ rm -f ~/.fonts/*.txt
# https://github.com/EliverLara/Nordic
sudo rm -rf /tmp/EliverLara-Nordic
sudo git clone https://github.com/EliverLara/Nordic /tmp/EliverLara-Nordic
sudo cp -r /tmp/EliverLara-Nordic /usr/share/themes/
@@ -384,6 +392,7 @@ sudo cp -r /tmp/EliverLara-Nordic /usr/share/themes/
# https://github.com/alvatip/Nordzy-cursors
cd /tmp/
sudo rm -rf Nordzy-cursors
git clone https://github.com/alvatip/Nordzy-cursors
cd Nordzy-cursors
sudo ./install.sh
@@ -397,6 +406,7 @@ cd /tmp/
# https://github.com/alvatip/Nordzy-icon
cd /tmp/
sudo rm -rf Nordzy-icon
git clone https://github.com/alvatip/Nordzy-icon
cd Nordzy-icon/
sudo ./install.sh
@@ -433,13 +443,14 @@ sudo sed -i 's/Adwaita/Nordzy-cursors/g' /usr/share/icons/default/index.theme
sudo fc-cache -f -v
# Themes END ------------------------------------------------------------------
echo -e "${YELLOW} Themes END ------------------------------------------------------------------ ${NC}"
# xrandr-set-max + Xsession START --------------------------------------------------------
echo -e "${YELLOW} xrandr-set-max + Xsession START -------------------------------------------------------- ${NC}"
if [ ! -f /usr/local/bin/xrandr-set-max ]; then
sudo bash -c 'cat << "XRANDRSETMAX" >> /usr/local/bin/xrandr-set-max
# Define the content of the script
xrandr-set-max_content=$(cat <<'XRANDRSETMAX'
#!/bin/bash
# Get the names of all connected displays
@@ -453,12 +464,18 @@ for display in $displays; do
# Set the screen resolution to the maximum supported resolution for the current display
xrandr --output "$display" --mode "$max_resolution"
done
XRANDRSETMAX'
XRANDRSETMAX
)
# Write the script content to the target file using sudo
echo "$xrandr-set-max_content" | sudo tee /usr/local/bin/xrandr-set-max >/dev/null
# SDDM Before Login - /usr/share/sddm/scripts/Xsetup and After Login - /usr/share/sddm/scripts/Xsession
sudo sed -i '$a\. /usr/local/bin/xrandr-set-max' /usr/share/sddm/scripts/Xsetup
sudo sed -i '$a\. /usr/local/bin/xrandr-set-max' /usr/share/sddm/scripts/Xsession
sudo chmod +x /usr/local/bin/xrandr-set-max
else
echo "xrandr-set-max already exists."
fi
@@ -470,10 +487,10 @@ fi
# echo "/etc/X11/Xsession.d/90_xrandr-set-max already exists."
#fi
# xrandr-set-max + Xsession END ----------------------------------------------------------
echo -e "${YELLOW} xrandr-set-max + Xsession END ---------------------------------------------------------- ${NC}"
# Download Unsplash Wallpapers BIN START --------------------------------------
echo -e "${YELLOW} Download Unsplash Wallpapers BIN START -------------------------------------- ${NC}"
sudo bash -c 'cat << "UNSPLASHDOWNLOADBIN" >> /usr/local/bin/unsplash-download-wallpapers
#!/bin/bash
@@ -509,10 +526,10 @@ UNSPLASHDOWNLOADBIN'
sudo chmod +x /usr/local/bin/unsplash-download-wallpapers
# Download Unsplash Wallpapers BIN END -------------------------------------
echo -e "${YELLOW} Download Unsplash Wallpapers BIN END ------------------------------------- ${NC}"
# Rofi Run menu START - - - - - - - - - - - - - - - - - -
echo -e "${YELLOW} Rofi Run menu START - - - - - - - - - - - - - - - - - - ${NC}"
if [ ! -d ~/.config/rofi ]; then
mkdir -p ~/.config/rofi
@@ -611,12 +628,10 @@ else
echo "Rofi config file already exists."
fi
# Rofi Run menu END - - - - - - - - - - - - - - - - - -
echo -e "${YELLOW} Rofi Run menu END - - - - - - - - - - - - - - - - - - ${NC}"
# -------------------------------------------------------------------------------------------------
# Kitty config file start -------------------------------------------------------------------------
# -------------------------------------------------------------------------------------------------
echo -e "${YELLOW} Kitty config file START ------------------------------------------------------------------------- ${NC}"
if [ ! -f ~/.config/kitty/kitty.conf ]; then
mkdir -p ~/.config/kitty/
@@ -2100,18 +2115,18 @@ map kitty_mod+f6 debug_config
KITTYCONFIG
# -------------------------------------------------------------------------------------------------
# Kitty config file end ---------------------------------------------------------------------------
# -------------------------------------------------------------------------------------------------
else
echo "Kitty config already exists."
fi
# -------------------------------------------------------------------------------------------------
echo -e "${YELLOW} Kitty config file END --------------------------------------------------------------------------- ${NC}"
# -------------------------------------------------------------------------------------------------
# Edit GRUB BOOT TIMEOUT
echo -e "${YELLOW} Edit GRUB BOOT TIMEOUT START --------------------------------------- ${NC}"
sudo sed -i 's+GRUB_TIMEOUT=5+GRUB_TIMEOUT=1+g' /etc/default/grub && sudo update-grub
echo -e "${YELLOW} Edit GRUB BOOT TIMEOUT END ----------------------------------------- ${NC}"
# Execute the commands based on user choices
for i in "${!choices[@]}"; do
@@ -2129,7 +2144,7 @@ done
# -------------------------------------------------------------------------------------------------
# Qtile Config file Start -------------------------------------------------------------------------
echo -e "${YELLOW} Qtile Config file START ------------------------------------------------------------------------- ${NC}"
# -------------------------------------------------------------------------------------------------
if [ ! -f ~/.config/qtile/config.py ]; then
@@ -2369,19 +2384,15 @@ screens = [
widget.Spacer(length=9),
widget.Prompt(),
widget.Spacer(),
widget.WindowName(width=bar.CALCULATED, max_chars=130),
widget.WindowName(width=bar.CALCULATED, max_chars=120),
widget.Spacer(),
#widget.Chord(
# chords_colors={
# "launch": ("#ff0000", "#ffffff"),
# },
# name_transform=lambda name: name.upper(),
#),
widget.Systray(fmt="\udb84 {}", icon_size=20),
# NB Wayland is incompatible with Systray, consider using StatusNotifier
# widget.StatusNotifier(),
widget.Systray(fmt="\udb84 {}", icon_size=20),
widget.Wallpaper(directory="~/Wallpapers/", label="", random_selection="True"),
widget.Spacer(length=5),
#widget.NetGraph(type='line', line_width=1),
#widget.Net(prefix='M')
widget.ThermalSensor(format='CPU: {temp:.0f}{unit}'),
widget.Volume(fmt="\ue638 {}"),
widget.Spacer(length=5),
widget.Clock(fmt="\ue641 {}",format="%H:%M %A %d-%m-%Y %p"),
@@ -2453,11 +2464,12 @@ else
fi
# -------------------------------------------------------------------------------------------------
# Qtile Config file End ---------------------------------------------------------------------------
echo -e "${YELLOW} Qtile Config file END --------------------------------------------------------------------------- ${NC}"
# -------------------------------------------------------------------------------------------------
# Install closing screen ##### ##### ##### ##### ##### ##### ##### ##### ##### ####
if (whiptail --title "Installation Complete" --yesno "Installation is complete, Do you want to restart the computer ?" 10 60); then
cd ~
clear
echo -e "${RED} "
echo -e "${RED}-'-'-'-'-'-'-'-'-'-'-'-'-'-'-'-'-'-'-'-'-'-'-'-'-'-'-'-'-'-'-"
@@ -2465,11 +2477,11 @@ if (whiptail --title "Installation Complete" --yesno "Installation is complete,
echo -e "${RED} Enter your user password, to continue if necessary"
echo -e "${RED} "
echo -e "${RED}-'-'-'-'-'-'-'-'-'-'-'-'-'-'-'-'-'-'-'-'-'-'-'-'-'-'-'-'-'-'-"
echo -e "${RED} "
echo -e "${RED} ${NC}"
sudo reboot
echo -e "${GREEN}See you later alligator..."
echo -e "${GREEN} "
echo -e "${GREEN} "
echo -e "${GREEN} ${NC}"
else
clear
echo -e "${GREEN} -'-'-'-'-'-'-'-'-'-'-'-'-'-'-'-'-'-'-'-'-'-'-'-'-'-'-'-'-'-'-'-'-'-"
@@ -2477,7 +2489,7 @@ else
echo -e "${GREEN} You chose not to restart the computer, Installation complete."
echo -e "${GREEN} Run startx to get to the login screen"
echo -e "${GREEN} "
echo -e "${GREEN} -'-'-'-'-'-'-'-'-'-'-'-'-'-'-'-'-'-'-'-'-'-'-'-'-'-'-'-'-'-'-'-'-'-"
echo -e "${GREEN} -'-'-'-'-'-'-'-'-'-'-'-'-'-'-'-'-'-'-'-'-'-'-'-'-'-'-'-'-'-'-'-'-'- ${NC}"
fi
# Install Done ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##