-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathchange
executable file
·282 lines (236 loc) · 6.69 KB
/
change
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
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
#!/bin/sh
#
# boomer to zoomer
#
# a very low iq way to make edits to the LARBS
# files from github.com/lukesmithxyz/voidrice
#
# TODO : remove rsync dep
if ! command -v rsync >/dev/null
then
printf ":: error must have rsync installed"
exit 1
fi
[ -f .env ] && . ./.env
if [ -d voidrice ] ; then
cd voidrice || exit 1
echo ":: Updating voidrice"
git clean -dxfq
git fetch -q --progress
git reset -q --hard origin/master
else
git clone https://github.com/LukeSmithxyz/voidrice.git 1> /dev/null &&
echo ":: Cloned repo"
cd voidrice || exit 1
fi
printf ":: Is this display HiDPi [y/N] "
read -r REPLY
if [ "$REPLY" = "" ] || echo "$REPLY" | grep -qwE "^[Nn]$"; then
hidpi=false
elif echo "$REPLY" | grep -qvwE "^[Yy]$"; then
echo :: Invalid && exit 1;
fi
# copy files in
cp ../bin/* .local/bin/
cp ../Xresources .config
echo ":: Backing up newsboat urls"
cp ~/.config/newsboat/urls.bak ..
if [ -f ../urls ]
then
cp ../urls .config/newsboat/
else
cp ../urls.bak .config/newsboat/
fi
rm .local/share/bg
[ -f ../wall.png ] && cp ../wall.png .local/share/bg
# remove bloat
rm README.md LICENSE FUNDING.yml
SCALE=1
OUT="DP-0 --size 2560x1440 --rate 144 --dpi 196"
COLOR="red"
# perform hidpi changes
if $hidpi ; then
SCALE=2
OUT="eDP-1 --dpi 192"
COLOR="blue"
sed -i 's/350x5-0+24/700-0+48/' .config/dunst/dunstrc
fi
# install composer1
command -v composer1 >/dev/null || \
sudo curl -L "https://getcomposer.org/composer-1.phar" -o "/usr/bin/composer1" && \
sudo chmod +x "/usr/bin/composer1"
# aliases
sed -i "
/cp=/d
/mv=/d
/rm=/d
/xbps/d
" .config/shell/aliasrc
echo "# My aliases
alias \\
wgon=\"sudo wg-quick up wg0 && notify-send Wireguard Activated\" \\
wgoff=\"sudo wg-quick down wg0 && notify-send Wireguard Deactivated\" \\
bat=\"cat /sys/class/power_supply/BAT0/capacity\" \\
SS=\"sudo systemctl\" \\
history=\"history 1\"
# dev
alias \\
dc=\"docker-compose\" \\
dcr=\"docker-compose run --rm\" \\
pa=\"php artisan\" \\
pat=\"php artisan tinker\" \\
patx=\"php -dxdebug.start_with_request=yes artisan tinker\" \\
pax=\"php -dxdebug.start_with_request=yes artisan\" \\
p1a=\"php71 artisan\" \\
p1at=\"php71 artisan tinker\" \\
p2a=\"php72 artisan\" \\
p2at=\"php72 artisan tinker\" \\
p2atx=\"php72 -dxdebug.remote_autostart=1 artisan tinker\" \\
p2c=\"php72 \$(which composer1)\" \\
p3a=\"php73 artisan\" \\
p3at=\"php73 artisan tinker\" \\
p4a=\"php7 artisan\" \\
p4at=\"php7 artisan tinker\" \\
" >> .config/shell/aliasrc
# PERSONAL
# global exports
sed -i "
/MOZ_USE_XINPUT2/a export GDK_SCALE=$SCALE
/ PATH/a export PATH=\"$HOME/.local/node_modules/bin:\$PATH\"
/ANSIBLE/a export npm_config_prefix=\"~/.local/node_modules/\"
s/mpd/pgrep mpd >\/dev\/null || mpd/
/BROWSER/a export READER=\"zathura\"
" .zprofile
# default display settings
sed -i "
s/^#xrdb/xrdb/
s/xcompmgr/picom/
/picom/ s/^/# /
/unclutter/a xrandr --output $OUT &
" .config/x11/xprofile
# fix screenshot location
sed -i "s/pic-/pic\/ss\/pic-/" .local/bin/maimpick
# patches
patch -f -sp0 < ../patches/displayselect.patch
# ncmpcpp
sed -i '/^#user_/ {s/^.//;s/classic/alternative/}' .config/ncmpcpp/config
sed -i '{
s/caps:super/caps:escape_shifted_capslock/
s/setxkbmap/setxkbmap -layout gb/
}' .local/bin/remaps
# mpv
echo 'a/D run movetobin "${filename}"' >> .config/mpv/input.conf
# vimrc
cp ../config/vimrc .vimrc # backup vimrc incase no neovim
cp ../config/nvim/init.vim .config/nvim
mkdir -p .config/git
cp ../config/git/config .config/git/config
# include fzf and change ps1
sed -i "
/be last/i source ~\/.local\/src\/fzf.git\/.fzf.zsh\n
s/PS1=.*/PS1=\"%B%{\$fg[$COLOR]%}%c %{\$reset_color%}>%b \"/
s/HISTFILE=~/.cache/zsh/history/+HISTFILE=~/.local/share/zsh/history/
" .config/zsh/.zshrc
# change tab length in less (for git diff)
echo 'export LESS=Rx4' >> .config/zsh/.zshrc
sed -i "
s/Joy Pixels/Font Awesome/g
" .config/fontconfig/fonts.conf
sed -i "
s/-then-hibernate//
s/hibernate/suspend/
" .local/bin/sysact
# Mime configs
echo "
x-scheme-handler/msteams=teams.desktop
" >> .config/mimeapps.list
# END OF CONFIG
git add .
git add .vimrc
git commit -qam "!! Install point !!"
# print out unstaged changes
gh="git --work-tree=$HOME --git-dir=.git"
ch=$($gh status -s --untracked-files=no)
if [ "$ch" != "" ]; then
# prompt to show
$gh status -s --untracked-files=no
printf ":: NOTE: + represents YOUR changes which will be overwritten\n"
printf ":: Do you want view local changes? [y/N] "
read -r REPLY
if echo "$REPLY" | grep -qwE "^[Yy]$"; then
$gh diff
fi
fi
# prompt to install
printf ":: Do you want to deploy these changes to the home folder? [y/N] "
read -r REPLY
if echo "$REPLY" | grep -qwE "^[Yy]$"; then
rsync -a --exclude '.git' . ~
fi
# prompt for changes to system
printf ":: Do you want to edit the current system? [y/N] "
read -r REPLY
if [ "$REPLY" = "" ] || echo "$REPLY" | grep -qwE "^[Nn]$"; then
exit 0;
fi
# copy mouse and touchpad settings
sudo cp -n ../xorg.conf.d/* /etc/X11/xorg.conf.d/
# vconsole changes
[ -f /etc/vconsole.conf ] || sudo touch /etc/vconsole.conf
# add personal keymaps to uk template
# this map may be gzipped which is accounted for
if [ -f /usr/local/share/kbd/keymaps/personal.map ]
then
uk="$( cat /usr/share/kbd/keymaps/i386/qwerty/uk.map )"
[ -f /usr/share/kbd/keymaps/i386/qwerty/uk.map ] && \
uk="$( gunzip -c /usr/share/kbd/keymaps/i386/qwerty/uk.map.gz )"
sudo mkdir -p /usr/local/share/kbd/keymaps
printf "%s\nkeycode 1 = Caps_Lock\nkeycode 58 = Escape\n" "$uk" | \
sudo tee /usr/local/share/kbd/keymaps/personal.map > /dev/null
fi
( grep -q "KEYMAP" /etc/vconsole.conf ) ||
sudo sh -c 'echo "KEYMAP=/usr/local/share/kbd/keymaps/personal.map" >> /etc/vconsole.conf'
( grep -q "FONT" /etc/vconsole.conf ) ||
sudo sh -c 'echo "FONT=ter-116n" >> /etc/vconsole.conf'
$hidpi && sudo sed -i 's/ter-116n/ter-132n/' /etc/vconsole.conf
# Update dependencies
if ! [ -d "../src" ]
then
mkdir ../src
fi
# shellcheck disable=SC2164 # created above
cd ../src
# dwm
if [ -d dwm ] ; then
cd dwm || exit 1
echo ":: Updating dwm"
git clean -dxfq
git fetch -q --progress
git reset -q --hard origin/master
else
git clone https://github.com/LukeSmithxyz/dwm.git 1> /dev/null &&
echo ":: Cloned repo"
cd dwm || exit 1
fi
patch -f -sp0 < ../../patches/dwm-configh.patch
sed -i "s/lmc /mpc /g" config.h
$hidpi && sed -i "/font-awesome/s/15/18/g" config.h
make
sudo make install
cd ..
# dmenu
if [ -d dmenu ] ; then
cd dmenu || exit 1
echo ":: Updating dmenu"
git clean -dxfq
git fetch -q --progress
git reset -q --hard origin/master
else
git clone https://github.com/LukeSmithxyz/dmenu.git 1> /dev/null &&
echo ":: Cloned repo"
cd dmenu || exit 1
fi
patch -f -sp0 < ../../patches/dmenu-configh.patch
$hidpi && sed -i "/font-awesome/s/15/18/g" config.h
make
sudo make install