-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathinstall
executable file
·156 lines (128 loc) · 4.16 KB
/
install
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
#!/usr/bin/env bash
set -e
COLOR='\033[0;32m'
NC='\033[0m' # No Color
command_exists () {
type "$1" &> /dev/null ;
}
infoprint () {
echo -e "${COLOR}${1}${NC}"
}
aur_dl () {
\curl -L -O "https://aur.archlinux.org/cgit/aur.git/snapshot/$1.tar.gz"
}
install_sublime_repo () {
infoprint "Installing sublime text GPG key and repository"
\curl -O https://download.sublimetext.com/sublimehq-pub.gpg && sudo pacman-key --add sublimehq-pub.gpg && sudo pacman-key --lsign-key 8A8F901A && rm sublimehq-pub.gpg
echo -e "\n[sublime-text]\nServer = https://download.sublimetext.com/arch/stable/aarch64" | sudo tee -a /etc/pacman.conf
}
# If we can't find sublime-text, add the repository
pacman -Ss sublime-text &> /dev/null || install_sublime_repo
# Select the right install command and update system
INSTALL="sudo pacman -Syu --needed --noconfirm --noprogressbar"
# Install zsh and set it as default shell
if command_exists zsh; then
infoprint "zsh already installed"
else
$INSTALL zsh
chsh -s /bin/zsh
fi
# zsh stuff
git clone --depth=1 [email protected]:romkatv/powerlevel10k.git ~/.powerlevel10k
\curl -L -o dots/zsh-history-substring-search.zsh https://raw.githubusercontent.com/zsh-users/zsh-history-substring-search/master/zsh-history-substring-search.zsh
infoprint "Installing programs from source/apps"
xargs -a <(cat sources/apps | \grep -v '^#') $INSTALL
# Firewall
systemctl enable --now ufw
sudo ufw default deny
# Jellyfin
sudo ufw allow from 192.168.1.0/24 to any port 8096
# Disable ping
sudo sed -i 's/-A ufw-before-input -p icmp --icmp-type echo-request -j ACCEPT/-A ufw-before-input -p icmp --icmp-type echo-request -j DROP/' /etc/ufw/before.rules
sudo ufw enable
sudo ufw logging off
# RUBY
if command_exists rvm; then
infoprint "rvm already installed"
infoprint "updating rvm..."
rvm get stable 1> /dev/null
infoprint "updating rubygems..."
gem update --system -q
infoprint "updating installed gems..."
gem update -q
else
infoprint "Installing rvm"
\curl -sSL https://get.rvm.io | bash -s stable
source ~/.rvm/scripts/rvm
rvm install ruby-head
rvm use --default ruby-head
infoprint "Installing gems"
xargs -a <(cat sources/gems) gem install
fi
# PYTHON
if command_exists pip; then
infoprint "Installing pip packages"
xargs -a <(cat sources/pip) pip install --user -qq
fi
# ELIXIR - hex
if command_exists mix; then
infoprint "Installing/upgrading hex"
mix local.hex
# ELIXIR - phoenix
# mix archive.install https://github.com/phoenixframework/archives/raw/master/phoenix_new.ez
fi
# Rust
rustup update
# Fonts
cp -r fonts/* ~/.local/share/fonts
fc-cache
# nvim
mkdir -p ~/.config/nvim/colors
# MPD and NCMPCPP
mkdir -p ~/.mpd/lyrics
mkdir -p ~/.mpd/playlists
mkdir -p ~/.ncmpcpp
touch ~/.mpd/mpd.log
touch ~/.mpd/tag_cache
touch ~/.mpd/mpdstate
touch ~/.mpd/mpd.pid
touch ~/.mpd/sticker.sql
# mpv
mkdir ~/.config/mpv
# polybar
mkdir ~/.config/polybar
# Install aurman
if command_exists aurman; then
infoprint "aurman already installed"
else
mkdir temp
cd temp
aur_dl aurman
tar -xvf aurman*
cd aurman
makepkg -si --skippgpcheck
cd ../..
rm -rf temp
fi
# Install AUR packages
xargs -a <(cat sources/aur | \grep -v '^#') aurman -S --needed --noconfirm
infoprint "Setting spanish keyboard"
localectl set-x11-keymap es
# (for redshift, this isn't ideal if you move around a lot but Geoclue was giving me issues)
infoprint "Setting \$COORDINATES..."
\curl -s "https://location.services.mozilla.com/v1/geolocate?key=geoclue" | awk 'OFS=":" {print $3,$5}' | tr -d ',}' | xargs -I % sed 's/COORDINATES=.*/COORDINATES=%/' dots/zprofile_base > dots/zprofile
infoprint "Creating symbolic links..."
source links
# Create to-do list
infoprint "Creating a to-do file with more possible configurations..."
echo "* lxappearance: Arc-Darker + Papirus" >> todo
echo "* Install package control for Sublime" >> todo
echo " * Install Agila" >> todo
echo " * Install AllAutoComplete" >> todo
echo " * Install Babel" >> todo
echo " * Install BracketHighlighter" >> todo
echo " * Install Elixir" >> todo
echo " * Install Kotlin" >> todo
echo " * Install MoveTab" >> todo
echo " * Install Rust Enhanced" >> todo
echo " * Install SublimeLinter, -annotations, -contrib-elixirc, -ruby" >> todo