-
Notifications
You must be signed in to change notification settings - Fork 0
/
5_dwm.sh
executable file
·376 lines (289 loc) · 10.9 KB
/
5_dwm.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
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
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
#!/bin/sh
# Source Helper
SCRIPT_DIR="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd)"
DETECT_INIT_SCRIPT="$SCRIPT_DIR/detectInit.sh"
source "$SCRIPT_DIR/helper.sh"
# Git clone helper
klone() {
for ((i = 0; i < 10; i++)); do
git clone "$1" && break
done
}
# Get Init Type
initType=$(bash "${DETECT_INIT_SCRIPT}")
## Get username
uname=$(echo "$USER")
# CORE PACKAGES
echo ""
echo "---------------------------------------------------------------------------------"
echo "--------------Installing CORE PACKAGES FOR DWM...--------------------------------"
echo "---------------------------------------------------------------------------------"
echo ""
install "xorg-server xorg-xinit xorg-xrandr xorg-xsetroot xautolock" "pac"
install "xdg-user-dirs xdg-desktop-portal xdg-utils" "pac"
install "wmctrl" "pac"
install "pcmanfm ark zathura zathura-pdf-mupdf dunst clipmenu" "pac";yes|sudo pacman -Rdd dmenu
install "feh" "pac"
install "nsxiv-git" "yay"
install "pulsemixer pamixer" "pac"
install "lxrandr brightnessctl" "pac"
install "redshift" "pac"
install "mtpfs gvfs-mtp" "pac"
install "jmtpfs" "yay"
### MISC
mkdir -p $HOME/.misc
cp -r $HOME/setup/storage/misc/* $HOME/.misc/
# Volnoti
install "dbus-glib" "pac"
klone "https://github.com/hcchu/volnoti"
cd volnoti
cd res
rm display-brightness-symbolic.svg
mv "${SCRIPT_DIR}/storage/display-brightness-symbolic.svg" ./display-brightness-symbolic.svg
cd ..
./prepare.sh
./configure --prefix=/usr
make
sudo make clean install
cd ..
rm -rf volnoti
# Setup nsxiv key-handler
mkdir -p $HOME/.config/nsxiv/exec
cp -r $HOME/setup/configs/nsxiv/key-handler $HOME/.config/nsxiv/exec
# Install picom compositor
install "libev libconfig meson ninja uthash" "pac"
klone "https://github.com/FT-Labs/picom"
cd picom
git submodule update --init --recursive
meson --buildtype=release . build
ninja -C build
sudo ninja -C build install
cd ..
rm -rf picom
cp -r $HOME/setup/configs/picom $HOME/.config/
# Appearance
install "lxappearance-gtk3 qt6ct kvantum" "pac"
install "breeze-icons breeze-gtk breeze ttf-joypixels" "pac"
klone "https://github.com/Fausto-Korpsvart/Gruvbox-GTK-Theme"
cd ./Gruvbox-GTK-Theme/
git checkout 44e81d8226579a24a791f3acf43b97de815bc4b1
cd themes
sudo cp -r ./Gruvbox-Dark-B /usr/share/themes/
cd ../../
rm -rf Gruvbox-GTK-Theme
klone "https://github.com/TheGreatMcPain/gruvbox-material-gtk"
cd gruvbox-material-gtk
sudo cp -r ./icons/Gruvbox-Material-Dark/ /usr/share/icons/
cd ..
rm -rf gruvbox-material-gtk
cd $HOME/Downloads/
mv "${SCRIPT_DIR}/storage/Gruvbox-Dark-Blue.tar.gz" .
tar xzvf Gruvbox-Dark-Blue.tar.gz
rm Gruvbox-Dark-Blue.tar.gz
sudo mv ./Gruvbox-Dark-Blue/ /usr/share/Kvantum/
cd
# Theming
echo ""
echo "------------------------------------------------------------------------------------------"
echo "--------------Theming...------------------------------------------------------------------"
echo "------------------------------------------------------------------------------------------"
echo ""
cp -r $HOME/setup/configs/.Xresources $HOME
cd $HOME/.config;rm -rf qt6ct/ gtk-2.0/ gtk-3.0/ Kvantum/;cd ;rm $HOME/.gtkrc-2.0;rm -rf $HOME/.config/gtk-3.0/bookmarks
cp -r $HOME/setup/configs/DWM/theming/qt6ct/ $HOME/setup/configs/DWM/theming/gtk-2.0 $HOME/setup/configs/DWM/theming/gtk-3.0 $HOME/setup/configs/DWM/theming/Kvantum $HOME/.config
cp -r $HOME/setup/configs/DWM/theming/.gtkrc-2.0 $HOME
echo "file:///home/$USER/Documents Documents" >> $HOME/.config/gtk-3.0/bookmarks
echo "file:///home/$USER/Downloads Downloads" >> $HOME/.config/gtk-3.0/bookmarks
echo "file:///home/$USER/Pictures Pictures" >> $HOME/.config/gtk-3.0/bookmarks
echo "file:///home/$USER/Videos Videos" >> $HOME/.config/gtk-3.0/bookmarks
getReq=$(cat "$HOME/.gtkrc-2.0" | grep -n "replacethis" | head -1 | xargs)
getLineNumber=$(echo "$getReq" | cut -d":" -f1)
rep=$(echo 'include "\/home\/$USER\/.gtkrc-2.0.mine"')
sudo sed -i "${getLineNumber}s/.*/${rep}/" $HOME/.gtkrc-2.0
sed "s/\$USER/$USER/" .gtkrc-2.0
# SETUP dxhd
echo ""
echo "-------------------------------------------------------------------------------"
echo "--------------Installing Hotkey Daemon...--------------------------------------"
echo "-------------------------------------------------------------------------------"
echo ""
klone "https://github.com/dakyskye/dxhd.git"
cd dxhd
fish -c 'sudo make install'
cd ..
rm -rf dxhd
mkdir -p $HOME/.config/dxhd
mv $HOME/setup/configs/dxhd/dxhd_dwm.sh $HOME/.config/dxhd
mv $HOME/.config/dxhd/dxhd_dwm.sh $HOME/.config/dxhd/dxhd.sh
echo ""
echo "----------------------------------------------------------------------------------------"
echo "--------------Creating wallpaper script...----------------------------------------------"
echo "----------------------------------------------------------------------------------------"
echo ""
# WALLPAPER SCRIPT
touch $HOME/.local/bin/wall.sh
echo '#!/bin/sh
while true; do
feh --bg-fill "$(find $HOME/wall -type f | shuf -n 1)"
sleep 900s
done
' >>$HOME/.local/bin/wall.sh
echo ""
echo "------------------------------------------------------------------------------------------"
echo "--------------Creating xinitrc...---------------------------------------------------------"
echo "------------------------------------------------------------------------------------------"
echo ""
# XINITRC SETUP
cp /etc/X11/xinit/xinitrc $HOME/.xinitrc
sed -i '51,55d' $HOME/.xinitrc
if [[ "$initType" != "systemD" ]]; then
pipeStr="artix-pipewire-loader &"
else
pipeStr="systemctl --user start pipewire.service pipewire.socket wireplumber.service pipewire-pulse.service pipewire-pulse.socket pipewire-session-manager.service"
fi
echo "# Resolution
xrandr --output eDP-1 --mode 1920x1080 &
# Picom
picom -b
# Pipewire
${pipeStr}
"'
# Hotkey daemon
dxhd -b &
# Wallpaper
sh $HOME/.local/bin/wall.sh &
# Clipboard
clipmenud &
# Dunst
dunst &
# Volume Notification
volnoti &
# Autolock
xautolock -time 10 -locker $HOME/.local/bin/screenlocker &
# Bluelight Filter
redshift -P -O 4500K &
# dwmblocks
dwmblocks &
# Window switcher
alttab -fg "#d58681" -bg "#4a4a4a" -frame "#eb564d" -t 128x150 -i 127x64 -w 1 &
# Low Battery
find "$HOME/.cache/" -name "lowbat*" -delete
$HOME/.local/bin/lowbat.sh &
# Infinte loop
while true;do
$HOME/.config/DWM/dwm >/dev/null 2>&1
done
# DWM Execute
exec $HOME/.config/DWM/dwm' >>$HOME/.xinitrc
# Window Switcher
install "alttab" "yay"
# Install DWM
echo ""
echo "---------------------------------------------------------------------------------------------------"
echo "--------------Installing DWM ...-------------------------------------------------------------------"
echo "---------------------------------------------------------------------------------------------------"
echo ""
DWM_VER=$(echo "6.5")
cp -r $HOME/setup/configs/DWM/dwm-${DWM_VER}/ $HOME/.config/
mv $HOME/.config/dwm-${DWM_VER}/ $HOME/.config/DWM
cd $HOME/.config/DWM/
make
cd
echo "Done Installing DWM!"
echo ""
# Install Launcher-menu
echo ""
echo "-----------------------------------------------------------------------------------------------------------"
echo "--------------Installing Launcher MENU ...-----------------------------------------------------------------"
echo "-----------------------------------------------------------------------------------------------------------"
echo ""
sudo rm -rf /usr/local/bin/bemenu /usr/local/bin/bemenu-app/ /usr/local/bin/bemenu-run
cd $HOME/setup/configs/bemenu-app/
./help.sh x11
cd ..
sudo mv ./bemenu-app/ /usr/local/bin/
sudo mv /usr/local/bin/bemenu-app/bemenu /usr/local/bin/
sudo mv /usr/local/bin/bemenu-app/bemenu-run /usr/local/bin/
cd
# Install screenlocker
echo ""
echo "---------------------------------------------------------------------------------------------------"
echo "--------------Installing SCREENLOCKER ...----------------------------------------------------------"
echo "---------------------------------------------------------------------------------------------------"
echo ""
pip install opencv-python tk pynput playsound pathlib pyautogui
install "tk" "pac"
klone "https://github.com/glowfi/screenlocker"
cd screenlocker
fish -c "cargo build --release"
mv ./target/release/screenlocker $HOME/.local/bin/screenlocker
cd ..
rm -rf screenlocker
# Copy TOPBAR Settings
echo ""
echo "----------------------------------------------------------------------------------------------------"
echo "--------------Copying TOPBAR settings...------------------------------------------------------------"
echo "----------------------------------------------------------------------------------------------------"
echo ""
cp -r $HOME/setup/configs/DWM/dwmblocks/modules/* $HOME/.local/bin/
cd $HOME/setup/configs/DWM/dwmblocks/
sudo make clean install
cd
echo "Done Copying TOPBAR settings!"
echo ""
# Copy DUNST Settings
echo ""
echo "---------------------------------------------------------------------------------------------------"
echo "--------------Copying DUNST settings...------------------------------------------------------------"
echo "---------------------------------------------------------------------------------------------------"
echo ""
cp -r $HOME/setup/configs/DWM/dunst/ $HOME/.config
cp -r $HOME/setup/scripts/system/audio.sh $HOME/.local/bin/
chmod +x $HOME/.local/bin/audio.sh
cd
echo "Done Copying DUNST settings!"
echo ""
echo ""
echo "------------------------------------------------------------------------------------------"
echo "--------------Setting default application for filetypes...--------------------------------"
echo "------------------------------------------------------------------------------------------"
echo ""
# Update MIMETYPE
touch $HOME/zathura.desktop
sudo touch zathura.desktop
cp -r $HOME/setup/configs/zathura $HOME/.config
sudo echo "[Desktop Entry]
Version=1.0
Type=Application
Name=Zathura
Comment=A minimalistic PDF viewer
Comment[de]=Ein minimalistischer PDF-Betrachter
Exec=zathura %f
Terminal=false
Categories=Office;Viewer;
MimeType=application/pdf;
" >>$HOME/zathura.desktop
sudo mv $HOME/zathura.desktop /usr/share/applications
xdg-mime default zathura.desktop application/pdf
xdg-mime default nsxiv.desktop image/png
xdg-mime default nsxiv.desktop image/jpg
xdg-mime default nsxiv.desktop image/jpeg
wget https://gist.githubusercontent.com/acrisci/b264c4b8e7f93a21c13065d9282dfa4a/raw/8c2b2a57ac74c2fd7c26d02d57203cc746e7d3cd/default-media-player.sh
bash ./default-media-player.sh mpv.desktop
rm -rf default-media-player.sh
xdg-mime default mpv.desktop image/gif
xdg-mime default pcmanfm.desktop inode/directory
xdg-settings set default-web-browser brave-browser.desktop
echo "Done seting default application!"
echo ""
# Add Env
sudo tee -a /etc/environment << EOF
# Clipmenu
CM_LAUNCHER=bemenu
# QT Envirnoment variable
QT_QPA_PLATFORMTHEME=qt6ct
EOF
# Remove kwallet
sudo -u "$USER" kwriteconfig6 --file kwalletrc --group 'Wallet' --key 'Enabled' 'false'
sudo -u "$USER" kwriteconfig6 --file kwalletrc --group 'Wallet' --key 'First Use' 'false'
sudo rm -rf /usr/share/dbus-1/services/org.kde.kwalletd6.service