blob: 21f92bf67dd4a44326987dc0a2c6f9e5b7aa012e (
plain)
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
|
#!/bin/sh
set -e
WORKDIRECTORY=$PWD
PERMUSER=$(logname)
if [ "$(id -u)" -ne 0 ]
then printf "The script has to be run as root.\n"
exit
fi
DEPLIST="`sed -e 's/#.*$//' -e '/^$/d' dependencies.txt | tr '\n' ' '`"
pacman -Sy --noconfirm
pacman -S $DEPLIST --noconfirm
usermod -aG seat,input,audio,video $PERMUSER
doas -u $PERMUSER cp -r "$WORKDIRECTORY"/.config /home/$PERMUSER
doas -u $PERMUSER cp -r "$WORKDIRECTORY"/.local /home/$PERMUSER
doas -u $PERMUSER cp -a "$WORKDIRECTORY"/.zprofile /home/$PERMUSER
doas -u $PERMUSER mkdir -p /home/$PERMUSER/.config/git
doas -u $PERMUSER mkdir -p /home/$PERMUSER/.config/npm
doas -u $PERMUSER touch /home/$PERMUSER/.config/npm/npmrc
doas -u $PERMUSER mkdir -p /home/$PERMUSER/.cache/lf
doas -u $PERMUSER mkdir -p /home/$PERMUSER/.cache/zsh
doas -u $PERMUSER mkdir -p /home/$PERMUSER/.local/share/themes
doas -u $PERMUSER mkdir -p /home/$PERMUSER/.local/share/icons
cd "$WORKDIRECTORY" || exit
doas -u $PERMUSER git clone https://github.com/zdharma-continuum/fast-syntax-highlighting
#doas -u $PERMUSER git clone https://github.com/Aloxaf/fzf-tab
mkdir -p /usr/share/zsh/plugins
cp -rf fast-syntax-highlighting /usr/share/zsh/plugins
#cp -rf fzf-tab /usr/share/zsh/plugins
cd "$WORKDIRECTORY"
doas -u $PERMUSER mkdir -p /home/$PERMUSER/.ssh
doas -u $PERMUSER mkdir -p /home/$PERMUSER/.gnupg
doas -u $PERMUSER touch /home/$PERMUSER/.gnupg/gpg-agent.conf
cat <<EOL >> /home/$PERMUSER/.gnupg/gpg-agent.conf
enable-ssh-support
pinentry-program /usr/bin/pinentry-qt
default-cache-ttl 34560000
max-cache-ttl 34560000
EOL
cat <<EOL >> /home/$PERMUSER/.config/npm/npmrc
prefix=\${XDG_DATA_HOME}/npm
cache=\${XDG_CACHE_HOME}/npm
init-module=\${XDG_CONFIG_HOME}/npm/config/npm-init.js
logs-dir=\${XDG_STATE_HOME}/npm/logs
EOL
doas -u $PERMUSER find /home/$PERMUSER/.gnupg -type f -exec chmod 600 {} \;
doas -u $PERMUSER find /home/$PERMUSER/.gnupg -type d -exec chmod 700 {} \;
doas -u $PERMUSER find /home/$PERMUSER/.ssh -type f -exec chmod 600 {} \;
doas -u $PERMUSER find /home/$PERMUSER/.ssh -type d -exec chmod 700 {} \;
chsh -s /bin/zsh $PERMUSER
mkdir -p /root/.config/nvim
cat <<EOL >> /root/.config/nvim/init.vim
set title
set clipboard+=unnamedplus
set relativenumber
colorscheme vim
EOL
sed -i -e "/^#"Color"/s/^#//" /etc/pacman.conf
sed -i -e '/Color/a\ILoveCandy' /etc/pacman.conf
rm /home/$PERMUSER/.bash*
# makeflags set to number of threads and pacman elevation is doas
sed -i 's/#MAKEFLAGS=.*$/MAKEFLAGS="-j'$(nproc)'"/' /etc/makepkg.conf
sed -i 's/#PACMAN_AUTH=.*$/PACMAN_AUTH=(doas)/' /etc/makepkg.conf
doas -u $PERMUSER git clone https://aur.archlinux.org/yay.git
cd yay
doas -u $PERMUSER makepkg -csi --noconfirm
cd "$WORKDIRECTORY"
DEPLIST="`sed -e 's/#.*$//' -e '/^$/d' aurdeps.txt | tr '\n' ' '`"
doas -u $PERMUSER yay -S $DEPLIST --noconfirm
doas -u $PERMUSER dbus-launch gsettings set org.gnome.desktop.interface gtk-theme "Nordic"
doas -u $PERMUSER dbus-launch gsettings set org.gnome.desktop.wm.preferences theme "Nordic"
doas -u $PERMUSER dbus-launch gsettings set org.gnome.desktop.wm.preferences button-layout 'appmenu'
doas -u $PERMUSER dbus-launch gsettings set org.gnome.desktop.interface font-name "Sans 11"
cd ..
rm -rf swaydots
rm -rf yay
rm -rf go
dinitctl enable cronie
echo "*/10 * * * * /home/$PERMUSER/.local/bin/cron/newsup\n*/30 * * * * /home/$PERMUSER/.local/bin/cron/checkup" | doas -u $PERMUSER crontab -
cat <<EOL >> /usr/share/libalpm/hooks/statusbar.hook
[Trigger]
Operation = Upgrade
Type = Package
Target = *
[Action]
Description = Updating statusbar...
When = PostTransaction
Exec = /usr/bin/pkill -RTMIN+8 i3blocks
EOL
echo "Your linux is riced!"
|