-
Notifications
You must be signed in to change notification settings - Fork 166
/
9-setup.sh
executable file
·158 lines (112 loc) · 4.63 KB
/
9-setup.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
#!/usr/bin/env bash
#-------------------------------------------------------------------------
# _ _ __ __ _ _
# /_\ _ _ __| |_ | \/ |__ _| |_(_)__
# / _ \| '_/ _| ' \| |\/| / _` | _| / _|
# /_/ \_\_| \__|_||_|_| |_\__,_|\__|_\__|
# Arch Linux Post Install Setup and Config
#-------------------------------------------------------------------------
echo
echo "FINAL SETUP AND CONFIGURATION"
# ------------------------------------------------------------------------
echo
echo "Genaerating .xinitrc file"
# Generate the .xinitrc file so we can launch XFCE from the
# terminal using the "startx" command
cat <<EOF > ${HOME}/.xinitrc
#!/bin/bash
if [ -d /etc/X11/xinit/xinitrc.d ] ; then
for f in /etc/X11/xinit/xinitrc.d/?*.sh ; do
[ -x "\$f" ] && . "\$f"
done
unset f
fi
source /etc/xdg/xfce4/xinitrc
exit 0
EOF
# ------------------------------------------------------------------------
echo
echo "Updating /bin/startx to use the correct path"
# By default, startx incorrectly looks for the .serverauth file in our HOME folder.
sudo sed -i 's|xserverauthfile=\$HOME/.serverauth.\$\$|xserverauthfile=\$XAUTHORITY|g' /bin/startx
# ------------------------------------------------------------------------
echo
echo "Configuring LTS Kernel as a secondary boot option"
sudo cp /boot/loader/entries/arch.conf /boot/loader/entries/arch-lts.conf
sudo sed -i 's|Arch Linux|Arch Linux LTS Kernel|g' /boot/loader/entries/arch-lts.conf
sudo sed -i 's|vmlinuz-linux|vmlinuz-linux-lts|g' /boot/loader/entries/arch-lts.conf
sudo sed -i 's|initramfs-linux.img|initramfs-linux-lts.img|g' /boot/loader/entries/arch-lts.conf
# ------------------------------------------------------------------------
echo
echo "Configuring MAKEPKG to use all 8 cores"
sudo sed -i -e 's|[#]*MAKEFLAGS=.*|MAKEFLAGS="-j$(nproc)"|g' makepkg.conf
sudo sed -i -e 's|[#]*COMPRESSXZ=.*|COMPRESSXZ=(xz -c -T 8 -z -)|g' makepkg.conf
# ------------------------------------------------------------------------
echo
echo "Configuring vconsole.conf to set a larger font for login shell"
sudo cat <<EOF > /etc/vconsole.conf
KEYMAP=us
FONT=ter-v32b
EOF
# ------------------------------------------------------------------------
echo
echo "Setting laptop lid close to suspend"
sudo sed -i -e 's|[# ]*HandleLidSwitch[ ]*=[ ]*.*|HandleLidSwitch=suspend|g' /etc/systemd/logind.conf
# ------------------------------------------------------------------------
echo
echo "Disabling buggy cursor inheritance"
# When you boot with multiple monitors the cursor can look huge. This fixes it.
sudo cat <<EOF > /usr/share/icons/default/index.theme
[Icon Theme]
#Inherits=Theme
EOF
# ------------------------------------------------------------------------
echo
echo "Increasing file watcher count"
# This prevents a "too many files" error in Visual Studio Code
echo fs.inotify.max_user_watches=524288 | sudo tee /etc/sysctl.d/40-max-user-watches.conf && sudo sysctl --system
# ------------------------------------------------------------------------
echo
echo "Disabling Pulse .esd_auth module"
# Pulse audio loads the `esound-protocol` module, which best I can tell is rarely needed.
# That module creates a file called `.esd_auth` in the home directory which I'd prefer to not be there. So...
sudo sed -i 's|load-module module-esound-protocol-unix|#load-module module-esound-protocol-unix|g' /etc/pulse/default.pa
# ------------------------------------------------------------------------
echo
echo "Enabling bluetooth daemon and setting it to auto-start"
sudo sed -i 's|#AutoEnable=false|AutoEnable=true|g' /etc/bluetooth/main.conf
sudo systemctl enable bluetooth.service
sudo systemctl start bluetooth.service
# ------------------------------------------------------------------------
echo
echo "Enabling the cups service daemon so we can print"
systemctl enable org.cups.cupsd.service
systemctl start org.cups.cupsd.service
# ------------------------------------------------------------------------
echo
echo "Enabling Network Time Protocol so clock will be set via the network"
sudo ntpd -qg
sudo systemctl enable ntpd.service
sudo systemctl start ntpd.service
# ------------------------------------------------------------------------
echo
echo "NETWORK SETUP"
echo
echo "Find your IP Link name:"
echo
ip link
echo
read -p "ENTER YOUR IP LINK: " LINK
echo
echo "Disabling DHCP and enabling Network Manager daemon"
echo
sudo systemctl disable dhcpcd.service
sudo systemctl stop dhcpcd.service
sudo ip link set dev ${LINK} down
sudo systemctl enable NetworkManager.service
sudo systemctl start NetworkManager.service
sudo ip link set dev ${LINK} up
echo "Done!"
echo
echo "Reboot now..."
echo