2017-02-12 11:41:03 +01:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
2017-11-02 16:48:43 +01:00
|
|
|
# Git for /etc
|
2020-01-05 15:06:23 +01:00
|
|
|
sudo pacman -S etckeeper --needed
|
2018-10-08 23:52:53 +02:00
|
|
|
(cd /etc/; sudo git config user.name "etckeeper on $(cat /etc/hostname)"; sudo git config user.email "etckeeper@$(cat /etc/hostname)")
|
2020-01-05 15:06:23 +01:00
|
|
|
[ ! -d /etc/.git ] && sudo etckeeper init
|
|
|
|
sudo etckeeper commit "install-arch script: begin"
|
|
|
|
|
|
|
|
# Install yay
|
2020-03-12 17:56:10 +01:00
|
|
|
# TODO Use yay-bin
|
2020-02-17 07:01:26 +01:00
|
|
|
sudo pacman -S base-devel --needed
|
2020-01-05 15:06:23 +01:00
|
|
|
if ! pacman -Q yay &> /dev/null
|
|
|
|
then
|
2020-02-17 07:01:26 +01:00
|
|
|
sudo pacman -S go-pie --needed
|
2020-02-03 08:44:12 +01:00
|
|
|
mkdir -p $HOME/.cache/yay
|
|
|
|
cd $HOME/.cache/yay
|
2020-02-03 08:41:48 +01:00
|
|
|
curl -L https://aur.archlinux.org/cgit/aur.git/snapshot/yay.tar.gz | tar xzvf -
|
2020-02-03 08:44:12 +01:00
|
|
|
cd yay
|
2020-01-05 15:06:23 +01:00
|
|
|
makepkg -si
|
|
|
|
fi
|
2018-10-08 23:52:53 +02:00
|
|
|
|
2020-01-05 15:06:23 +01:00
|
|
|
# Keyboard layout
|
|
|
|
echo '# File wrote by ~/.dotfiles/config/scripts/install-arch
|
|
|
|
|
|
|
|
Section "InputClass"
|
|
|
|
Identifier "system-keyboard"
|
|
|
|
MatchIsKeyboard "on"
|
|
|
|
Option "XkbLayout" "us_qwerty-fr"
|
|
|
|
EndSection
|
|
|
|
' | sudo tee /etc/X11/xorg.conf.d/00-keyboard.conf
|
|
|
|
|
|
|
|
# Backlight (for Intel Devices)
|
2020-02-03 08:41:48 +01:00
|
|
|
if [ -d /sys/class/backlight/intel_backlight ]
|
|
|
|
then
|
|
|
|
sudo pacman -S xf86-video-intel --needed
|
|
|
|
echo '# File wrote by ~/.dotfiles/config/scripts/install-arch
|
|
|
|
|
|
|
|
Section "Device"
|
|
|
|
Identifier "Intel Graphics"
|
|
|
|
Driver "intel"
|
|
|
|
Option "Backlight" "intel_backlight"
|
|
|
|
EndSection
|
|
|
|
' | sudo tee /etc/X11/xorg.conf.d/20-intel.conf
|
|
|
|
fi
|
2020-01-05 15:06:23 +01:00
|
|
|
|
|
|
|
# Touchpad
|
|
|
|
echo '# File wrote by ~/.dotfiles/config/scripts/install-arch
|
|
|
|
|
|
|
|
Section "InputClass"
|
|
|
|
Identifier "touchpad"
|
|
|
|
Driver "libinput"
|
|
|
|
MatchIsTouchpad "on"
|
|
|
|
Option "Tapping" "on"
|
|
|
|
EndSection
|
|
|
|
' | sudo tee /etc/X11/xorg.conf.d/30-touchpad.conf
|
|
|
|
|
|
|
|
# Disable joystick as mouse
|
|
|
|
echo '# File wrote by ~/.dotfiles/config/scripts/install-arch
|
|
|
|
|
|
|
|
Section "InputClass"
|
|
|
|
Identifier "joystick catchall"
|
|
|
|
MatchIsJoystick "on"
|
|
|
|
MatchDevicePath "/dev/input/event*"
|
|
|
|
Driver "joystick"
|
|
|
|
Option "StartKeysEnabled" "False" #Disable mouse
|
|
|
|
Option "StartMouseEnabled" "False" #support
|
|
|
|
EndSection
|
|
|
|
' | sudo tee /etc/X11/xorg.conf.d/50-joystick.conf
|
|
|
|
|
|
|
|
# Install same rules with nvidia-xrun
|
2020-01-06 16:23:50 +01:00
|
|
|
if [ -d /etc/X11/nvidia-xorg.conf.d ]
|
2020-01-05 15:06:23 +01:00
|
|
|
then
|
|
|
|
function link { # filename
|
2020-01-06 16:23:50 +01:00
|
|
|
sudo ln -s ../xorg.conf.d/$1 /etc/X11/nvidia-xorg.conf.d/$1
|
2020-01-05 15:06:23 +01:00
|
|
|
}
|
|
|
|
link 00-keyboard.conf
|
|
|
|
link 20-intel.conf # Yep
|
|
|
|
link 30-touchpad.conf
|
|
|
|
link 50-joystick.conf
|
|
|
|
fi
|
2020-01-06 16:23:50 +01:00
|
|
|
exit 0
|
2018-10-08 23:52:53 +02:00
|
|
|
|
2017-11-02 16:48:43 +01:00
|
|
|
# Uninstall Manjaro's pamac
|
2020-01-05 15:06:23 +01:00
|
|
|
if pacman -Q pamac &> /dev/null
|
|
|
|
then
|
2017-11-02 16:48:43 +01:00
|
|
|
sudo pacman -Rsc pamac --noconfirm
|
2017-02-12 11:41:03 +01:00
|
|
|
fi
|
|
|
|
|
2017-11-02 16:48:43 +01:00
|
|
|
# Ccache
|
2020-01-05 15:06:23 +01:00
|
|
|
sudo pacman -S ccache --needed
|
2017-11-02 16:48:43 +01:00
|
|
|
sudo sed 's|BUILDENV=\(.\+\)!ccache\(.\+\)|BUILDENV=\1ccache\2|' /etc/makepkg.conf -i
|
|
|
|
|
2020-01-05 15:06:23 +01:00
|
|
|
# Makepkg config
|
|
|
|
sudo sed 's|BUILDENV=\(.\+\)!color\(.\+\)|BUILDENV=\1color\2|' /etc/makepkg.conf -i
|
|
|
|
|
|
|
|
# Pacman config
|
|
|
|
sudo sed 's|#Color|Color\nILoveCandy|' /etc/pacman.conf -i
|
|
|
|
|
2017-02-12 11:41:03 +01:00
|
|
|
# TLP
|
2020-01-05 15:06:23 +01:00
|
|
|
sudo pacman -S tlp --needed
|
|
|
|
# sudo sed 's|SATA_LINKPWR_ON_BAT=min_power|SATA_LINKPWR_ON_BAT=max_performance|' /etc/default/tlp -i
|
|
|
|
sudo systemctl enable tlp.service tlp-sleep.service --now
|
2017-11-02 16:48:43 +01:00
|
|
|
sudo systemctl disable systemd-rfkill.service systemd-rfkill.socket
|
|
|
|
sudo tlp start
|
|
|
|
|
|
|
|
# Numlock on boot
|
2020-01-05 15:06:23 +01:00
|
|
|
echo "# File wrote by ~/.dotfiles/config/scripts/install-arch
|
2017-11-02 16:48:43 +01:00
|
|
|
|
2020-01-05 15:06:23 +01:00
|
|
|
[Service]
|
|
|
|
ExecStartPre=/bin/sh -c 'setleds +num < /dev/%I'
|
|
|
|
" | sudo tee /etc/systemd/system/getty@.service.d/override.conf
|
2017-11-02 16:48:43 +01:00
|
|
|
|
2020-01-05 15:06:23 +01:00
|
|
|
# Makeflags
|
|
|
|
# I'd rather have updates not take my whole CPU
|
|
|
|
# sudo sed "s|#MAKEFLAGS=\"-j2\"|MAKEFLAGS=\"-j$(nproc)\"|" /etc/makepkg.conf -i
|
2017-11-02 16:48:43 +01:00
|
|
|
|
2020-01-05 15:06:23 +01:00
|
|
|
# DHCPCD
|
|
|
|
sudo pacman -S dhcpcd --needed
|
|
|
|
sudo systemctl enable dhcpcd --now
|
2017-02-12 11:41:03 +01:00
|
|
|
|
2020-01-05 15:06:23 +01:00
|
|
|
# Time synchronisation
|
|
|
|
sudo pacman -S chrony --needed
|
|
|
|
echo '# File wrote by ~/.dotfiles/config/scripts/install-arch
|
|
|
|
|
|
|
|
server 0.europe.pool.ntp.org offline
|
|
|
|
server 1.europe.pool.ntp.org offline
|
|
|
|
server 2.europe.pool.ntp.org offline
|
|
|
|
server 3.europe.pool.ntp.org offline
|
|
|
|
driftfile /etc/chrony.drift
|
|
|
|
rtconutc
|
|
|
|
rtcsync' | sudo tee /etc/chrony.conf
|
|
|
|
sudo systemctl enable chronyd --now
|
|
|
|
echo '# File wrote by ~/.dotfiles/config/scripts/install-arch
|
|
|
|
|
|
|
|
if $if_up; then
|
|
|
|
chronyc online
|
|
|
|
elif $if_down; then
|
|
|
|
chronyc offline
|
|
|
|
fi
|
|
|
|
' | sudo tee /etc/dhcpcd.exit-hook
|
|
|
|
|
|
|
|
# Grub other OS
|
|
|
|
sudo pacman -S os-prober --needed
|
|
|
|
sudo grub-mkconfig -o /boot/grub/grub.cfg
|
|
|
|
|
|
|
|
# Manual
|
|
|
|
|
|
|
|
echo '
|
|
|
|
# Hibernation:
|
|
|
|
sudo blkid | grep 'TYPE="swap"'
|
|
|
|
sudoedit /etc/default/grub
|
|
|
|
# Add resume=UUID=<UUID-of-swap-partition> to GRUB_CMDLINE_LINUX_DEFAULT
|
|
|
|
sudo grub-mkconfig -o /boot/grub/grub.cfg
|
|
|
|
'
|
|
|
|
|
|
|
|
echo '
|
|
|
|
# wpa_supplicant (Wi-Fi)
|
|
|
|
sudo pacman -S wpa_supplicant
|
|
|
|
ip link
|
|
|
|
[ ! -f /etc/wpa_supplicant/wpa_supplicant.conf ] && wpa_passphrase 'DUMMY' 'JustToHaveAConfigFiel' > /etc/wpa_supplicant/wpa_supplicant.conf
|
|
|
|
# Replace wlo1 with the correct interface
|
|
|
|
sudo systemctl start wpa_supplicant@wlo1.service
|
|
|
|
sudo ln -s wpa_supplicant.conf /etc/wpa_supplicant/wpa_supplicant-wlo1.conf
|
|
|
|
'
|
|
|
|
|
|
|
|
sudo etckeeper commit "install-arch script: end"
|