2020-08-23 04:22:08 +02:00
|
|
|
#!/bin/bash
|
|
|
|
# Void Linux post-install script
|
2020-08-28 09:46:31 +02:00
|
|
|
echo "$(tput setaf 3)Starting Void Linux post-install script$(tput sgr 0)"
|
2020-08-28 12:33:39 +02:00
|
|
|
|
2020-08-28 19:06:03 +02:00
|
|
|
# Default Answers
|
|
|
|
cpu="${cpu:-a}"
|
|
|
|
video="${video:-q}"
|
|
|
|
pass="${pass:-n}"
|
|
|
|
wm="${wm:-a}"
|
|
|
|
editor="${editor:-m}"
|
|
|
|
cups="${cups:-y}"
|
|
|
|
pop="${pop:-y}"
|
|
|
|
lightdm="${lightdm:-y}"
|
|
|
|
reboot="${reboot:-n}"
|
|
|
|
|
2020-08-28 09:46:31 +02:00
|
|
|
# Ask part
|
|
|
|
echo "$(tput setaf 1)Which CPU do you use?$(tput sgr 0)"
|
2020-08-28 15:28:22 +02:00
|
|
|
read -p "AMD (a) or INTEL (i) [A/i]" -n 1 cpu
|
2020-08-28 19:26:53 +02:00
|
|
|
cpu="${cpu:-a}"
|
2020-08-28 09:46:31 +02:00
|
|
|
echo
|
|
|
|
echo "$(tput setaf 1)Which GPU do you use?$(tput sgr 0)"
|
2020-08-28 15:28:22 +02:00
|
|
|
read -p "NVIDIA (n), AMD (a), INTEL (i) or QEMU (q) [n/a/i/Q] " -n 1 video
|
2020-08-28 19:26:53 +02:00
|
|
|
video="${video:-q}"
|
2020-08-28 09:46:31 +02:00
|
|
|
echo
|
2020-08-28 14:48:19 +02:00
|
|
|
if [[ $video = "n" ]]; then
|
|
|
|
echo "$(tput setaf 1)Do you want to install PCI passthrough?$(tput sgr 0)"
|
2020-08-28 15:28:22 +02:00
|
|
|
read -p "NO (n) or YES (y) [N/y]" -n 1 pass
|
2020-08-28 19:26:53 +02:00
|
|
|
pass="${pass:-n}"
|
2020-08-28 19:06:03 +02:00
|
|
|
echo
|
2020-08-28 14:48:19 +02:00
|
|
|
elif [[ $video = "a" ]]; then
|
|
|
|
echo "$(tput setaf 1)Do you want to install PCI passthrough?$(tput sgr 0)"
|
2020-08-28 15:28:22 +02:00
|
|
|
read -p "NO (n) or YES (y) [N/y]" -n 1 pass
|
2020-08-28 19:26:53 +02:00
|
|
|
pass="${pass:-n}"
|
2020-08-28 19:06:03 +02:00
|
|
|
echo
|
2020-08-28 14:48:19 +02:00
|
|
|
elif [[ $video = "i" ]]; then
|
|
|
|
echo "$(tput setaf 1)Do you want to install PCI passthrough?$(tput sgr 0)"
|
2020-08-28 15:28:22 +02:00
|
|
|
read -p "NO (n) or YES (y) [N/y]" -n 1 pass
|
2020-08-28 19:26:53 +02:00
|
|
|
pass="${pass:-n}"
|
2020-08-28 19:06:03 +02:00
|
|
|
echo
|
2020-08-28 14:48:19 +02:00
|
|
|
fi
|
2020-08-28 09:46:31 +02:00
|
|
|
echo
|
|
|
|
echo "$(tput setaf 1)Which window manager do you want to use?$(tput sgr 0)"
|
2020-08-28 19:06:03 +02:00
|
|
|
read -p "OPENBOX (o) or AWESOME (a) or SOMETHING ELSE (s) [o/A/s]" -n 1 wm
|
2020-08-28 19:26:53 +02:00
|
|
|
wm="${wm:-a}"
|
2020-08-28 09:46:31 +02:00
|
|
|
echo
|
2020-08-28 11:51:10 +02:00
|
|
|
echo "$(tput setaf 1)Which test editor do you want to use?$(tput sgr 0)"
|
2020-08-28 16:06:01 +02:00
|
|
|
read -p "NANO (n) or MICRO (m) or VIM (v) [n/M/v]" -n 1 editor
|
2020-08-28 19:26:53 +02:00
|
|
|
editor="${editor:-m}"
|
2020-08-28 11:51:10 +02:00
|
|
|
echo
|
2020-08-28 09:46:31 +02:00
|
|
|
echo "$(tput setaf 1)Do you want to install printer support?$(tput sgr 0)"
|
2020-08-28 15:28:22 +02:00
|
|
|
read -p "NO (n) or YES (y) [n/Y]" -n 1 cups
|
2020-08-28 19:26:53 +02:00
|
|
|
cups="${cups:-y}"
|
2020-08-28 09:46:31 +02:00
|
|
|
echo
|
|
|
|
echo "$(tput setaf 1)Do you want to share package statistics with void devs?$(tput sgr 0)"
|
2020-08-28 15:28:22 +02:00
|
|
|
read -p "NO (n) or YES (y) [n/Y]" -n 1 pop
|
2020-08-28 19:26:53 +02:00
|
|
|
pop="${pop:-y}"
|
2020-08-28 09:46:31 +02:00
|
|
|
echo
|
2020-08-23 20:09:50 +02:00
|
|
|
|
2020-08-28 11:51:10 +02:00
|
|
|
# Install packages -----------------------------------------------------------------------------------------
|
2020-08-28 03:25:21 +02:00
|
|
|
# Nonfree and multilib repos
|
|
|
|
sudo xbps-install -y $(cat INSTALL/1_repos)
|
2020-08-23 20:50:47 +02:00
|
|
|
sudo xbps-install -Sy $(cat INSTALL/2_base)
|
2020-08-23 20:41:58 +02:00
|
|
|
|
2020-08-28 03:25:21 +02:00
|
|
|
# Remember git login information?
|
|
|
|
#git config --global credential.helper store
|
|
|
|
# Clone also personal dotfiles from gitlab?
|
2020-08-27 06:27:28 +02:00
|
|
|
#git clone https://gitlab.com/awesome-void/awesomeVoid ~/bin/dotfiles
|
2020-08-23 20:09:50 +02:00
|
|
|
|
2020-08-28 11:51:10 +02:00
|
|
|
# Choose editor -----------------------------------------------------------------------------------------
|
|
|
|
if [[ $editor = "n" ]]; then
|
|
|
|
sudo xbps-install -y nano
|
|
|
|
export EDITOR=nano
|
2020-08-28 13:44:22 +02:00
|
|
|
echo EDITOR=nano > ~/.bashrc
|
2020-08-28 13:26:57 +02:00
|
|
|
elif [[ $editor = "m" ]]; then
|
2020-08-28 11:51:10 +02:00
|
|
|
sudo xbps-install -y micro
|
|
|
|
export EDITOR=micro
|
2020-08-28 13:44:22 +02:00
|
|
|
echo EDITOR=micro > ~/.bashrc
|
2020-08-28 15:28:22 +02:00
|
|
|
elif [[ $editor = "v" ]]; then
|
2020-08-28 16:06:01 +02:00
|
|
|
export EDITOR=vim
|
|
|
|
echo EDITOR=vim > ~/.bashrc
|
2020-08-28 11:51:10 +02:00
|
|
|
fi
|
|
|
|
|
|
|
|
# Choose cpu -----------------------------------------------------------------------------------------
|
2020-08-28 10:38:22 +02:00
|
|
|
if [[ $cpu = "a" ]]; then
|
|
|
|
if [[ $video = "n" ]]; then
|
2020-08-28 09:46:31 +02:00
|
|
|
sudo xbps-install -y $(cat INSTALL/3_nvidia)
|
2020-08-28 10:38:22 +02:00
|
|
|
sudo nvidia-xconfig
|
|
|
|
if [[ $pass = "y" ]]; then
|
2020-08-28 09:46:31 +02:00
|
|
|
modprobe kvm-amd
|
|
|
|
sudo cp -r OVMF /usr/share/ovmf
|
|
|
|
chmod +x INSTALL/pass.sh
|
|
|
|
sudo ./INSTALL/pass.sh
|
2020-08-28 10:38:22 +02:00
|
|
|
fi
|
|
|
|
elif [[ $video = "a" ]]; then
|
|
|
|
sudo xbps-install -y $(cat INSTALL/3_ati)
|
|
|
|
if [[ $pass = "y" ]]; then
|
2020-08-28 09:46:31 +02:00
|
|
|
modprobe kvm-amd
|
|
|
|
sudo cp -r OVMF /usr/share/ovmf
|
|
|
|
chmod +x INSTALL/pass.sh
|
|
|
|
sudo ./INSTALL/pass.sh
|
2020-08-28 10:38:22 +02:00
|
|
|
fi
|
|
|
|
elif [[ $video = "i" ]]; then
|
|
|
|
sudo xbps-install -y $(cat INSTALL/3_intel)
|
|
|
|
if [[ $pass = "y" ]]; then
|
2020-08-28 09:46:31 +02:00
|
|
|
modprobe kvm-amd
|
|
|
|
sudo cp -r OVMF /usr/share/ovmf
|
|
|
|
chmod +x INSTALL/pass.sh
|
|
|
|
sudo ./INSTALL/pass.sh
|
2020-08-28 10:38:22 +02:00
|
|
|
fi
|
|
|
|
elif [[ $video = "q" ]]; then
|
|
|
|
sudo xbps-install -y $(cat INSTALL/3_qemu)
|
|
|
|
fi
|
|
|
|
elif [[ $cpu = "i" ]]; then
|
|
|
|
if [[ $video = "n" ]]; then
|
2020-08-28 09:46:31 +02:00
|
|
|
sudo xbps-install -y $(cat INSTALL/3_nvidia)
|
2020-08-28 10:38:22 +02:00
|
|
|
sudo nvidia-xconfig
|
|
|
|
if [[ $pass = "y" ]]; then
|
2020-08-28 09:46:31 +02:00
|
|
|
echo intel nvidia yes
|
|
|
|
modprobe kvm-intel
|
|
|
|
sudo cp -r OVMF /usr/share/ovmf
|
|
|
|
chmod +x INSTALL/pass.sh
|
|
|
|
sudo ./INSTALL/pass.sh
|
2020-08-28 10:38:22 +02:00
|
|
|
fi
|
|
|
|
elif [[ $video = "a" ]]; then
|
|
|
|
sudo xbps-install -y $(cat INSTALL/3_ati)
|
|
|
|
if [[ $pass = "y" ]]; then
|
2020-08-28 09:46:31 +02:00
|
|
|
echo intel amd yes
|
|
|
|
modprobe kvm-intel
|
|
|
|
sudo cp -r OVMF /usr/share/ovmf
|
|
|
|
chmod +x INSTALL/pass.sh
|
|
|
|
sudo ./INSTALL/pass.sh
|
2020-08-28 10:38:22 +02:00
|
|
|
fi
|
|
|
|
elif [[ $video = "i" ]]; then
|
|
|
|
sudo xbps-install -y $(cat INSTALL/3_intel)
|
|
|
|
if [[ $pass = "y" ]]; then
|
2020-08-28 09:46:31 +02:00
|
|
|
echo intel intel yes
|
|
|
|
modprobe kvm-intel
|
|
|
|
sudo cp -r OVMF /usr/share/ovmf
|
|
|
|
chmod +x INSTALL/pass.sh
|
|
|
|
sudo ./INSTALL/pass.sh
|
2020-08-28 10:38:22 +02:00
|
|
|
fi
|
|
|
|
elif [[ $video = "q" ]]; then
|
|
|
|
sudo xbps-install -y $(cat INSTALL/3_qemu)
|
|
|
|
fi
|
2020-08-28 09:46:31 +02:00
|
|
|
fi
|
2020-08-28 11:51:10 +02:00
|
|
|
# Choose window manager -----------------------------------------------------------------------------------------
|
2020-08-28 19:06:03 +02:00
|
|
|
if [[ $wm = "o" ]]; then
|
2020-08-28 03:25:21 +02:00
|
|
|
sudo xbps-install -y $(cat INSTALL/4_desktop)
|
|
|
|
sudo xbps-install -y $(cat INSTALL/5_openbox)
|
2020-08-28 13:44:22 +02:00
|
|
|
-n 1 desk
|
|
|
|
sudo -u $USER obmenu-generator -p -i -u -d -c
|
2020-08-28 09:46:31 +02:00
|
|
|
echo "autorandr common &
|
|
|
|
tint2 &
|
|
|
|
setxkbmap cz &
|
|
|
|
nitrogen --restore &
|
|
|
|
volumeicon &
|
|
|
|
conky &" >> ~/.config/openbox/autostart
|
2020-08-23 23:12:09 +02:00
|
|
|
# cp ~/bin/dotfiles/home/zen/.config/openbox/rc.xml ~/.config/openbox
|
2020-08-28 19:06:03 +02:00
|
|
|
elif [[ $wm = "a" ]]; then
|
2020-08-28 09:46:31 +02:00
|
|
|
echo awesome
|
2020-08-28 03:25:21 +02:00
|
|
|
sudo xbps-install -y $(cat INSTALL/4_desktop)
|
|
|
|
sudo xbps-install -y $(cat INSTALL/5_awesome)
|
2020-08-28 09:46:31 +02:00
|
|
|
fi
|
2020-08-23 11:42:14 +02:00
|
|
|
|
2020-08-28 09:46:31 +02:00
|
|
|
sudo xbps-install -Sy $(cat INSTALL/6_media)
|
2020-08-23 09:41:59 +02:00
|
|
|
#sudo xbps-install -Sy $(cat INSTALL/7_virtual)
|
|
|
|
#sudo xbps-install -Sy $(cat INSTALL/8_big)
|
2020-08-28 09:46:31 +02:00
|
|
|
#sudo xbps-install -Sy $(cat INSTALL/)
|
2020-08-27 00:26:03 +02:00
|
|
|
|
2020-08-28 11:51:10 +02:00
|
|
|
# printer support -----------------------------------------------------------------------------------------
|
2020-08-26 23:56:42 +02:00
|
|
|
if [[ $cups = "y" ]]; then
|
2020-08-28 03:25:21 +02:00
|
|
|
sudo xbps-install -y $(cat INSTALL/9_print)
|
2020-08-27 02:39:49 +02:00
|
|
|
sudo ln -s /etc/sv/cupsd /var/service
|
2020-08-26 23:56:42 +02:00
|
|
|
fi
|
2020-08-27 00:26:03 +02:00
|
|
|
|
|
|
|
# make fish base shell-----------------------------------------------------------------------------------------
|
2020-08-28 03:25:21 +02:00
|
|
|
sudo usermod --shell /bin/fish $USER
|
2020-08-28 11:52:17 +02:00
|
|
|
export TERMINAL=sakura
|
2020-08-28 13:44:22 +02:00
|
|
|
echo TERMINAL=sakura > ~/.bashrc
|
2020-08-25 21:50:56 +02:00
|
|
|
#echo ". ~/.config/fish/aliases.fish" >> ~/.config/fish/config.fish
|
|
|
|
#echo "alias xterm 'sakura'" >> ~/.config/fish/aliases.fish
|
2020-08-23 20:45:13 +02:00
|
|
|
|
2020-08-27 00:26:03 +02:00
|
|
|
# socklog-----------------------------------------------------------------------------------------
|
2020-08-23 20:45:13 +02:00
|
|
|
sudo usermod -a -G socklog $USER
|
2020-08-23 20:09:50 +02:00
|
|
|
|
2020-08-28 11:51:10 +02:00
|
|
|
# Language -----------------------------------------------------------------------------------------
|
|
|
|
echo "$(tput setaf 1)Unncomment desired language(s) $(tput sgr 0)"
|
|
|
|
sleep 3
|
|
|
|
sudo $EDITOR /etc/default/libc-locales
|
2020-08-23 06:29:31 +02:00
|
|
|
sudo xbps-reconfigure -f glibc-locales
|
2020-08-23 20:09:50 +02:00
|
|
|
|
2020-08-28 11:51:10 +02:00
|
|
|
# creating bare repository -----------------------------------------------------------------------------------------
|
2020-08-23 11:52:45 +02:00
|
|
|
mkdir ~/.void
|
|
|
|
cd ~/.void
|
2020-08-15 09:36:25 +02:00
|
|
|
git init --bare
|
2020-08-23 20:09:50 +02:00
|
|
|
|
2020-08-28 11:51:10 +02:00
|
|
|
# Share packages with void devs -----------------------------------------------------------------------------------------
|
2020-08-28 10:38:22 +02:00
|
|
|
if [[ $pop = "y" ]]; then
|
|
|
|
sudo xbps-install -y PopCorn
|
|
|
|
sudo ln -s /etc/sv/popcorn /var/service/
|
|
|
|
fi
|
2020-08-27 01:53:29 +02:00
|
|
|
|
2020-08-28 11:51:10 +02:00
|
|
|
# Install services -----------------------------------------------------------------------------------------
|
2020-08-28 09:46:31 +02:00
|
|
|
sudo ln -s /etc/sv/dbus /var/service/
|
|
|
|
sudo ln -s /etc/sv/elogind /var/service/
|
|
|
|
#sudo ln -s /etc/sv/acpid /var/service/
|
|
|
|
sudo ln -s /etc/sv/socklog-unix /var/service/
|
|
|
|
sudo ln -s /etc/sv/nanoklogd /var/service/
|
|
|
|
sudo ln -s /etc/sv/crond /var/service/
|
|
|
|
sudo ln -s /etc/sv/chronyd /var/service/
|
2020-08-23 20:09:50 +02:00
|
|
|
|
2020-08-28 19:06:03 +02:00
|
|
|
if [[ $wm = "o" ]]; then
|
2020-08-28 13:44:22 +02:00
|
|
|
echo "$(tput setaf 1)Do you want to run lightdm now?$(tput sgr 0)"
|
2020-08-28 15:28:22 +02:00
|
|
|
read -p "Run lightdm now? NO (n) or YES (y) [n/Y]" -n 1 lightdm
|
2020-08-28 19:26:53 +02:00
|
|
|
lightdm="${lightdm:-y}"
|
2020-08-28 13:44:22 +02:00
|
|
|
echo
|
|
|
|
if [[ $lightdm = "y" ]]; then
|
|
|
|
sudo ln -s /etc/sv/lightdm /var/service/
|
|
|
|
else
|
|
|
|
sudo touch /etc/sv/lightdm/down
|
|
|
|
sudo ln -s /etc/sv/lightdm /var/service/
|
2020-08-28 20:00:10 +02:00
|
|
|
echo "$(tput setaf 3)Remove down file after for run Lightdm..$(tput sgr 0)"
|
|
|
|
echo "$(tput setaf 3)Use 'sudo rm /etc/sv/lightdm/down'$(tput sgr 0)"
|
2020-08-28 13:44:22 +02:00
|
|
|
fi
|
2020-08-28 19:06:03 +02:00
|
|
|
elif [[ $wm = "a" ]]; then
|
2020-08-28 13:44:22 +02:00
|
|
|
echo "$(tput setaf 1)Do you want to run lightdm now?$(tput sgr 0)"
|
2020-08-28 15:28:22 +02:00
|
|
|
read -p "Run lightdm now? NO (n) or YES (y) [n/Y]" -n 1 lightdm
|
2020-08-28 19:26:53 +02:00
|
|
|
lightdm="${lightdm:-y}"
|
2020-08-28 13:44:22 +02:00
|
|
|
echo
|
|
|
|
if [[ $lightdm = "y" ]]; then
|
|
|
|
sudo ln -s /etc/sv/lightdm /var/service/
|
|
|
|
else
|
|
|
|
sudo touch /etc/sv/lightdm/down
|
|
|
|
sudo ln -s /etc/sv/lightdm /var/service/
|
2020-08-28 20:00:10 +02:00
|
|
|
echo "$(tput setaf 3)Remove down file after for run Lightdm..$(tput sgr 0)"
|
|
|
|
echo "$(tput setaf 3)Use 'sudo rm /etc/sv/lightdm/down'$(tput sgr 0)"
|
2020-08-28 13:44:22 +02:00
|
|
|
fi
|
2020-08-28 13:50:23 +02:00
|
|
|
fi
|
2020-08-28 14:06:21 +02:00
|
|
|
echo "$(tput setaf 1)Do you want to restart your computer now?$(tput sgr 0)"
|
2020-08-28 15:28:22 +02:00
|
|
|
read -p "Restart now? NO (n) or YES (y) [N/y]" -n 1 reboot
|
2020-08-28 19:26:53 +02:00
|
|
|
reboot="${reboot:-n}"
|
2020-08-28 14:19:34 +02:00
|
|
|
echo
|
2020-08-28 13:58:35 +02:00
|
|
|
if [[ $reboot = "n" ]]; then
|
2020-08-28 14:19:34 +02:00
|
|
|
echo "$(tput setaf 3)Enjoy void linux$(tput sgr 0)"
|
2020-08-28 13:26:57 +02:00
|
|
|
else
|
2020-08-28 13:58:35 +02:00
|
|
|
sudo reboot
|
2020-08-28 10:54:27 +02:00
|
|
|
fi
|