-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy patharch
135 lines (97 loc) · 5.09 KB
/
arch
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
#!/bin/bash
pacman -S xdg-desktop-portal-wlr xorg-xwayland networkmanager ntfs-3g gvfs gvfs-smb jq pkgfile go wget noto-fonts noto-fonts-emoji ttf-font-awesome polkit-gnome playerctl thunar thunar-archive-plugin file-roller zsh python-pip pavucontrol ttf-font-awesome base-devel sway vim neovim waybar kitty mako wl-clipboard swayidle slurp grim pamixer noto-fonts-emoji noto-fonts-cjk foot pipewire pipewire-pulse wireplumber pipewire-jack pipewire-alsa
ln -sf /usr/share/zoneinfo/Europe/London /etc/localtime
hwclock --systohc
echo Configuring Locales
echo -e "en_GB.UTF-8 UTF-8\nen_US.UTF-8 UTF-8" >> /etc/locale.gen
locale-gen
echo LANG=en_GB.UTF-8 >> /etc/locale.conf
echo KEYMAP=uk >> /etc/vconsole.conf
echo Enter a computer hostname to use
read hostname
echo $hostname >> /etc/hostname
echo -e "127.0.0.1 localhost\n::1 localhost\n127.0.0.1 $hostname.localdomain $hostname" >> /etc/hosts
echo "Do you have a bluetooth adapter?"
read BluetoothConfirmation
if [ "$BluetoothConfirmation" == "Y" ]; then
pacman -S bluez bluez-utils blueman
systemctl enable bluetooth
fi
echo "Do you want to use Systemd-boot or grub? (grub is better for dual boot configuration) (G/S)"
read BootloaderChoice
echo "Where did you mount your EFI partition? (Default will be assumed at /boot)"
read EFILocation
[ -d "$EFILocation" ] || EFILocation=/boot
echo "Please enter CPU Type (for ucode installation) (AMD OR INTEL)"
read cputype
if [ "$cputype" == "AMD" ]; then
pacman -S amd-ucode
ucode=amd-ucode.img
else
pacman -S intel-ucode
ucode=intel-ucode.img
fi
if [ "$BootloaderChoice" == "G" ]; then
pacman -S efibootmgr grub
grub-install --target=x86_64-efi --efi-directory=$EFILocation --bootloader-id=GRUB
grub-mkconfig -o /boot/grub/grub.cfg
else
RootUUID=$(lsblk -nr -o UUID,MOUNTPOINT | grep -Po '.*(?= /$)')
bootctl --esp-path=$EFILocation install
echo -e "default arch.conf\ntimeout 0\nconsole-mode max\neditor no" >> $EFILocation/loader/loader.conf
echo -e "title Arch Linux\nlinux /vmlinuz-linux\ninitrd /$ucode\ninitrd /initramfs-linux.img\noptions root="UUID=$RootUUID" rw quiet" >> $EFILocation/loader/entries/arch.conf
fi
echo Set root password:
passwd
echo Enter username for main account
read username
useradd -m $username
echo Set password for main account
passwd $username
gpasswd -a $username wheel
echo '%wheel ALL=(ALL) ALL' | EDITOR='tee -a' visudo
chsh -s /bin/zsh $username
echo Downloading and copying dotfiles
cd /home/$username
git clone https://github.com/techtino/dotfiles
cd dotfiles
git submodule init
git submodule update
cd ..
cp -r dotfiles/. .
git clone https://aur.archlinux.org/paru.git
chown -R $username:$username .
cd paru
su $username -c 'makepkg -si'
cd /home/$username
su $username -c 'paru -S networkmanager-dmenu-git swappy autotiling wob-git rofi-lbonn-wayland-git greetd greetd-gtkgreet wlogout swaylock-effects-git'
systemctl enable NetworkManager
gpasswd -a $username input
gpasswd -a $username video
echo Do you wish to install i3?
read i3Confirmation
if [ "$i3Confirmation" == "Y" ]; then
pacman -S xorg-server xorg-server-common xorg-xinit picom i3-gaps rofi dunst feh
su $username -c 'yay -S polybar'
fi
echo "Are you using a laptop or a desktop? (L/D) (Assumes Desktop)"
read DeviceType
if [ "$DeviceType" == "L" ]; then
pacman -S tlp light
systemctl enable tlp
su $username -c 'paru -S libinput-gestures'
echo Setting up touchpad gestures
echo -e '#!/bin/sh\ncase "$@" in\nforward )\nif [ -n "$WAYLAND_DISPLAY" ]; then\nswaymsg seat seat0 cursor press BTN_EXTRA\nswaymsg seat seat0 cursor release BTN_EXTRA\nelse\nxdotool alt+Right\nfi\n;;\nbackward )\nif [ -n "$WAYLAND_DISPLAY" ]; then\nswaymsg seat seat0 cursor press BTN_SIDE\nswaymsg seat seat0 cursor release BTN_SIDE\nelse\nxdotool key alt+Left\nfi\n;;\nesac' >> /usr/local/bin/button
chmod +x /usr/local/bin/button
echo -e "gesture swipe up swaymsg -t command workspace next_on_output\ngesture swipe down swaymsg -t command workspace prev_on_output\ngesture swipe right /usr/local/bin/button backward\ngesture swipe left /usr/local/bin/button forward" > /etc/libinput-gestures.conf
fi
echo Setting logind ignore power key
echo -e "export _JAVA_AWT_WM_NONREPARENTING=1\nexport QT_QPA_PLATFORM=wayland-egl\nexport XDG_SESSION_TYPE=wayland\nexport XDG_SESSION_DESKTOP=sway\nexport XDG_CURRENT_DESKTOP=sway\nexport GBM_BACKEND=nvidia-drm\nexport __GLX_VENDOR_LIBRARY_NAME=nvidia\nexport WLR_NO_HARDWARE_CURSORS=1\nexport MOZ_ENABLE_WAYLAND=1\nexport LIBVA_DRIVER_NAME=nvidia\nexport MOZ_DISABLE_RDD_SANDBOX=1\nexport EGL_PLATFORM=wayland\nsway --unsupported-gpu" >> /usr/bin/sway-launch
chmod +x /usr/bin/sway-launch
echo -e "sway-launch\nstartx" >> /etc/greetd/environments
echo -e 'exec "gtkgreet -l; swaymsg exit"\ninclude /etc/sway/config.d/*' >> /etc/greetd/sway-config
echo -e '[terminal]\nvt=1\n[default_session]\ncommand = "sway --unsupported-gpu --config /etc/greetd/sway-config"\nuser = "greeter"' > /etc/greetd/config.toml
echo "HandlePowerKey=ignore" >> /etc/systemd/logind.conf
systemctl enable greetd
echo Its time to reboot, done here.
read