-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path5_kde.sh
executable file
·421 lines (306 loc) · 16.6 KB
/
5_kde.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
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
#!/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}")
# Plasma core PACKAGES
echo ""
echo "---------------------------------------------------------------------------------"
echo "--------------Installing CORE PACKAGES FOR KDE...--------------------------------"
echo "---------------------------------------------------------------------------------"
echo ""
install "plasma-desktop plasma-workspace plasma-nm plasma-pa qt6-tools" "pac"
install "breeze breeze-gtk kde-gtk-config kdecoration" "pac"
install "powerdevil xdg-desktop-portal-kde" "pac"
install "kwrited kwin kgamma kinfocenter kscreen systemsettings sddm sddm-kcm libnotify konqueror" "pac"
install "redshift" "pac"
# CORE PACKAGES
# ===================== XORG Dependent ===================================
install "xorg-server" "pac"
install "xorg-xrandr" "pac"
install "xautolock" "pac"
# ===================== END Dependent ====================================
### Other Core
install "wmctrl" "pac"
install "dolphin ark zathura zathura-pdf-mupdf" "pac"
install "pulsemixer pamixer" "pac"
install "brightnessctl" "pac"
# ===================== XORG Dependent ===================================
# Install nsxiv and setup nsxiv key-handler
install "nsxiv-git" "yay"
mkdir -p $HOME/.config/nsxiv/exec
cp -r $HOME/setup/configs/nsxiv/key-handler $HOME/.config/nsxiv/exec
# Install Launcher-menu
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 clipmenu
install "clipmenu" "pac";sudo pacman -Rdd dmenu
# ===================== END Dependent ====================================
echo ""
echo "----------------------------------------------------------------------------------------"
echo "--------------Creating wallpaper script...----------------------------------------------"
echo "----------------------------------------------------------------------------------------"
echo ""
# WALLPAPER SCRIPT
touch $HOME/.local/bin/wall.sh
cat <<EOF >> $HOME/.local/bin/wall.sh
#!/bin/sh
while true; do
randImage=\$(find ~/wall -type f | shuf -n 1)
dbus-send --session --dest=org.kde.plasmashell --type=method_call /PlasmaShell org.kde.PlasmaShell.evaluateScript "string:
var Desktops = desktops();
for (i=0;i<Desktops.length;i++) {
d = Desktops[i];
d.wallpaperPlugin = 'org.kde.image';
d.currentConfigGroup = Array('Wallpaper',
'org.kde.image',
'General');
d.writeConfig('Image', '\$randImage');
}"
sleep 900s
done
EOF
chmod +x $HOME/.local/bin/wall.sh
### MISC
mkdir -p $HOME/.misc
cp -r $HOME/setup/storage/misc/* $HOME/.misc/
# ===================== XORG Dependent ===================================
echo ""
echo "------------------------------------------------------------------------------------------"
echo "--------------Creating xprofile...--------------------------------------------------------"
echo "------------------------------------------------------------------------------------------"
echo ""
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
# XPROFILE SETUP
touch $HOME/.xprofile
echo "# Hotkey daemon
dxhd -b &
# Pipewire
${pipeStr}
"'
# Wallpaper
sh $HOME/.local/bin/wall.sh &
# Bluelight Filter
redshift -P -O 4500K &
# Clipboard
clipmenud &
# Autolock
xautolock -time 10 -locker $HOME/.local/bin/screenlocker &
# Kill Useless Process at startup
~/.local/bin/uselesskill.sh &' >>$HOME/.xprofile
### System related scripts
cp -r ~/setup/scripts/system/uselesskill.sh ~/.local/bin/
chmod +x ~/.local/bin/uselesskill.sh
# ===================== END Dependent ====================================
# ENABLE SDDM
echo ""
echo "---------------------------------------------------------------------------------"
echo "--------------ENABLE LOGIN MANAGER SDDM...---------------------------------------"
echo "---------------------------------------------------------------------------------"
echo ""
# Enable
if [[ "$initType" != "systemD" ]]; then
sudo rc-update add sddm
else
sudo systemctl enable sddm
fi
# Set SDDM theme
getReq=$(cat /usr/lib/sddm/sddm.conf.d/default.conf | grep -n "Current=" | head -1 | xargs)
getLineNumber=$(echo "$getReq" | cut -d":" -f1)
rep="Current=breeze"
sudo sed -i "${getLineNumber}s/.*/${rep}/" /usr/lib/sddm/sddm.conf.d/default.conf
# ======================================================= Can Be Deleted for minimal install =======================================================
# 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
# ======================================================= END ======================================================================================
# ===================== XORG Dependent ===================================
# Copy Xresources
cp -r $HOME/setup/configs/.Xresources $HOME
# ===================== END Dependent ====================================
# REGISTER KITTY IN DOLPHIN
echo ""
echo "--------------------------------------------------------------------------------"
echo "--------------Register Kitty in Dolphin...--------------------------------------"
echo "--------------------------------------------------------------------------------"
echo ""
mkdir -p $HOME/.local/share/kservices6
cp -r $HOME/setup/configs/plasma/kittyhere.desktop $HOME/.local/share/kservices6
# ===================== XORG Dependent ===================================
# 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_kde.sh $HOME/.config/dxhd
mv $HOME/.config/dxhd/dxhd_kde.sh $HOME/.config/dxhd/dxhd.sh
# ===================== END Dependent ====================================
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
# ===================== XORG Dependent ===================================
xdg-mime default nsxiv.desktop image/png
xdg-mime default nsxiv.desktop image/jpg
xdg-mime default nsxiv.desktop image/jpeg
# ===================== END Dependent ====================================
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 dolphin.desktop inode/directory
xdg-settings set default-web-browser brave-browser.desktop
echo "Done seting default application!"
echo ""
echo ""
echo "-----------------------------------------------------------------"
echo "--------------Configuring KDE Plasma...--------------------------"
echo "-----------------------------------------------------------------"
echo ""
### Plasma UI Settings
# Set Plasma theme
sudo -u "$USER" kwriteconfig6 --file kdeglobals --group KDE --key LookAndFeelPackage "org.kde.breezedark.desktop"
# Disable splash screen
sudo -u "$USER" kwriteconfig6 --file ksplashrc --group KSplash --key Engine "none"
sudo -u "$USER" kwriteconfig6 --file ksplashrc --group KSplash --key Theme "none"
# Enable 9 desktops
for i in {1..9}
do
sudo -u "$USER" kwriteconfig6 --file kwinrc --group Desktops --key "Name_${i}" "Desktop ${i}"
sudo -u "$USER" kwriteconfig6 --file kwinrc --group Desktops --key Number "${i}"
sudo -u "$USER" kwriteconfig6 --file kwinrc --group Desktops --key Rows "1"
done
# Add command output widget
klone "https://github.com/aricaldeira/plasma-applet-commandoutput"
cd plasma-applet-commandoutput
install "kpackage" "pac"
./build6
./install6
cd ..
rm -rf plasma-applet-commandoutput
# Use KDE file picker in GTK applications
sudo tee -a /etc/environment << EOF
# KDE file picker
GTK_USE_PORTAL=1
# ===================== XORG Dependent ===================================
# Clipmenu
CM_LAUNCHER=bemenu
# ===================== END Dependent ====================================
EOF
# Restore Settings
cp -r $HOME/setup/configs/plasma/plasmashellrc ~/.config/
cp -r $HOME/setup/configs/plasma/plasma-org.kde.plasma.desktop-appletsrc ~/.config/
### Shortcuts
sudo -u "$USER" kwriteconfig6 --file kglobalshortcutsrc --group plasmashell --key "Switch Power Profile" "none,none,Switch Power Profile"
sudo -u "$USER" kwriteconfig6 --file kglobalshortcutsrc --group plasmashell --key "Dolphin" "none,none,Dolphin"
sudo -u "$USER" kwriteconfig6 --file kglobalshortcutsrc --group plasmashell --key "Make Window Fullscreen" "none,none,Make Window Fullscreen"
sudo -u "$USER" kwriteconfig6 --file kglobalshortcutsrc --group plasmashell --key "activate task manager entry 1" "none,none,Activate Task Manager Entry 1"
sudo -u "$USER" kwriteconfig6 --file kglobalshortcutsrc --group plasmashell --key "activate task manager entry 2" "none,none,Activate Task Manager Entry 2"
sudo -u "$USER" kwriteconfig6 --file kglobalshortcutsrc --group plasmashell --key "activate task manager entry 3" "none,none,Activate Task Manager Entry 3"
sudo -u "$USER" kwriteconfig6 --file kglobalshortcutsrc --group plasmashell --key "activate task manager entry 4" "none,none,Activate Task Manager Entry 4"
sudo -u "$USER" kwriteconfig6 --file kglobalshortcutsrc --group plasmashell --key "activate task manager entry 5" "none,none,Activate Task Manager Entry 5"
sudo -u "$USER" kwriteconfig6 --file kglobalshortcutsrc --group plasmashell --key "activate task manager entry 6" "none,none,Activate Task Manager Entry 6"
sudo -u "$USER" kwriteconfig6 --file kglobalshortcutsrc --group plasmashell --key "activate task manager entry 7" "none,none,Activate Task Manager Entry 7"
sudo -u "$USER" kwriteconfig6 --file kglobalshortcutsrc --group plasmashell --key "activate task manager entry 8" "none,none,Activate Task Manager Entry 8"
sudo -u "$USER" kwriteconfig6 --file kglobalshortcutsrc --group plasmashell --key "activate task manager entry 9" "none,none,Activate Task Manager Entry 9"
sudo -u "$USER" kwriteconfig6 --file kglobalshortcutsrc --group plasmashell --key "activate task manager entry 10" "none,none,Activate Task Manager Entry 10"
sudo -u "$USER" kwriteconfig6 --file kglobalshortcutsrc --group kwin --key "Switch to Desktop 1" "Meta+1,none,Switch to Desktop 1"
sudo -u "$USER" kwriteconfig6 --file kglobalshortcutsrc --group kwin --key "Switch to Desktop 2" "Meta+2,none,Switch to Desktop 2"
sudo -u "$USER" kwriteconfig6 --file kglobalshortcutsrc --group kwin --key "Switch to Desktop 3" "Meta+3,none,Switch to Desktop 3"
sudo -u "$USER" kwriteconfig6 --file kglobalshortcutsrc --group kwin --key "Switch to Desktop 4" "Meta+4,none,Switch to Desktop 4"
sudo -u "$USER" kwriteconfig6 --file kglobalshortcutsrc --group kwin --key "Switch to Desktop 5" "Meta+5,none,Switch to Desktop 5"
sudo -u "$USER" kwriteconfig6 --file kglobalshortcutsrc --group kwin --key "Switch to Desktop 6" "Meta+6,none,Switch to Desktop 6"
sudo -u "$USER" kwriteconfig6 --file kglobalshortcutsrc --group kwin --key "Switch to Desktop 7" "Meta+7,none,Switch to Desktop 7"
sudo -u "$USER" kwriteconfig6 --file kglobalshortcutsrc --group kwin --key "Switch to Desktop 8" "Meta+8,none,Switch to Desktop 8"
sudo -u "$USER" kwriteconfig6 --file kglobalshortcutsrc --group kwin --key "Switch to Desktop 9" "Meta+9,none,Switch to Desktop 9"
sudo -u "$USER" kwriteconfig6 --file kglobalshortcutsrc --group kwin --key "Switch to Desktop 10" "Meta+0,none,Switch to Desktop 10"
sudo -u "$USER" kwriteconfig6 --file kglobalshortcutsrc --group kwin --key "Window to Desktop 1" "Meta+\!,none,Window to Desktop 1"
sudo -u "$USER" kwriteconfig6 --file kglobalshortcutsrc --group kwin --key "Window to Desktop 2" "Meta+@,none,Window to Desktop 2"
sudo -u "$USER" kwriteconfig6 --file kglobalshortcutsrc --group kwin --key "Window to Desktop 3" "Meta+#,none,Window to Desktop 3"
sudo -u "$USER" kwriteconfig6 --file kglobalshortcutsrc --group kwin --key "Window to Desktop 4" "Meta+$,none,Window to Desktop 4"
sudo -u "$USER" kwriteconfig6 --file kglobalshortcutsrc --group kwin --key "Window to Desktop 5" "Meta+%,none,Window to Desktop 5"
sudo -u "$USER" kwriteconfig6 --file kglobalshortcutsrc --group kwin --key "Window to Desktop 6" "Meta+^,none,Window to Desktop 6"
sudo -u "$USER" kwriteconfig6 --file kglobalshortcutsrc --group kwin --key "Window to Desktop 7" "Meta+&,none,Window to Desktop 7"
sudo -u "$USER" kwriteconfig6 --file kglobalshortcutsrc --group kwin --key "Window to Desktop 8" "Meta+*,none,Window to Desktop 8"
sudo -u "$USER" kwriteconfig6 --file kglobalshortcutsrc --group kwin --key "Window to Desktop 9" "Meta+(,none,Window to Desktop 9"
sudo -u "$USER" kwriteconfig6 --file kglobalshortcutsrc --group kwin --key "Window to Desktop 10" "Meta+),none,Window to Desktop 10"
sudo -u "$USER" kwriteconfig6 --file kglobalshortcutsrc --group kwin --key "Window Close" "Ctrl+Shift+Q,none,Close Window"
sudo -u "$USER" kwriteconfig6 --file kglobalshortcutsrc --group kwin --key "Toggle Tiles Editor" "none,none,Toggle Tiles Editor"
sudo -u "$USER" kwriteconfig6 --file kglobalshortcutsrc --group org.kde.dolphin.desktop --key "_launch" "none,none,Dolphin"
# Disable app launch feedback
sudo -u "$USER" kwriteconfig6 --file klaunchrc --group BusyCursorSettings --key "Bouncing" --type bool false
sudo -u "$USER" kwriteconfig6 --file klaunchrc --group FeedbackStyle --key "BusyCursor" --type bool false
# Disable baloo file indexer
sudo -u "$USER" balooctl6 suspend
sudo -u "$USER" balooctl6 disable
sudo -u "$USER" balooctl6 purge
# Add Tiling support
# ===================== XORG Dependent ===================================
cp -r $HOME/setup/configs/plasma/cortile $HOME/.config/
cd $HOME/.config/cortile/
set cortile_ver (curl "https://github.com/leukipp/cortile/releases" | grep -o '<a .*href=.*>' | sed -e 's/<a /\n<a /g' | sed -e 's/<a .*href=['"'"'"]//' -e 's/["'"'"'].*$//' -e '/^$/ d' | grep -i "releases/tag" | head -1|cut -d"/" -f6|tr -d "v"|xargs)
set var1 (echo "https://github.com/leukipp/cortile/releases/download/v$cortile_ver/cortile_$cortile_ver")
set var2 (echo "_linux_amd64.tar.gz")
set link (string join "" "$var1" "$var2")
wget "$link" -O "cortile.tar.gz"
tar -xzvf ./cortile.tar.gz;rm cortile.tar.gz;rm README.md;rm LICENSE
cd
# ===================== END Dependent ====================================
# 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