-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.sh
executable file
·94 lines (75 loc) · 2.38 KB
/
install.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
#!/bin/bash
set -o nounset
set -o errexit
set -o pipefail
# NOTE: RUN AS USER!
function mkdir_ifnot_exist() {
if [[ $# != 1 ]]; then
echo "mkdir_ifnot_exist(): don't have enough arguments!"
exit 1
fi
local dir=$1
if [ ! -d $dir ]; then
mkdir -p $dir
echo "mkdir -p $dir"
fi
}
if [[ $# == 1 ]]; then
if [[ $1 == 'system' ]]; then
if [ `id -u` -ne 0 ];then
echo "THIS COMMANDC NEED RUN AS ROOT!"
exit 1
fi
mkdir -p /etc/portage/postsync.d
cp /usr/bin/eix-update /etc/portage/postsync.d
# Enable systemd services
systemctl enable bluetooth
systemctl enable NetworkManager
systemctl enable syslog-ng@default
systemctl enable cronie
systemctl enable lightdm
systemctl enable sshd
systemctl enable docker
systemctl enable privoxy
systemctl enable betterlockscreen@$USER
systemctl enable xow.service
systemctl enable ratbagd.service
systemctl enable libvirtd.service
systemctl enable optimus-manager.service
systemctl enable tlp.service
systemctl mask systemd-rfkill.socket systemd-rfkill.service
systemd-hwdb update
ln -s /home/petrus/.zshrc /root/.zshrc
eselect pinentry set pinentry-gtk-2
fi
if [[ $1 == 'user' ]]; then
if [ `id -u` -eq 0 ];then
echo "THIS COMMAND NEED RUN AS USER!"
exit 1
fi
# aria2
touch ~/.aria2/aria2.session
# pip
mkdir -p ~/.local/bin
ln -s ~/Scripts/pip-user.sh ~/.local/bin/pip-user
ln -s ~/Scripts/pip-upgrade.sh ~/.local/bin/pip-upgrade
pip install --user -r ~/.local/local-python-world
# yarn
bash ~/Scripts/yarn-local-install.sh
# install vim plugin
mkdir_ifnot_exist ~/.vim/.backup
mkdir_ifnot_exist ~/.vim/.swp
mkdir_ifnot_exist ~/.vim/.undo
mkdir_ifnot_exist ~/.vim/.info
# Open vim and type `:PlugInstall`
# Open tmux and press prefix + I (capital i, as in Install) to fetch the plugin.
# # Enable systemd user services
# systemctl enable --user mpd
# systemctl enable --user aria2
betterlockscreen -u ~/Pictures/gentoo/lock.jpg
fi
else
echo "Usage:"
echo " $0 system"
echo " $0 user"
fi