|
|
@ -1,8 +1,6 @@
|
|
|
|
#!/bin/bash
|
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
|
|
|
|
# TODO make this work
|
|
|
|
set -euo pipefail
|
|
|
|
# NOTE ignore errors from missing "||". Try getting the line below to work
|
|
|
|
|
|
|
|
#set -euo pipefail
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# function to keep sudo from timing out
|
|
|
|
# function to keep sudo from timing out
|
|
|
|
function func_dont_timeout {
|
|
|
|
function func_dont_timeout {
|
|
|
@ -20,11 +18,13 @@ fi
|
|
|
|
# keep sudo active in background
|
|
|
|
# keep sudo active in background
|
|
|
|
func_dont_timeout &
|
|
|
|
func_dont_timeout &
|
|
|
|
|
|
|
|
|
|
|
|
# get current directory
|
|
|
|
# get script directory
|
|
|
|
setupdir=$(pwd)
|
|
|
|
scriptloc="$BASH_SOURCE"
|
|
|
|
|
|
|
|
setupdir=$(dirname "$scriptloc")
|
|
|
|
|
|
|
|
#setupdir=$(pwd)
|
|
|
|
|
|
|
|
|
|
|
|
#change to home (does not show in terminal)
|
|
|
|
#change to home directory
|
|
|
|
cd "$HOME"
|
|
|
|
#cd "$HOME"
|
|
|
|
|
|
|
|
|
|
|
|
# check if multilib repo is enabled
|
|
|
|
# check if multilib repo is enabled
|
|
|
|
if ! pacman -Sl multilib &>/dev/null; then
|
|
|
|
if ! pacman -Sl multilib &>/dev/null; then
|
|
|
@ -40,17 +40,13 @@ sudo pacman -Syu
|
|
|
|
echo Select packages to install
|
|
|
|
echo Select packages to install
|
|
|
|
|
|
|
|
|
|
|
|
cmd=(dialog --separate-output --checklist "Select Desktop environment/Window manager:" 22 76 16)
|
|
|
|
cmd=(dialog --separate-output --checklist "Select Desktop environment/Window manager:" 22 76 16)
|
|
|
|
options=(0 "[DE] xfce4" off # any option can be set to default to "on"
|
|
|
|
options=(100 "[WM] sway" off)
|
|
|
|
100 "[WM] i3-gaps" off)
|
|
|
|
|
|
|
|
choices=$("${cmd[@]}" "${options[@]}" 2>&1 >/dev/tty)
|
|
|
|
choices=$("${cmd[@]}" "${options[@]}" 2>&1 >/dev/tty)
|
|
|
|
clear
|
|
|
|
clear
|
|
|
|
for choice in $choices; do
|
|
|
|
for choice in $choices; do
|
|
|
|
case $choice in
|
|
|
|
case $choice in
|
|
|
|
0)
|
|
|
|
|
|
|
|
echo "xfce4" >>"$setupdir/selectedpkgs.txt"
|
|
|
|
|
|
|
|
;;
|
|
|
|
|
|
|
|
100)
|
|
|
|
100)
|
|
|
|
echo "i3-gaps" >>"$setupdir/selectedpkgs.txt"
|
|
|
|
printf '%s\n' 'sway' 'swaylock' 'swayidle' 'swaybg' 'xorg-xwayland' >> "$setupdir/selectedpkgs.txt"
|
|
|
|
;;
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
esac
|
|
|
|
done
|
|
|
|
done
|
|
|
@ -151,6 +147,27 @@ for choice in $choices; do
|
|
|
|
;;
|
|
|
|
;;
|
|
|
|
80)
|
|
|
|
80)
|
|
|
|
echo "onedriver" >>"$setupdir/aurselectedpkgs.txt"
|
|
|
|
echo "onedriver" >>"$setupdir/aurselectedpkgs.txt"
|
|
|
|
|
|
|
|
esac
|
|
|
|
|
|
|
|
done
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
in_acpufreq=0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
cmd=(dialog --separate-output --checklist "Performance and Battery life" 22 76 16)
|
|
|
|
|
|
|
|
options=(0 "auto-cpufreq" off
|
|
|
|
|
|
|
|
1 "corectrl" off)
|
|
|
|
|
|
|
|
choices=$("${cmd[@]}" "${options[@]}" 2>&1 >/dev/tty)
|
|
|
|
|
|
|
|
clear
|
|
|
|
|
|
|
|
for choice in $choices
|
|
|
|
|
|
|
|
do
|
|
|
|
|
|
|
|
case $choice in
|
|
|
|
|
|
|
|
0)
|
|
|
|
|
|
|
|
in_acpufreq=1
|
|
|
|
|
|
|
|
echo "auto-cpufreq-git" >> "$setupdir/aurselectedpkgs.txt"
|
|
|
|
|
|
|
|
# TODO Handle rest of installation
|
|
|
|
|
|
|
|
;;
|
|
|
|
|
|
|
|
1)
|
|
|
|
|
|
|
|
echo "corectrl" >> "$setupdir/aurselectedpkgs.txt"
|
|
|
|
|
|
|
|
>>>>>>> e733d5d1 (Prepare for sway. Remove old comments)
|
|
|
|
;;
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
esac
|
|
|
|
done
|
|
|
|
done
|
|
|
@ -173,31 +190,12 @@ for choice in $choices; do
|
|
|
|
printf '%s\n' 'git' 'emacs' 'ripgrep' 'fd' 'pandoc' 'shellcheck' 'python-pipenv' 'python-isort' 'python-pytest' 'python-rednose' 'pychecker' 'texlive-core' 'pyright' 'python-grip' 'prettier' 'shfmt' >>"$setupdir/aurselectedpkgs.txt"
|
|
|
|
printf '%s\n' 'git' 'emacs' 'ripgrep' 'fd' 'pandoc' 'shellcheck' 'python-pipenv' 'python-isort' 'python-pytest' 'python-rednose' 'pychecker' 'texlive-core' 'pyright' 'python-grip' 'prettier' 'shfmt' >>"$setupdir/aurselectedpkgs.txt"
|
|
|
|
# TODO handle rest of installation
|
|
|
|
# TODO handle rest of installation
|
|
|
|
;;
|
|
|
|
;;
|
|
|
|
1)
|
|
|
|
|
|
|
|
echo "vscodium-bin" >>"$setupdir/aurselectedpkgs.txt"
|
|
|
|
|
|
|
|
;;
|
|
|
|
|
|
|
|
10)
|
|
|
|
10)
|
|
|
|
in_podman=1
|
|
|
|
in_podman=1
|
|
|
|
;;
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
esac
|
|
|
|
done
|
|
|
|
done
|
|
|
|
|
|
|
|
|
|
|
|
cmd=(dialog --separate-output --checklist "School and work communication" 22 76 16)
|
|
|
|
|
|
|
|
options=(0 "Teams" off
|
|
|
|
|
|
|
|
10 "OneNote" off)
|
|
|
|
|
|
|
|
choices=$("${cmd[@]}" "${options[@]}" 2>&1 >/dev/tty)
|
|
|
|
|
|
|
|
clear
|
|
|
|
|
|
|
|
for choice in $choices; do
|
|
|
|
|
|
|
|
case $choice in
|
|
|
|
|
|
|
|
0)
|
|
|
|
|
|
|
|
echo "teams" >>"$setupdir/aurselectedpkgs.txt"
|
|
|
|
|
|
|
|
;;
|
|
|
|
|
|
|
|
10)
|
|
|
|
|
|
|
|
echo "p3x-onenote" >>"$setupdir/aurselectedpkgs.txt"
|
|
|
|
|
|
|
|
;;
|
|
|
|
|
|
|
|
esac
|
|
|
|
|
|
|
|
done
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
cmd=(dialog --separate-output --checklist "Report installed packages?" 22 76 16)
|
|
|
|
cmd=(dialog --separate-output --checklist "Report installed packages?" 22 76 16)
|
|
|
|
options=(0 "pkgstats" off)
|
|
|
|
options=(0 "pkgstats" off)
|
|
|
|
choices=$("${cmd[@]}" "${options[@]}" 2>&1 >/dev/tty)
|
|
|
|
choices=$("${cmd[@]}" "${options[@]}" 2>&1 >/dev/tty)
|
|
|
@ -210,6 +208,7 @@ for choice in $choices; do
|
|
|
|
esac
|
|
|
|
esac
|
|
|
|
done
|
|
|
|
done
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
: '
|
|
|
|
# Packages installed on different systems
|
|
|
|
# Packages installed on different systems
|
|
|
|
in_arco_pc=0
|
|
|
|
in_arco_pc=0
|
|
|
|
in_arco_hp=0
|
|
|
|
in_arco_hp=0
|
|
|
@ -229,6 +228,7 @@ for choice in $choices; do
|
|
|
|
;;
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
esac
|
|
|
|
done
|
|
|
|
done
|
|
|
|
|
|
|
|
'
|
|
|
|
|
|
|
|
|
|
|
|
rm "$setupdir/notfoundpackages.txt"
|
|
|
|
rm "$setupdir/notfoundpackages.txt"
|
|
|
|
|
|
|
|
|
|
|
@ -246,6 +246,7 @@ echo Uninstalling unused packages
|
|
|
|
while read package; do
|
|
|
|
while read package; do
|
|
|
|
sudo pacman -Rns --noconfirm "$package"
|
|
|
|
sudo pacman -Rns --noconfirm "$package"
|
|
|
|
done <"$setupdir/packages/uninstall.txt"
|
|
|
|
done <"$setupdir/packages/uninstall.txt"
|
|
|
|
|
|
|
|
|
|
|
|
echo Uninstalled unused packages
|
|
|
|
echo Uninstalled unused packages
|
|
|
|
|
|
|
|
|
|
|
|
#pacman programs
|
|
|
|
#pacman programs
|
|
|
@ -265,7 +266,7 @@ done <"$setupdir/packages/winepkgs.txt"
|
|
|
|
echo Installed wine
|
|
|
|
echo Installed wine
|
|
|
|
|
|
|
|
|
|
|
|
# install paru-bin
|
|
|
|
# install paru-bin
|
|
|
|
if [[ ! $(pacman -Q | grep paru) ]]; then
|
|
|
|
if [[ ! $(pacman -Q paru) ]]; then
|
|
|
|
echo "Installing paru from the AUR"
|
|
|
|
echo "Installing paru from the AUR"
|
|
|
|
git clone https://aur.archlinux.org/paru-bin.git
|
|
|
|
git clone https://aur.archlinux.org/paru-bin.git
|
|
|
|
cd paru-bin
|
|
|
|
cd paru-bin
|
|
|
@ -312,6 +313,15 @@ if [ -f "$setupdir/aurselectedpkgs.txt" ]; then
|
|
|
|
paru -S --needed - <"$setupdir/aurselectedpkgs.txt" || true
|
|
|
|
paru -S --needed - <"$setupdir/aurselectedpkgs.txt" || true
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#performance and battery life
|
|
|
|
|
|
|
|
if [ $in_acpufreq -eq 1 ]; then
|
|
|
|
|
|
|
|
echo "Installing auto-cpufreq"
|
|
|
|
|
|
|
|
paru -S --needed auto-cpufreq-git
|
|
|
|
|
|
|
|
sudo auto-cpufreq --install
|
|
|
|
|
|
|
|
sudo systemctl start auto-cpufreq
|
|
|
|
|
|
|
|
sudo systemctl enable auto-cpufreq
|
|
|
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
#devtools
|
|
|
|
#devtools
|
|
|
|
if [ $in_doomemacs -eq 1 ]; then
|
|
|
|
if [ $in_doomemacs -eq 1 ]; then
|
|
|
|
echo "Installing doom-emacs"
|
|
|
|
echo "Installing doom-emacs"
|
|
|
@ -321,8 +331,6 @@ if [ $in_doomemacs -eq 1 ]; then
|
|
|
|
git clone --depth 1 https://github.com/hlissner/doom-emacs ~/.emacs.d
|
|
|
|
git clone --depth 1 https://github.com/hlissner/doom-emacs ~/.emacs.d
|
|
|
|
~/.emacs.d/bin/doom install
|
|
|
|
~/.emacs.d/bin/doom install
|
|
|
|
export PATH="$PATH":$HOME/.emacs.d/bin
|
|
|
|
export PATH="$PATH":$HOME/.emacs.d/bin
|
|
|
|
else
|
|
|
|
|
|
|
|
echo "Skipping doom-emacs"
|
|
|
|
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
if [ $in_podman -eq 1 ]; then
|
|
|
|
if [ $in_podman -eq 1 ]; then
|
|
|
@ -332,8 +340,6 @@ if [ $in_podman -eq 1 ]; then
|
|
|
|
sudo usermod --add-subuids 100000-165536 --add-subgids 100000-165536 "$USER"
|
|
|
|
sudo usermod --add-subuids 100000-165536 --add-subgids 100000-165536 "$USER"
|
|
|
|
sudo groupadd -f podman
|
|
|
|
sudo groupadd -f podman
|
|
|
|
sudo usermod -aG podman "$USER"
|
|
|
|
sudo usermod -aG podman "$USER"
|
|
|
|
else
|
|
|
|
|
|
|
|
echo "Skipping podman"
|
|
|
|
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
# other system configs
|
|
|
|
# other system configs
|
|
|
@ -355,28 +361,41 @@ fi
|
|
|
|
##############################
|
|
|
|
##############################
|
|
|
|
##### Configuration #####
|
|
|
|
##### Configuration #####
|
|
|
|
##############################
|
|
|
|
##############################
|
|
|
|
|
|
|
|
echo Configuring packages
|
|
|
|
|
|
|
|
|
|
|
|
#change shell
|
|
|
|
#change shell
|
|
|
|
chsh -s /usr/bin/fish "$USER"
|
|
|
|
chsh -s /usr/bin/fish "$USER"
|
|
|
|
|
|
|
|
|
|
|
|
# setup autotrash
|
|
|
|
# setup autotrash
|
|
|
|
autotrash -td 5 --install
|
|
|
|
autotrash -td 5 --install
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#enable vnstat
|
|
|
|
|
|
|
|
sudo systemctl enable --now vnstat
|
|
|
|
|
|
|
|
|
|
|
|
systemctl --user enable autotrash.timer
|
|
|
|
systemctl --user enable autotrash.timer
|
|
|
|
|
|
|
|
|
|
|
|
# enable lockscreen for systemd
|
|
|
|
# enable lockscreen for systemd
|
|
|
|
sudo systemctl enable betterlockscreen@$USER
|
|
|
|
#sudo systemctl enable betterlockscreen@$USER
|
|
|
|
|
|
|
|
|
|
|
|
# enable firewall
|
|
|
|
# enable firewall
|
|
|
|
echo "Enabling Firewall"
|
|
|
|
echo "Enabling Firewall"
|
|
|
|
sudo systemctl enable --now firewalld
|
|
|
|
sudo systemctl enable --now firewalld
|
|
|
|
sudo firewall-cmd --zone=public --permanent --remove-service=ssh
|
|
|
|
# || true because firewalld doesn't work without a reboot
|
|
|
|
|
|
|
|
sudo firewall-cmd --zone=public --permanent --remove-service=ssh || true
|
|
|
|
|
|
|
|
|
|
|
|
# enable lightdm
|
|
|
|
# enable greetd
|
|
|
|
sudo systemctl enable lightdm
|
|
|
|
sudo systemctl enable greetd
|
|
|
|
|
|
|
|
|
|
|
|
# regenerate locale
|
|
|
|
# regenerate locale
|
|
|
|
# Fixes rofi not launching
|
|
|
|
# Fixes rofi not launching
|
|
|
|
sudo locale-gen
|
|
|
|
#sudo locale-gen
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
: '
|
|
|
|
|
|
|
|
if [[ $(pacman -Q | grep sway) ]]; then
|
|
|
|
|
|
|
|
sudo systemctl enable --now seatd.service
|
|
|
|
|
|
|
|
sudo gpasswd -a "$USER" seat 1>/dev/null
|
|
|
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
'
|
|
|
|
|
|
|
|
|
|
|
|
# update fonts cache
|
|
|
|
# update fonts cache
|
|
|
|
fc-cache -f
|
|
|
|
fc-cache -f
|
|
|
|