Skip to content

Instantly share code, notes, and snippets.

@raphaelbruno
Last active October 5, 2024 01:10
Show Gist options
  • Save raphaelbruno/d12fdf1b86335d2d2500e22f16b3d5b6 to your computer and use it in GitHub Desktop.
Save raphaelbruno/d12fdf1b86335d2d2500e22f16b3d5b6 to your computer and use it in GitHub Desktop.
Postinstall
#!/bin/bash
# ###########################################################
# Functions
# ###########################################################
RED=`tput setaf 1`
GREEN=`tput setaf 2`
YELLOW=`tput setaf 3`
BLUE=`tput setaf 4`
NOCOLOR=`tput sgr0`
printcenter(){
local x
local y
text="$*"
x=$(( ($(tput cols) - ${#text}) / 2))
echo -ne "\E[6n";read -sdR y; y=$(echo -ne "${y#*[}" | cut -d';' -f1)
echo -ne "\033[${y};${x}f$*"
echo
}
printtopic(){
LINE_CHAR=${3:-―}
printf ${2:-$NOCOLOR}
eval printf %.0s$LINE_CHAR '{1..'"${COLUMNS:-$(tput cols)}"\}; echo
printcenter $1
eval printf %.0s$LINE_CHAR '{1..'"${COLUMNS:-$(tput cols)}"\}; echo
printf $NOCOLOR
}
printheader(){
printtopic "$1" ${2:-$NOCOLOR} █
}
printheader "Let me do the hard work and go get some ☕" $BLUE
echo "Setup multiple keyboard layout and cedilla (for international keyboards)? (y/n)" && read CONFIRM_KEYBOARD
echo "Activate AMDGPU and Vulkan support (systemd-boot)? (y/n)" && read CONFIRM_AMDGPU_SYSTEMD_BOOT
echo "Activate AMDGPU and Vulkan support (grub)? (y/n)" && read CONFIRM_AMDGPU_GRUB
echo "Change Icons to papirus icon theme? (y/n)" && read CONFIRM_ICONS
echo "Remove Flatpak support? (y/n)" && read CONFIRM_REMOVE_FLATPAK
echo "Remove LibreOffice and install ONLYOFFICE? (y/n)" && read CONFIRM_ONLYOFFICE
echo "Remove Mozilla Firefox and install Google Chrome? (y/n)" && read CONFIRM_CHROME
echo "Install Docker? (y/n)" && read CONFIRM_DOCKER
echo "Install RetroArch? (y/n)" && read CONFIRM_RETROARCH
sudo echo
# ###########################################################
# Directories
# ###########################################################
printtopic "Creating temporary DIR..."
DIR=~/.tmp
DIR_DEB=$DIR/deb
DIR_CODE=~/.config/Code/User
DIR_ICONS=~/.icons
DIR_ORCASLICER=/opt/orcaslicer
DIR_RETROARCH=~/.config/retroarch
DIR_FONTS=/usr/share/fonts/truetype
# Temporary Folder
rm -rf $DIR
mkdir -p $DIR
mkdir -p $DIR_DEB
mkdir -p $DIR_CODE
mkdir -p $DIR_ICONS
mkdir -p $DIR_RETROARCH
sudo mkdir -p $DIR_FONTS/firacode-nerd
sudo mkdir -p $DIR_ORCASLICER
# ###########################################################
# Settings
# ###########################################################
printtopic "Setting up some stuffs..."
if [ $CONFIRM_KEYBOARD == "y" ] || [ $CONFIRM_KEYBOARD == "Y" ]; then
gsettings set org.gnome.desktop.input-sources sources "[('xkb', 'us+alt-intl')]"
gsettings set org.gnome.desktop.input-sources sources "[('xkb', 'us+alt-intl'), ('xkb', 'br')]"
echo "GTK_IM_MODULE=cedilla" | sudo tee -a ~/.profile
echo "QT_IM_MODULE=cedilla" | sudo tee -a ~/.profile
sudo sh -c "sed -e 's@modifier_map Mod3 { Scroll_Lock };@# modifier_map Mod3 { Scroll_Lock };@g' /usr/share/X11/xkb/symbols/br > /usr/share/X11/xkb/symbols/br.tmp"
sudo mv /usr/share/X11/xkb/symbols/br.tmp /usr/share/X11/xkb/symbols/br
fi
if [ $CONFIRM_AMDGPU_SYSTEMD_BOOT == "y" ] || [ $CONFIRM_AMDGPU_SYSTEMD_BOOT == "Y" ]; then
sudo kernelstub -a "radeon.si_support=0 radeon.cik_support=0 amdgpu.si_support=1 amdgpu.cik_support=1 amdgpu.dc=1 amdgpu.dpm=1 amdgpu.modeset=1"
fi
if [ $CONFIRM_AMDGPU_GRUB == "y" ] || [ $CONFIRM_AMDGPU_GRUB == "Y" ]; then
sudo sed -i 's/GRUB_CMDLINE_LINUX_DEFAULT=.*/GRUB_CMDLINE_LINUX_DEFAULT="quiet splash fastboot radeon.si_support=0 radeon.cik_support=0 amdgpu.si_support=1 amdgpu.cik_support=1 amdgpu.dc=1 amdgpu.dpm=1 amdgpu.modeset=1"/g' /etc/default/grub
sudo update-grub
fi
# Gnome Improvements
gsettings set org.gnome.shell.extensions.dash-to-dock show-trash true
gsettings set org.gnome.desktop.peripherals.touchpad disable-while-typing false
gsettings set org.gnome.shell.extensions.dash-to-dock click-action 'minimize'
gsettings set org.gnome.shell.window-switcher current-workspace-only false
gsettings set org.gnome.desktop.wm.keybindings switch-applications "[]"
gsettings set org.gnome.desktop.wm.keybindings switch-windows "['<Super>Tab', '<Alt>Tab']"
gsettings set org.gnome.desktop.wm.keybindings switch-applications-backward "[]"
gsettings set org.gnome.desktop.wm.keybindings switch-windows-backward "['<Shift><Super>Tab', '<Shift><Alt>Tab']"
# ###########################################################
# Fonts and Icons
# ###########################################################
printtopic "Downloading fonts..."
# Fonts
wget -O $DIR/firacode.zip https://github.com/ryanoasis/nerd-fonts/releases/download/v3.1.1/FiraCode.zip
unzip $DIR/firacode.zip -d $DIR/firacode
sudo cp $DIR/firacode/*.ttf $DIR_FONTS/firacode-nerd
sudo fc-cache -f -v
# Icons
if [ $CONFIRM_ICONS == "y" ] || [ $CONFIRM_ICONS == "Y" ]; then
printtopic "Installing Papirus Icon Theme..."
sudo add-apt-repository -y ppa:papirus/papirus
sudo apt-get update
sudo apt-get install -y papirus-icon-theme papirus-folders
gsettings set org.gnome.desktop.interface icon-theme 'Papirus-Dark'
papirus-folders -C darkcyan --theme Papirus-Dark
fi
# ###########################################################
# Update
# ###########################################################
printtopic "Updating the system..."
sudo add-apt-repository -y ppa:oibaf/graphics-drivers
sudo add-apt-repository -y ppa:freecad-maintainers/freecad-stable
sudo apt update
sudo apt full-upgrade -y
# ###########################################################
# Remove Applications
# ###########################################################
printtopic "Removing unused applications..."
if [ $CONFIRM_CHROME == "y" ] || [ $CONFIRM_CHROME == "Y" ]; then
sudo apt remove -y --purge firefox
fi
if [ $CONFIRM_ONLYOFFICE == "y" ] || [ $CONFIRM_ONLYOFFICE == "Y" ]; then
sudo apt remove -y --purge "libreoffice*"
fi
if [ $CONFIRM_REMOVE_FLATPAK == "y" ] || [ $CONFIRM_REMOVE_FLATPAK == "Y" ]; then
printtopic "Removing Flatpak support..."
flatpak uninstall --unused
sudo apt remove -y --autoremove flatpak
sudo apt purge -y flatpak
sudo rm -r $HOME/.local/share/flatpak/
fi
sudo apt clean -y
sudo apt autoremove -y
# ###########################################################
# Dependencies
# ###########################################################
printtopic "Installing some dependencies..."
sudo apt install -y git ca-certificates curl gnupg lsb-release
sudo apt install -y gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly gstreamer1.0-plugins-good libavcodec-extra gstreamer1.0-libav chromium-codecs-ffmpeg-extra
sudo DEBIAN_FRONTEND=noninteractive apt install -yq ubuntu-restricted-extras libdvd-pkg
sudo DEBIAN_FRONTEND=noninteractive dpkg-reconfigure libdvd-pkg
# ###########################################################
# Some Mandatory Applications
# ###########################################################
printtopic "Installing mandatory applications..."
sudo rm /usr/share/applications/evolution-calendar.desktop
sudo apt update
sudo apt install -y file-roller gparted cpu-x mangohud gamemode vulkan-tools jstest-gtk f3d
sudo apt install -y zsh cheese menulibre gparted usb-creator-gtk cpu-x mangohud gamemode vulkan-tools dconf-editor jstest-gtk f3d
sudo apt install -y gnome-music gnome-sound-recorder gnome-maps gnome-tweaks gnome-characters gnome-connections gnome-weather totem
(cd $DIR && curl -s https://api.github.com/repos/SoftFever/OrcaSlicer/releases/latest | grep "browser_download_url.*AppImage" | cut -d : -f 2,3 | tr -d \" | wget -i - && sudo chmod +x OrcaSlicer*.AppImage && sudo mv OrcaSlicer*.AppImage /opt/orcaslicer/OrcaSlicer.AppImage)
if [ -f "orcaslicer.zip" ]; then
unzip orcaslicer.zip -d $DIR/orcaslicer
mv $DIR/orcaslicer/orcaslicer.desktop ~/.local/share/applications/orcaslicer.desktop
sudo mv $DIR/orcaslicer/* $DIR_ORCASLICER
rm orcaslicer.zip
fi
git clone https://github.com/AdnanHodzic/auto-cpufreq $DIR/auto-cpufreq
(cd $DIR/auto-cpufreq && sudo ./auto-cpufreq-installer --install && sudo auto-cpufreq --install)
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" "" --unattended
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
sed -e 's@ZSH_THEME="robbyrussell"@ZSH_THEME="powerlevel10k/powerlevel10k"@g' -e 's@plugins=(git)@plugins=(git zsh-autosuggestions zsh-syntax-highlighting)@g' ~/.zshrc > ~/.zshrc.tmp
mv -f ~/.zshrc.tmp ~/.zshrc
sudo cp -R ~/.oh-my-zsh /root
sudo cp ~/.zshrc /root
chsh -s $(which zsh)
sudo chsh -s $(which zsh)
# ###########################################################
# ONLYOFFICE
# ###########################################################
if [ $CONFIRM_ONLYOFFICE == "y" ] || [ $CONFIRM_ONLYOFFICE == "Y" ]; then
printtopic "Installing Office..."
mkdir -p ~/.gnupg
chmod 700 ~/.gnupg
gpg --no-default-keyring --keyring gnupg-ring:/tmp/onlyoffice.gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys CB2DE8E5
chmod 644 /tmp/onlyoffice.gpg
sudo chown root:root /tmp/onlyoffice.gpg
sudo mv /tmp/onlyoffice.gpg /etc/apt/trusted.gpg.d/
echo 'deb https://download.onlyoffice.com/repo/debian squeeze main' | sudo tee -a /etc/apt/sources.list.d/onlyoffice.list
sudo apt update
sudo apt install -y onlyoffice-desktopeditors
fi
# ###########################################################
# Applications Needs Download
# ###########################################################
printtopic "Installing applications needs download..."
if [ $CONFIRM_CHROME == "y" ] || [ $CONFIRM_CHROME == "Y" ]; then
wget -O $DIR_DEB/chrome.deb https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
fi
wget -O $DIR_DEB/dbeaver.deb https://dbeaver.io/files/dbeaver-ce_latest_amd64.deb
wget -O $DIR_DEB/stl-thumb.deb https://github.com/unlimitedbacon/stl-thumb/releases/download/v0.5.0/stl-thumb_0.5.0_amd64.deb
sudo apt install -y $DIR_DEB/*
if [ $CONFIRM_CHROME == "y" ] || [ $CONFIRM_CHROME == "Y" ]; then
sudo sed -i 's@Exec=/usr/bin/google-chrome-stable %U.*@Exec=/usr/bin/google-chrome-stable --password-store=basic %U@g' /usr/share/applications/google-chrome.desktop
sudo sed -i 's@Exec=/usr/bin/google-chrome-stable --incognito.*@Exec=/usr/bin/google-chrome-stable --incognito --password-store=basic %U@g' /usr/share/applications/google-chrome.desktop
fi
# ###########################################################
# Development Applications
# ###########################################################
printtopic "Installing development applications 💻..."
sudo apt install -y code
bash -c "$(wget -qO- https://raw.githubusercontent.com/harry-cpp/code-nautilus/master/install.sh)"
if [ -f "code.zip" ]; then
unzip code.zip -d $DIR/code
mv $DIR/code/* $DIR_CODE
rm code.zip
fi
if [ $CONFIRM_DOCKER == "y" ] || [ $CONFIRM_DOCKER == "Y" ]; then
sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.asc
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \
$(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt update
sudo apt install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose docker-compose-plugin
sudo groupadd docker
sudo usermod -aG docker $USER
fi
sudo apt install -y nodejs npm
sudo npm install -g n
sudo n stable
sudo npm install -g npm
# ###########################################################
# Graphic Applications
# ###########################################################
printtopic "Installing graphic applications 💅..."
sudo apt install -y blender freecad gimp inkscape
(cd $DIR && git clone https://github.com/Diolinux/PhotoGIMP photogimp && cp -R ./photogimp/.var/app/org.gimp.GIMP/config/GIMP ~/.config/)
# #################################################
# L3110
# #################################################
printtopic "Installing the printer 🖨️..."
if [ -f "l3110.zip" ]; then
unzip l3110.zip -d $DIR/l3110
sudo apt install -y $DIR/l3110/*.deb
(cd $DIR/l3110/epsonscan2 && chmod +x install.sh && ./install.sh)
rm l3110.zip
fi
# #################################################
# Games
# #################################################
if [ $CONFIRM_RETROARCH == "y" ] || [ $CONFIRM_RETROARCH == "Y" ]; then
sudo add-apt-repository -y ppa:libretro/stable
sudo apt-get update
sudo apt-get install -y retroarch
if [ -f "retroarch.zip" ]; then
unzip retroarch.zip -d $DIR/retroarch
mv $DIR/retroarch/* $DIR_RETROARCH
rm retroarch.zip
fi
fi
# ###########################################################
# Last Update
# ###########################################################
printtopic "Finishing..."
sudo apt update
sudo apt full-upgrade -y
# ###########################################################
# Remove Temporary Folder
# ###########################################################
printtopic "Cleaning up..."
rm ~/.bash_history
rm -rf $DIR
# ###########################################################
# END
# ###########################################################
printheader "Installation finished! 🍺" $GREEN
echo "Reboot now? (y/n)" && read CONFIRM_REBOOT
if [ $CONFIRM_REBOOT == "y" ] || [ $CONFIRM_REBOOT == "Y" ]; then
sudo reboot
fi
#!/bin/bash
# ###########################################################
# Functions
# ###########################################################
RED=`tput setaf 1`
GREEN=`tput setaf 2`
YELLOW=`tput setaf 3`
BLUE=`tput setaf 4`
NOCOLOR=`tput sgr0`
printcenter(){
local x
local y
text="$*"
x=$(( ($(tput cols) - ${#text}) / 2))
echo -ne "\E[6n";read -sdR y; y=$(echo -ne "${y#*[}" | cut -d';' -f1)
echo -ne "\033[${y};${x}f$*"
echo
}
printtopic(){
LINE_CHAR=${3:-―}
printf ${2:-$NOCOLOR}
eval printf %.0s$LINE_CHAR '{1..'"${COLUMNS:-$(tput cols)}"\}; echo
printcenter $1
eval printf %.0s$LINE_CHAR '{1..'"${COLUMNS:-$(tput cols)}"\}; echo
printf $NOCOLOR
}
printheader(){
printtopic "$1" ${2:-$NOCOLOR} █
}
printheader "Let me do the hard work and go get some ☕" $BLUE
echo "Setup multiple keyboard layout and cedilla (for international keyboards)? (y/n)" && read CONFIRM_KEYBOARD
echo "Activate AMDGPU and Vulkan support (systemd-boot)? (y/n)" && read CONFIRM_AMDGPU_SYSTEMD_BOOT
echo "Activate AMDGPU and Vulkan support (grub)? (y/n)" && read CONFIRM_AMDGPU_GRUB
echo "Remove Flatpak support? (y/n)" && read CONFIRM_REMOVE_FLATPAK
echo "Remove LibreOffice and install ONLYOFFICE? (y/n)" && read CONFIRM_ONLYOFFICE
echo "Remove Mozilla Firefox and install Google Chrome? (y/n)" && read CONFIRM_CHROME
echo "Install docker? (y/n)" && read CONFIRM_DOCKER
echo "Install RetroArch? (y/n)" && read CONFIRM_RETROARCH
sudo echo
# ###########################################################
# Directories
# ###########################################################
printtopic "Creating temporary DIR..."
DIR=~/.tmp
DIR_DEB=$DIR/deb
DIR_CODE=~/.config/Code/User
DIR_ORCASLICER=/opt/orcaslicer
DIR_RETROARCH=~/.config/retroarch
DIR_FONTS=/usr/share/fonts/truetype
# Temporary Folder
rm -rf $DIR
mkdir -p $DIR
mkdir -p $DIR_DEB
mkdir -p $DIR_CODE
mkdir -p $DIR_RETROARCH
sudo mkdir -p $DIR_FONTS/firacode-nerd
sudo mkdir -p $DIR_ORCASLICER
# ###########################################################
# Settings
# ###########################################################
printtopic "Setting up some stuffs..."
if [ $CONFIRM_KEYBOARD == "y" ] || [ $CONFIRM_KEYBOARD == "Y" ]; then
gsettings set org.gnome.desktop.input-sources sources "[('xkb', 'us+alt-intl')]"
gsettings set org.gnome.desktop.input-sources sources "[('xkb', 'us+alt-intl'), ('xkb', 'br')]"
echo "GTK_IM_MODULE=cedilla" | sudo tee -a ~/.profile
echo "QT_IM_MODULE=cedilla" | sudo tee -a ~/.profile
sudo sh -c "sed -e 's@modifier_map Mod3 { Scroll_Lock };@# modifier_map Mod3 { Scroll_Lock };@g' /usr/share/X11/xkb/symbols/br > /usr/share/X11/xkb/symbols/br.tmp"
sudo mv /usr/share/X11/xkb/symbols/br.tmp /usr/share/X11/xkb/symbols/br
fi
if [ $CONFIRM_AMDGPU_SYSTEMD_BOOT == "y" ] || [ $CONFIRM_AMDGPU_SYSTEMD_BOOT == "Y" ]; then
sudo kernelstub -a "radeon.si_support=0 radeon.cik_support=0 amdgpu.si_support=1 amdgpu.cik_support=1 amdgpu.dc=1 amdgpu.dpm=1 amdgpu.modeset=1"
fi
if [ $CONFIRM_AMDGPU_GRUB == "y" ] || [ $CONFIRM_AMDGPU_GRUB == "Y" ]; then
sudo sed -i 's/GRUB_CMDLINE_LINUX_DEFAULT=.*/GRUB_CMDLINE_LINUX_DEFAULT="quiet splash fastboot radeon.si_support=0 radeon.cik_support=0 amdgpu.si_support=1 amdgpu.cik_support=1 amdgpu.dc=1 amdgpu.dpm=1 amdgpu.modeset=1"/g' /etc/default/grub
sudo update-grub
fi
# Gnome Improvements
gsettings set org.gnome.desktop.peripherals.touchpad disable-while-typing false
gsettings set org.gnome.shell.extensions.dash-to-dock click-action 'minimize'
gsettings set org.gnome.shell.window-switcher current-workspace-only false
gsettings set org.gnome.desktop.wm.keybindings switch-applications "[]"
gsettings set org.gnome.desktop.wm.keybindings switch-windows "['<Super>Tab', '<Alt>Tab']"
gsettings set org.gnome.desktop.wm.keybindings switch-applications-backward "[]"
gsettings set org.gnome.desktop.wm.keybindings switch-windows-backward "['<Shift><Super>Tab', '<Shift><Alt>Tab']"
# ###########################################################
# Fonts
# ###########################################################
printtopic "Downloading fonts..."
# Fonts
wget -O $DIR/firacode.zip https://github.com/ryanoasis/nerd-fonts/releases/download/v3.1.1/FiraCode.zip
unzip $DIR/firacode.zip -d $DIR/firacode
sudo cp $DIR/firacode/*.ttf $DIR_FONTS/firacode-nerd
sudo fc-cache -f -v
# ###########################################################
# Update
# ###########################################################
printtopic "Updating the system..."
sudo add-apt-repository -y ppa:oibaf/graphics-drivers
sudo add-apt-repository -y ppa:freecad-maintainers/freecad-stable
sudo apt update
sudo apt full-upgrade -y
# ###########################################################
# Remove Applications
# ###########################################################
printtopic "Removing unused applications..."
if [ $CONFIRM_CHROME == "y" ] || [ $CONFIRM_CHROME == "Y" ]; then
sudo snap remove firefox
fi
# ###########################################################
# Dependencies
# ###########################################################
printtopic "Installing some dependencies..."
sudo apt install -y git ca-certificates curl gnupg lsb-release
sudo apt install -y gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly gstreamer1.0-plugins-good libavcodec-extra gstreamer1.0-libav chromium-codecs-ffmpeg-extra libfuse2t64 build-essential
sudo DEBIAN_FRONTEND=noninteractive apt install -yq ubuntu-restricted-extras libdvd-pkg
sudo DEBIAN_FRONTEND=noninteractive dpkg-reconfigure libdvd-pkg
# ###########################################################
# Some Mandatory Applications
# ###########################################################
printtopic "Installing mandatory applications..."
sudo rm /usr/share/ubuntu/applications/texdoctk.desktop
sudo apt install -y zsh simple-scan menulibre file-roller gparted usb-creator-gtk cpu-x mangohud gamemode vulkan-tools jstest-gtk f3d
sudo apt install -y gnome-snapshot gnome-calendar gnome-music gnome-sound-recorder gnome-maps gnome-tweaks gnome-characters gnome-connections gnome-shell-extension-manager gnome-weather totem
(cd $DIR && curl -s https://api.github.com/repos/SoftFever/OrcaSlicer/releases/latest | grep "browser_download_url.*AppImage" | cut -d : -f 2,3 | tr -d \" | wget -i - && sudo chmod +x OrcaSlicer*.AppImage && sudo mv OrcaSlicer*.AppImage /opt/orcaslicer/OrcaSlicer.AppImage)
if [ -f "orcaslicer.zip" ]; then
unzip orcaslicer.zip -d $DIR/orcaslicer
mv $DIR/orcaslicer/orcaslicer.desktop ~/.local/share/applications/orcaslicer.desktop
sudo mv $DIR/orcaslicer/* $DIR_ORCASLICER
rm orcaslicer.zip
fi
git clone https://github.com/AdnanHodzic/auto-cpufreq $DIR/auto-cpufreq
(cd $DIR/auto-cpufreq && sudo ./auto-cpufreq-installer --install && sudo auto-cpufreq --install)
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" "" --unattended
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
sed -e 's@ZSH_THEME="robbyrussell"@ZSH_THEME="powerlevel10k/powerlevel10k"@g' -e 's@plugins=(git)@plugins=(git zsh-autosuggestions zsh-syntax-highlighting)@g' ~/.zshrc > ~/.zshrc.tmp
mv -f ~/.zshrc.tmp ~/.zshrc
sudo cp -R ~/.oh-my-zsh /root
sudo cp ~/.zshrc /root
chsh -s $(which zsh)
sudo chsh -s $(which zsh)
# ###########################################################
# ONLYOFFICE
# ###########################################################
if [ $CONFIRM_ONLYOFFICE == "y" ] || [ $CONFIRM_ONLYOFFICE == "Y" ]; then
printtopic "Installing Office..."
sudo snap install onlyoffice-desktopeditors
fi
# ###########################################################
# Applications Needs Download
# ###########################################################
printtopic "Installing applications needs download..."
if [ $CONFIRM_CHROME == "y" ] || [ $CONFIRM_CHROME == "Y" ]; then
wget -O $DIR_DEB/chrome.deb https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
fi
wget -O $DIR_DEB/stl-thumb.deb https://github.com/unlimitedbacon/stl-thumb/releases/download/v0.5.0/stl-thumb_0.5.0_amd64.deb
sudo apt install -y $DIR_DEB/*
if [ $CONFIRM_CHROME == "y" ] || [ $CONFIRM_CHROME == "Y" ]; then
sudo sed -i 's@Exec=/usr/bin/google-chrome-stable %U.*@Exec=/usr/bin/google-chrome-stable --password-store=basic %U@g' /usr/share/applications/google-chrome.desktop
sudo sed -i 's@Exec=/usr/bin/google-chrome-stable --incognito.*@Exec=/usr/bin/google-chrome-stable --incognito --password-store=basic %U@g' /usr/share/applications/google-chrome.desktop
fi
# ###########################################################
# Development Applications
# ###########################################################
printtopic "Installing development applications 💻..."
sudo snap install code --classic
bash -c "$(wget -qO- https://raw.githubusercontent.com/harry-cpp/code-nautilus/master/install.sh)"
if [ -f "code.zip" ]; then
unzip code.zip -d $DIR/code
mv $DIR/code/* $DIR_CODE
rm code.zip
fi
sudo snap install dbeaver-ce
if [ $CONFIRM_DOCKER == "y" ] || [ $CONFIRM_DOCKER == "Y" ]; then
sudo snap install docker
sudo groupadd docker
sudo usermod -aG docker $USER
fi
sudo apt install -y nodejs npm
sudo npm install -g n
sudo n stable
sudo npm install -g npm
# ###########################################################
# Graphic Applications
# ###########################################################
printtopic "Installing graphic applications 💅..."
sudo snap install blender --classic
sudo snap install freecad --beta
sudo snap install inkscape
sudo snap install gimp
(cd $DIR && git clone https://github.com/Diolinux/PhotoGIMP photogimp && cp -R ./photogimp/.var/app/org.gimp.GIMP/config/GIMP ~/.config/)
# #################################################
# L3110
# #################################################
printtopic "Installing the printer 🖨️..."
if [ -f "l3110.zip" ]; then
unzip l3110.zip -d $DIR/l3110
sudo apt install -y $DIR/l3110/*.deb
(cd $DIR/l3110/epsonscan2 && chmod +x install.sh && ./install.sh)
rm l3110.zip
fi
# #################################################
# Games
# #################################################
if [ $CONFIRM_RETROARCH == "y" ] || [ $CONFIRM_RETROARCH == "Y" ]; then
sudo snap install retroarch
if [ -f "retroarch.zip" ]; then
unzip retroarch.zip -d $DIR/retroarch
mv $DIR/retroarch/* $DIR_RETROARCH
rm retroarch.zip
fi
fi
# ###########################################################
# Last Update
# ###########################################################
printtopic "Finishing..."
sudo apt update
sudo apt full-upgrade -y
# ###########################################################
# Remove Temporary Folder
# ###########################################################
printtopic "Cleaning up..."
rm ~/.bash_history
rm -rf $DIR
# ###########################################################
# END
# ###########################################################
printheader "Installation finished! 🍺" $GREEN
echo "Reboot now? (y/n)" && read CONFIRM_REBOOT
if [ $CONFIRM_REBOOT == "y" ] || [ $CONFIRM_REBOOT == "Y" ]; then
sudo reboot
fi
[
{
"key": "shift+alt+down",
"command": "editor.action.copyLinesDownAction",
"when": "editorTextFocus && !editorReadonly"
},
{
"key": "shift+alt+up",
"command": "editor.action.copyLinesUpAction",
"when": "editorTextFocus && !editorReadonly"
},
{
"key": "ctrl+'",
"command": "workbench.action.terminal.toggleTerminal",
"when": "terminal.active"
},
{
"key": "ctrl+shift+i",
"command": "editor.debug.action.selectionToWatch"
}
]
{
"editor.tabSize": 2,
"workbench.colorTheme": "Default Dark+",
"editor.fontFamily": "'FiraCode Nerd Font', 'Droid Sans Mono', 'monospace', monospace, 'Droid Sans Fallback'",
"editor.fontLigatures": true,
"workbench.iconTheme": "material-icon-theme",
"material-icon-theme.activeIconPack": "nest",
"code-runner.clearPreviousOutput": true,
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode",
"git.enableSmartCommit": true,
"terminal.integrated.defaultProfile.linux": "zsh",
"terminal.integrated.defaultProfile.osx": "zsh",
"terminal.integrated.defaultProfile.windows": "zsh",
"workbench.colorCustomizations": {
"terminal.ansiBlack": "#354741",
"terminal.ansiBrightBlue": "#4fc9db",
"terminal.ansiBlue": "#1B7C8A",
"terminal.ansiGreen": "#28C142",
"terminal.ansiYellow": "#E8D46F"
},
"code-runner.executorMap": {
"javascript": "node",
"python": "python3",
"perl": "perl",
"rust": "cargo run",
"go": "go run",
"java": "cd $dir && javac $fileName && java $fileNameWithoutExt",
"c": "cd $dir && gcc $fileName -o $fileNameWithoutExt && $dir$fileNameWithoutExt"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment