useful_scripts/install_ubuntu.sh

92 lines
2.9 KiB
Bash
Executable File

#!/bin/bash
# ubuntu hangs if network interface is not optional
if ! sudo grep -r optional /etc/netplan
then
sudo sed -i '/dhcp4/a\ optional: yes' /etc/netplan/00-installer-config-wifi.yaml
sudo sed -i '/dhcp4/a\ optional: yes' /etc/netplan/00-installer-config.yaml
fi
# Add firefox repo
echo "deb [trusted=yes] https://packages.mozilla.org/apt mozilla main" | sudo tee -a /etc/apt/sources.list.d/mozilla.list > /dev/null
# By default ubuntu installs firefox from snap, so I want to disable it
echo '
Package: *
Pin: origin packages.mozilla.org
Pin-Priority: 1000
' | sudo tee /etc/apt/preferences.d/mozilla
# install packages I need
sudo apt update
sudo apt install -y nala
sudo nala install -y \
xorg `# for graphics` \
make `# for compiling gui` \
gcc `# for compiling gui` \
libx11-dev `# for compiling dwm` \
libxft-dev `# for compiling dwm` \
libxinerama-dev `# for compiling dwm` \
libharfbuzz-dev `# for compiling st` \
suckless-tools `# for dmenu` \
ncdu `# for disk usage analysys` \
brightnessctl `# for keyboard backlight` \
xcompmgr `# for st opacity` \
xwallpaper `# for background` \
ubuntu-wallpapers-jammy `# backgrounds` \
xfe `# classic file manager` \
surf `# suckless browser` \
telegram-desktop \
slack \
firefox \
python3
# remove snap cause I hate it
sudo systemctl disable --now snapd
sudo apt purge snapd -y
# remove autoinstalled stterm
sudo apt remove stterm -y
if [ ! -d ~/gui ]
then
git clone https://git.digitalstudium.com/digitalstudium/ubuntu-gui ~/gui
fi
for tool in dwm st sent
do
# compiling dwm
if ! command -v $tool &> /dev/null
then
cd ~/gui/$tool
sudo make install clean
cd -
fi
done
echo dwm > ~/.xinitrc # for starting dwm when startx
for tool in create_systemd_service.py create_systemd_timer.py set_brightness.sh update_gui.sh
do
if ! command -v $tool &> /dev/null
then
sudo cp $tool /usr/local/bin
fi
done
git config --global user.name "Digital Studium"
git config --global user.email "digitalstudium001@gmail.com"
sudo create_systemd_service.py gui-updater /usr/local/bin/update_gui.sh
sudo create_systemd_timer.py gui-updater '*-*-* *:*:*'
if [ ! -d ~/.dwm ]
then
mkdir $HOME/.dwm
fi
echo "xhost +local:" >> $HOME/.dwm/autostart.sh # give permissions to display
echo "xcompmgr &" >> $HOME/.dwm/autostart.sh # for st opacity
echo "xwallpaper --stretch /usr/share/backgrounds/Blue_flower_by_Elena_Stravoravdi.jpg" >> $HOME/.dwm/autostart.sh # background
echo "firefox &" > $HOME/.dwm/autostart.sh
echo "telegram-desktop &" >> $HOME/.dwm/autostart.sh
echo "st &" >> $HOME/.dwm/autostart.sh
chmod +x $HOME/.dwm/autostart.sh