-
Notifications
You must be signed in to change notification settings - Fork 0
/
01b_install_config_sudo.sh
executable file
·55 lines (45 loc) · 1.46 KB
/
01b_install_config_sudo.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
#!/bin/bash
section_header () {
echo ""
echo "---------------"
echo ""
echo $1
}
section_header_with_output () {
section_header "$1"
echo "---"
}
#// Root check
if [[ $EUID != 0 ]]; then
echo "This script must be run as root."
exit 1
fi
if [ "$1" != "-s" ]; then
echo "-*************-"
echo "Make sure you ran the normal '01a_install_config.sh' file first. Things will not work properly if you haven't run that script first."
echo "-*************-"
read -p "Press Ctrl+C to stop or ENTER to proceed "
fi
#// Get user name
Username=$SUDO_USER
#// Copy over root files
section_header_with_output "Copying over root files..."
rsync -av ./files/generic/root/ /
#// Special case, copy over emacs and ranger config for root user
section_header "Copying over emacs/ranger config for root user..."
rm -rf /root/.config/ranger
cp -r ./files/generic/home/.config/ranger /root/.config
cp -r ./files/generic/home/.emacs /root/
cp -r ./files/generic/home/.emacs.d /root/
#// Install fonts
section_header "Installing fonts..."
sudo -u $Username fc-cache -f
#// Update username in lightdm-mini-greeter and enable lightdm
sed -i -e "/user =/ s/= .*/= $Username/" /etc/lightdm/lightdm-mini-greeter.conf
sudo systemctl enable lightdm.service -f
#// Output at the end
echo ""
echo "---------------"
echo "+ Complete +"
echo "---------------"
echo "The next step is to run the '02_install_*' script for either X11 (i3) or Wayland (sway) depending on which you want to use."