-
-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathinstall
More file actions
executable file
·702 lines (627 loc) · 34 KB
/
install
File metadata and controls
executable file
·702 lines (627 loc) · 34 KB
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
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
#!/usr/bin/env bash
# Do not use this script unless you know what you are doing! Even then this
# script isn't that much above `curl | bash`ing
set -x
# Of course LaTeX templates exist
mkdir -vp ~/texmf/tex/latex/local
# If my allowed_signers are present, use them, if not, clone them, and try
# again. The gitconfig expects them here.
if [ -d $HOME/src/codeberg.org/Aminda/ssh-allowed_signers ]; then
echo "git config --global gpg.ssh.allowedSignersFile $HOME/src/codeberg.org/Aminda/ssh-allowed_signers/allowed_signers"
git verify-commit HEAD || exit 1
sleep 3
else
echo "Keys not found, cloning..."
# -vp - verbose, parent. This comment won't be repeated.
mkdir -vp $HOME/src/codeberg.org/Aminda/
git clone https://codeberg.org/Aminda/ssh-allowed_signers.git $HOME/src/codeberg.org/Aminda/ssh-allowed_signers
echo "git config --global gpg.ssh.allowedSignersFile $HOME/src/codeberg.org/Aminda/ssh-allowed_signers/allowed_signers"
git verify-commit HEAD || exit 1
sleep 3
fi
# marker that I have ran the other script that runs things like installing
# my public keys as authorized. See bottom of this script.
export MIKAELA_GREP=$HOME/.MIKAELA_GREP
# Copying files in places
cp -v rc/bashrc $HOME/.bashrc
cp -v conf/tmux.conf $HOME/.tmux.conf
cp -v rc/zshrc $HOME/.zshrc
cp -v rc/profile $HOME/.profile
# Create configuration directories missed later
mkdir -vp $HOME/.config/{autostart,autostart-scripts,bat,foot,git,MangoHud,mpv,nvim,subliminal,user-tmpfiles.d,systemd/user,yt-dlp}/
# Empty files as note to self
if [ ! -f $HOME/.config/subliminal/subliminal.toml ]; then
touch $HOME/.config/subliminal/subliminal.toml
fi
# terminfo just in case it needs to be copied to remote system
mkdir -vp $HOME/.terminfo/{A..z}
# Git config, legacy support for old location as well.
# The other script appends sourced file, so if thou aren't I, thou should
# consider it as well; `git config --global --add include.path '$HOME/yourgitconfig'`
cp -v conf/gitconfig $HOME/.config/git/config
touch $HOME/.gitconfig
rm $HOME/.gitconfig
ln -nsfv $HOME/.config/git/config $HOME/.gitconfig
# Used for `git init` and `git clone`, will contain pre-commit hooks
mkdir -vp $HOME/.git-template
# {n,neo}vim
cp -v rc/vimrc $HOME/.vimrc
cp -v conf/init.vim $HOME/.config/nvim/init.vim
cp -v conf/makepkg.conf $HOME/.makepkg.conf
# system information overlay
if [ ! -f $HOME/.config/MangoHud/MangoHud.conf ]; then
cp -v conf/MangoHud.conf $HOME/.config/MangoHud/
fi
# Arch Wiki gaming for better positional audio?
# although does this even apply to pipewire?
if [ ! -f $HOME/.alsoftrc ]; then
echo "hrtf = true" > ~/.alsoftrc
fi
# Discord snap inter process communication
#if [ -f /var/lib/snapd/snap/bin/discord ]; then
#if [ ! -f $HOME/.config/user-tmpfiles.d/discord-rpc.conf ]; then
#cp -v conf/user-tmpfiles.d/discord-rpc.conf $HOME/.config/user-tmpfiles.d/
#fi
#fi
# Default cursor font
if [[ ! -f $HOME/.local/share/icons/default/index.theme && -f /usr/share/icons/Oxygen_Yellow/index.theme ]]; then
mkdir -vp $HOME/.local/share/icons/default/
cp -v local/share/icons/default/index.theme $HOME/.local/share/icons/default/
fi
# wayland native terminal
if [ ! -f $HOME/.config/foot/foot.ini ]; then
cp -v conf/foot/foot.ini $HOME/.config/foot/foot.ini
fi
# KDE crash reporter. I don't want to keep giving it permission to download
# debug symbols and send reports, just do it automatically.
if [ ! -f $HOME/.config/drkonqirc.bak ]; then
cp -v $HOME/.config/drkonqirc $HOME/.config/drkonqirc.bak
cp -v rc/drkonqirc $HOME/.config/drkonqirc
fi
# A cat(1) clone with wings.
if hash bat 2> /dev/null; then
mkdir -vp $(bat --config-dir)
if [ ! -f $(bat --config-file) ]; then
bat --generate-config-file
cat conf/bat.conf >> $(bat --config-file)
fi
fi
# the media player
cp -v conf/mpv.conf $HOME/.config/mpv/mpv.conf
mkdir -vp $HOME/.var/app/io.mpv.Mpv/config/mpv
cp -v conf/mpv.conf $HOME/.var/app/io.mpv.Mpv/config/mpv/mpv.conf
# Create KDE expected config files
touch $HOME/.config/k{screenlocker,xkb}rc
# if I am performing ident spoofing already, I don't want to touch it
if [ ! -f $HOME/.oidentd.conf ]; then
cp -v conf/oidentd.conf $HOME/.oidentd.conf
fi
# In addition to git, my gnupg configuration should be questioned
mkdir -vp $HOME/.gnupg
cp -v gpg/gpg.conf $HOME/.gnupg/gpg.conf
cp -v gpg/gpg-agent.conf $HOME/.gnupg/gpg-agent.conf
cp -v gpg/dirmngr.conf $HOME/.gnupg/dirmngr.conf
# Issues with GPG? SIGHUP dirmngr
killall -HUP dirmngr
# I don't remember using these in ages and I don't think they apply to
# wayland
#cp -v rc/xinitrc $HOME/.xinitrc
cp -v conf/pastebinit.xml $HOME/.pastebinit.xml
cp -v conf/Xresources $HOME/.Xresources
# Nice sysinfo script
mkdir -vp $HOME/.inxi
cp -v conf/inxi.conf $HOME/.inxi/inxi.conf
# laziness
if [ -d submodules/pgp-alt-wot/me ]; then
gpg --quiet --import submodules/pgp-alt-wot/me/*.asc &
else
gpg --quiet --import .mikaela/keys/*.asc &
fi
# Utilized by my ssh_config (not to be confused with sshd_config)
mkdir -vp $HOME/.ssh/sockets/
# It will get used later
mkdir -vp $HOME/.local/bin/
# Setting permissions
chmod a+xr chmod
bash -x ./chmod &
# The submodules contain nice things such as fonts
git submodule update &
git gc &
# Aforementioned git template directory and pre-commit
if hash pre-commit 2> /dev/null; then
pre-commit init-templatedir $HOME/.git-template
pre-commit gc
fi
# If symlinks are installed, remove dead/dangling ones from $HOME/.local/bin
# so corepack won't get confused if those are present
if hash symlinks 2> /dev/null; then
symlinks -d $HOME/.local/bin/
else
echo "WARNING! Executable named symlinks not found in PATH."
sleep 3
fi
# node package manager manager
if hash corepack 2> /dev/null; then
# Will install symlinks for pnpm, yarn, etc., but not npm unless
# explicitly requested as below
corepack enable --install-directory $HOME/.local/bin/
corepack enable npm --install-directory $HOME/.local/bin/
# pnpm can utilize the same packagemanager field as corepack, even when
# used alone
corepack pnpm config set manage-package-manager-versions=true
elif hash pnpm 2> /dev/null; then
# see above which is more relevant in this case
pnpm config set manage-package-manager-versions=true
else
echo "WARNING! corepack is not installed."
sleep 3
fi
# If running as root, which I am doing regardless of not being supposed to,
if [ "$(id -u)" == "0" ]; then
# Fedora Atomic compatibility
if [ -d /var/roothome ]; then
chmod -v a+x /var/roothome
fi
# Desktop entries
mkdir -vp /usr/local/share/applications/
# These are bound to exist on my systems
cp -v local/share/applications/{a-signal,a-syncplay,plasma-update,a-firefox-cups,a-firefox-gmail,a-firefox,a-thunderbird,foot-ncdu,foot-systemd-inhibit}.desktop /usr/local/share/applications/
if [ -f "/usr/bin/vivaldi-stable" ]; then
cp -v local/share/applications/{a-vivaldi,vivaldi-{apps,youtube-music,yle-areena,discord,gmail,gmessages,google-calendar,telegram,twitch,whatsapp,mtv-katsomo,radioplayer,ruutu}}.desktop /usr/local/share/applications/
elif [ -f "/usr/bin/chromium-browser" ]; then
cp -v local/share/applications/{a-chromium,chromium-{apps,youtube-music,yle-areena,discord,gmail,gmessages,google-calendar,telegram,twitch,whatsapp,mtv-katsomo,radioplayer,ruutu}}.desktop /usr/local/share/applications/
fi
# If Steam is installed, chances are these work
if [ -f /usr/share/steam ]; then
cp -v local/share/applications/{steam-bigpicture,steam-tray}.desktop /usr/local/share/applications/
elif [ -f /var/lib/flatpak/exports/bin/com.valvesoftware.Steam ]; then
cp -v local/share/applications/{a-steam,com.valvesoftware.Steam,flatpak-steam-bigpicture,flatpak-steam-tray,com.heroicgameslauncher.hgl}.desktop /usr/local/share/applications/
fi
if [ -f /var/lib/flatpak/exports/bin/com.heroicgameslauncher.hgl ]; then
cp -v local/share/applications/com.heroicgameslauncher.hgl.desktop /usr/local/share/applications/
fi
if [ -f /var/lib/flatpak/exports/bin/org.briarproject.Briar ]; then
cp -v local/share/applications/briar.desktop /usr/local/share/applications/
fi
if [ -f /usr/bin/librewolf ]; then
cp -v local/share/applications/libreawoo.desktop /usr/local/share/applications/
fi
if [ -f /usr/bin/vivaldi ]; then
cp -v local/share/applications/vivaldi.desktop /usr/local/share/applications/
fi
# SECURITY WARNING! Attempt at automatic symlinking and weird kernel configuration etc.
mkdir -vp /etc/tmpfiles.d/
cp -v etc/tmpfiles.d/{snapd-classic,networking-security-privacy}.conf /etc/tmpfiles.d/
# Additional configuration for sudo SECURITY WARNING DANGER ALARM BELLS!
if [ -d /etc/sudoers.d ]; then
cp -v etc/sudoers.d/{aminda-systemd,lecture,password-feedback,always-ask-password,envkeep-extras} /etc/sudoers.d/
fi
# Profile configuration. SECURITY WARNING
cp -v etc/profile.d/*.sh /etc/profile.d/
chmod -v a+r /etc/profile.d/*.sh
# Kernel configuration. SECURITY WARNING
cp -v etc/sysctl.d/*.conf /etc/sysctl.d/
chmod -v a+r /etc/sysctl.d/*.conf
(sysctl -p --system &)
# my script to avoid scheduling btrfs balancing
if hash bat 2> /dev/null; then
btrfs-enable-dynamic-periodic-reclaim
fi
# We are doing kernel module configuration now? SECURITY WARNING!!!!1
if [ -d /etc/modules-load.d/ ]; then
if [[ ! -f /dev/ntsync && -f /lib/modules/$(uname -r)/kernel/drivers/misc/ntsync.ko.xz ]]; then
modprobe ntsync
if [ ! -f /etc/modules-load.d/60-ntsync.conf ]; then
cp etc/modules-load.d/60-ntsync.conf /etc/modules-load.d/
fi
fi
fi
if [ -d /etc/modprobe.d/ ]; then
if [ ! -f /etc/modprobe.d/fix-bluetooth.conf ]; then
cp etc/modprobe.d/fix-bluetooth.conf /etc/modprobe.d/fix-bluetooth.conf
fi
fi
# udev configuration. SECURITY WARNING
mkdir -vp /etc/udev/rules.d/
ln -nsfv $HOME/.shell-things/submodules/steam-devices/*.rules /etc/udev/rules.d/
# SECURITY device/module configuration. SECURITY WARNING
if [ -d /etc/pkcs11/modules/ ]; then
cp -v etc/pkcs11/modules/*.module /etc/pkcs11/modules/
fi
# SSHd hardening hopefully. SECURITY WARNING
mkdir -vp /etc/ssh/sshd_config.d/
chmod -v a+x /etc/ssh/sshd_config.d/
cp etc/ssh/sshd_config.d/{00-basic-security.conf,01-acceptenv.conf} /etc/ssh/sshd_config.d/
chmod -v a+r /etc/ssh/sshd_config.d/*.conf
# Systemd configuration directories. SECURITY WARNINGS!
mkdir -vp /etc/systemd/{system,system-preset,user,network}/
mkdir -vp /etc/systemd/system/{app.slice.d,service.d,socket.d}/
cp -v etc/systemd/system/app.slice.d/90-cpuquota.conf /etc/systemd/system/app.slice.d/90-cpuquota.conf
mkdir -vp /etc/systemd/{coredump,login,oomd,journald,resolved,system,timesyncd}.conf.d/
cp -v etc/systemd/oomd.conf.d/20-oomd.conf /etc/systemd/oomd.conf.d/20-oomd.conf
mkdir -vp /etc/systemd/system/{aminda-duperemove,aminda-nocron-reboot,ssh,sshd,sshguard,systemd-resolved,systemd-networkd,NetworkManager,iwd,unbound,tor,oidentd,yggdrasil}.service.d/
mkdir -vp /etc/systemd/system/{ssh,sshd,oidentd}.socket.d/
# SECURITY WARNING!
cp -v etc/systemd/system/service.d/rngd-wanted.conf /etc/systemd/system/service.d/
cp -v etc/systemd/system/socket.d/{dualstack-bind,freebind,upheld}.conf /etc/systemd/system/socket.d/
# SECURITY WARNING!
cp -v etc/systemd/system/service.d/never-fail.conf /etc/systemd/system/ssh.service.d/
cp -v etc/systemd/system/service.d/never-fail.conf /etc/systemd/system/sshd.service.d/
cp -v etc/systemd/system/service.d/never-fail.conf /etc/systemd/system/sshguard.service.d/
cp -v etc/systemd/system/service.d/never-fail.conf /etc/systemd/system/systemd-resolved.service.d/
cp -v etc/systemd/system/service.d/never-fail.conf /etc/systemd/system/systemd-networkd.service.d/
cp -v etc/systemd/system/service.d/never-fail.conf /etc/systemd/system/oidentd.service.d/
cp -v etc/systemd/system/service.d/never-fail.conf /etc/systemd/system/NetworkManager.service.d/
cp -v etc/systemd/system/service.d/never-fail.conf /etc/systemd/system/iwd.service.d/
cp -v etc/systemd/system/service.d/never-fail.conf /etc/systemd/system/unbound.service.d/
cp -v etc/systemd/system/service.d/never-fail.conf /etc/systemd/system/tor.service.d/
cp -v etc/systemd/system/service.d/never-fail.conf /etc/systemd/system/yggdrasil.service.d/
#cp -v etc/systemd/system/socket.d/dualstack-bind.conf /etc/systemd/system/ssh.socket.d/
#cp -v etc/systemd/system/socket.d/dualstack-bind.conf /etc/systemd/system/sshd.socket.d/
#cp -v etc/systemd/system/socket.d/dualstack-bind.conf /etc/systemd/system/oidentd.socket.d/
rm -v /etc/systemd/system/*.socket.d/dualstack-bind.conf
# SECURITY WARNING! Automatic flatpak updates
if hash flatpak 2> /dev/null; then
cp -v etc/systemd/system/flatpak-update.{timer,service} /etc/systemd/system/
fi
# SECURITY AND PRIVACY WARNING! May change WiFi positioning service
# endpoint plus enables data submission.
if [ -d /etc/geoclue/conf.d/ ]; then
cp etc/geoclue/conf.d/80-beacondb.conf /etc/geoclue/conf.d/
chmod -v a+r /etc/geoclue/conf.d/*.conf
touch /etc/geolocation
chown -v geoclue:geoclue /etc/geolocation
chmod -v 600 /etc/geolocation
fi
# DANGER of breaking wireless NETWORKS.
# TODO: I am not brave enough for this.
#if [ -f /usr/lib/systemd/system/iwd.service ]; then
# if [ -f /usr/lib/systemd/system/NetworkManager.service ]; then
# if [ -d /etc/NetworkManager/conf.d ]; then
# cp -v etc/NetworkManager/conf.d/iwd.conf /etc/NetworkManager/conf.d/
# cp -v etc/systemd/system/NetworkManager.service.d/iwd-needed.conf /etc/systemd/system/NetworkManager.service.d/
# systemctl unmask iwd.service
# fi
# fi
#fi
# STRANGE BEHAVIOUR WARNING IF NOT ME.
cp -v etc/systemd/system/{aminda-nocron-reboot,aminda-nocron-rebootish,sysctl-p--system}.service /etc/systemd/system/
cp -v etc/systemd/system/{aminda-nocron-reboot,aminda-nocron-rebootish,sysctl-p--system}.timer /etc/systemd/system/
if [ -d /etc/unbound/conf.d ]; then
cp -v etc/unbound/unbound.conf.d/{blocklist,cache-size,expired-stale-serving-rfc8767,local-tlds,logging,min-ttl-hour,please-hijack-me,prefer-ip6}.conf /etc/unbound/conf.d/
chmod -v a+r /etc/unbound/conf.d/*.conf
elif [ -d /etc/unbound/unbound.conf.d ]; then
cp -v etc/unbound/unbound.conf.d/{blocklist,cache-size,expired-stale-serving-rfc8767,local-tlds,logging,min-ttl-hour,please-hijack-me,prefer-ip6}.conf /etc/unbound/unbound.conf.d/
chmod -v a+r /etc/unbound/unbound.conf.d/*.conf
fi
# This is now how I assume Kinoite
if [ -f /usr/etc/rpm-ostreed.conf ]; then
cp -v etc/systemd/system/aminda-duperemove.service /etc/systemd/system/
cp -v etc/systemd/system/aminda-duperemove.timer /etc/systemd/system/
cp -v etc/systemd/system/aminda-duperemove.service.d/91-fedora-atomic.conf /etc/systemd/system/aminda-duperemove.service.d/
#cp -v etc/systemd/system/monthly-btrfs-balance.service.d/fedora-atomic.conf /etc/systemd/system/monthly-btrfs-balance.service.d/
fi
if hash systemctl 2> /dev/null; then
systemctl daemon-reload
#(systemctl --global enable darkman.service &)
(systemctl --global enable systemd-tmpfiles-setup.service &)
# experiment
(systemctl --global enable gamemoded.service &)
# SECURITY WARNING! Practically a backdoor unless you are me and expect this!
# WARNING! Likely breaks SSHd outside of port 22 unless override exists!
(systemctl --global enable foot-server.socket &)
(systemctl enable --now ssh.socket &)
(systemctl enable --now sshd.socket &)
(systemctl enable --now avahi-daemon.socket &)
(systemctl enable --now avahi-daemon.service &)
(systemctl enable --now systemd-oomd.socket &)
(systemctl enable --now oidentd.socket &)
# sshd is critical and I don't want it to fail due to the service holding the listener
if [ -f /etc/systemd/system/sockets.target.wants/ssh.socket ]; then
(systemctl disable --now ssh.service &)
(systemctl enable --now ssh.socket &)
elif [ -f /etc/systemd/system/sockets.target.wants/sshd.socket ]; then
(systemctl disable --now sshd.service &)
(systemctl enable --now sshd.socket &)
fi
# Aminda weirdness
(systemctl enable --now {aminda-nocron-reboot,aminda-nocron-rebootish,sysctl-p--system}.timer &)
if hash flatpak 2> /dev/null; then
(systemctl enable flatpak-update.timer &)
fi
if [ -f /usr/etc/rpm-ostreed.conf ]; then
(systemctl enable aminda-duperemove.timer &)
fi
fi
# SECURITY WARNING, autostarts
cp -v etc/xdg/autostart/foot-tmux.desktop /etc/xdg/autostart/
#cp -v etc/xdg/autostart/footclient-btop.desktop /etc/xdg/autostart/
cp -v etc/xdg/autostart/footclient-htop.desktop /etc/xdg/autostart/
if hash journalctl 2> /dev/null; then
cp -v etc/xdg/autostart/footclient-journal.desktop /etc/xdg/autostart/
#cp -v etc/xdg/autostart/footclient-journal-dns.desktop /etc/xdg/autostart/
#cp -v etc/xdg/autostart/footclient-journal-network.desktop /etc/xdg/autostart/
#cp -v etc/xdg/autostart/footclient-journal-time.desktop /etc/xdg/autostart/
fi
# TODO: Remove this in the future when everything has migrated to the new
# name. (2026-02-01)
if -f [ /etc/xdg/autostart/easyeffects-service.desktop ]; then
rm /etc/xdg/autostart/easyeffects-service.desktop
fi
cp -v etc/xdg/autostart/com.github.wwmm.easyeffects.desktop /etc/xdg/autostart/
ln -nsfv /usr/local/share/applications/a-firefox.desktop /etc/xdg/autostart/
if [ -f "/usr/bin/vivaldi-stable" ]; then
cp -v etc/xdg/autostart/01-vivaldi-bg.desktop /etc/xdg/autostart/
if [ -f "/etc/xdg/autostart/01-chromium-bg.desktop" ]; then
rm /etc/xdg/autostart/01-chromium-bg.desktop
fi
elif [ -f "/usr/bin/chromium-browser" ]; then
cp -v etc/xdg/autostart/01-chromium-bg.desktop /etc/xdg/autostart/
fi
ln -nsfv /var/lib/flatpak/exports/share/applications/org.kde.kteatime.desktop /etc/xdg/autostart/
ln -nsfv /var/lib/flatpak/exports/share/applications/org.kde.kclock.desktop /etc/xdg/autostart/
ln -nsfv /usr/local/share/applications/plasma-update.desktop /etc/xdg/autostart/
#ln -nsfv /usr/share/applications/org.kde.plasma-systemmonitor.desktop /etc/xdg/autostart/
chmod -v a+r /etc/xdg/autostart/*.desktop
# If apt is installed, enable progress bar and colors
if hash apt-get 2> /dev/null; then
mkdir -vp /etc/apt/apt.conf.d/
# Enables progress bar and colours for apt/dpkg, which are helpful at
# times when guesstimating when will things happen
echo 'Dpkg::Progress-Fancy "1";' > /etc/apt/apt.conf.d/99progressbar
echo 'APT::Color "1";' > /etc/apt/apt.conf.d/99color
fi
# Workarounds for Debian binary names
# nodejs -> node was traditionally an eternity issue for me
if [[ -f /usr/bin/nodejs && ! -f /usr/bin/node ]]; then
ln -nsfv /usr/bin/nodejs /usr/local/bin/node
fi
# batcat? I expect bat everywhere rather than Bacula
if [[ -f /usr/bin/batcat && ! -f /usr/bin/btraceback && ! -f bsmtp ]]; then
ln -nsfv /usr/bin/batcat /usr/local/bin/bat
fi
# If some locate variant is installed, now is a great time to ensure its
# database is up-to-date. This may also enable automated database
# updates.
if hash updatedb 2> /dev/null; then
(updatedb &)
fi
# If LaTeX fonts are available, make them available for the rest of the
# system too.
if [ -d "/usr/share/texlive/texmf-dist/fonts/" ]; then
mkdir -p /usr/local/share/fonts
ln -nsfv /usr/share/texlive/texmf-dist/fonts /usr/local/share/fonts/texlive
fi
# They say to not repeat yourself, but copy-pasting from below is the
# easiest way to make the submodule fonts available to the system.
if [ -d "$HOME/.shell-things" ]; then
mkdir -p /usr/local/share/fonts
ln -nsfv $HOME/.shell-things/submodules/comicneue/Fonts/OTF /usr/local/share/fonts/comicneue
ln -nsfv $HOME/.shell-things/submodules/comic-shanns-mono/fonts/ComicShannsMono-Regular.otf /usr/local/share/fonts/
ln -nsfv $HOME/.shell-things/submodules/opendyslexic/compiled/OpenDyslexic-*.otf /usr/local/share/fonts/
ln -nsfv $HOME/.shell-things/submodules/serious-sans/SeriousShanns/otf /usr/local/share/fonts/SeriousShanns
ln -nsfv $HOME/.shell-things/submodules/serious-sans/SeriousShanns/NerdFont /usr/local/share/fonts/
ln -nsfv $HOME/.shell-things/submodules/serious-sans/SeriousShanns/NerdFontMono /usr/local/share/fonts/
ln -nsfv $HOME/.shell-things/submodules/serious-sans/SeriousShanns/NerdFontPropo /usr/local/share/fonts/
ln -nsfv $HOME/.shell-things/submodules/Inclusive-Sans/fonts/variable /usr/local/share/fonts/Inclusive-Sans
ln -nsfv $HOME/.shell-things/submodules/atkinson-hyperlegible/fonts/otf /usr/local/share/fonts/atkinson-hyperlegible
ln -nsfv $HOME/.shell-things/submodules/atkinson-hyperlegible-next/fonts/variable /usr/local/share/fonts/atkinson-hyperlegible-next
ln -nsfv $HOME/.shell-things/submodules/atkinson-hyperlegible-next-mono/fonts/variable /usr/local/share/fonts/atkinson-hyperlegible-next-mono
ln -nsfv $HOME/.shell-things/submodules/nicoverbruggen-ebook-fonts/fonts /usr/local/share/fonts/nicoverbruggen-ebook-fonts
ln -nsfv $HOME/.shell-things/submodules/microsoft-fonts/Symbols/*.ttf /usr/local/share/fonts/
ln -nsfv $HOME/.shell-things/submodules/microsoft-fonts/Symbols/*.otf /usr/local/share/fonts/
ln -nsfv $HOME/.shell-things/submodules/source-sans/VF/*.otf /usr/local/share/fonts/
ln -nsfv $HOME/.shell-things/submodules/source-sans/OTF/ /usr/local/share/fonts/source-sans
ln -nsfv $HOME/.shell-things/submodules/source-serif/VAR/*.otf /usr/local/share/fonts/
ln -nsfv $HOME/.shell-things/submodules/source-serif/OTF /usr/local/share/fonts/source-serif
ln -nsfv $HOME/.shell-things/submodules/source-code-pro/VF/*.otf /usr/local/share/fonts/
ln -nsfv $HOME/.shell-things/submodules/source-code-pro/OTF/ /usr/local/share/fonts/source-code-pro
ln -nsfv $HOME/.shell-things/submodules/ubuntu-sans/fonts/variable /usr/local/share/fonts/ubuntu-sans
ln -nsfv $HOME/.shell-things/submodules/ubuntu-sans-mono/fonts/variable /usr/local/share/fonts/ubuntu-sans-mono
ln -nsfv $HOME/.shell-things/submodules/lora-font/fonts/variable /usr/local/share/fonts/lora
fi
# Symlink cleanup
if hash symlinks 2> /dev/null; then
symlinks -d /etc/xdg/autostart/
symlinks -d /etc/udev/rules.d/
symlinks -d /usr/local/bin/
symlinks -d /usr/local/share/fonts/
else
echo "WARNING! Executable named symlinks not found in PATH."
sleep 3
fi
else
# rootless-only tasks
# Figure out the localization of $HOME/Desktop
if hash xdg-user-dir 2> /dev/null; then
DESKTOP=$(xdg-user-dir DESKTOP)
if [ -d ~/.config/autostart ]; then
ln -nsfv ~/.config/autostart/*.desktop $DESKTOP/
# laziness
ln -nsfv ~/.config/autostart/*.desktop ~/.local/share/applications/
fi
# Ensure there is foot-server.socket before creating a shortcut for footclient
if hash systemctl 2> /dev/null; then
systemctl --user enable --now foot-server.socket
ln -nsfv /usr/share/applications/footclient.desktop $DESKTOP/
fi
ln -nsfv /usr/share/applications/foot.desktop $DESKTOP/
ln -nsfv /usr/local/share/applications/foot-systemd-inhibit.desktop $DESKTOP/
# Create desktop shortcuts/symlinks for apps
ln -nsfv /usr/share/applications/org.kde.discover.desktop $DESKTOP/
ln -nsfv /usr/share/applications/org.kde.kdeconnect-settings.desktop $DESKTOP/
ln -nsfv /usr/share/applications/org.kde.kdeconnect.app.desktop $DESKTOP/
#ln -nsfv /usr/share/applications/org.mozilla.firefox.desktop $DESKTOP/
ln -nsfv /usr/share/applications/org.kde.plasma-welcome.desktop $DESKTOP/
ln -nsfv /usr/share/applications/org.kde.dolphin.desktop $DESKTOP/
ln -nsfv /usr/share/applications/kdesystemsettings.desktop $DESKTOP/
ln -nsfv /usr/share/applications/virtualbox.desktop $DESKTOP/
ln -nsfv /usr/share/applications/org.kde.kwrite.desktop $DESKTOP/
ln -nsfv /usr/share/applications/mpv.desktop $DESKTOP/
ln -nsfv /usr/share/applications/io.github.celluloid_player.Celluloid.desktop $DESKTOP/
ln -nsfv /usr/share/applications/org.kde.kinfocenter.desktop $DESKTOP/
ln -nsfv /usr/share/applications/org.kde.plasma-systemmonitor.desktop $DESKTOP/
ln -nsfv /usr/share/applications/org.kde.kfind.desktop $DESKTOP/
ln -nsfv /usr/share/applications/org.kde.partitionmanager.desktop $DESKTOP/
#ln -nsfv /usr/share/applications/org.kde.haruna.desktop $DESKTOP/
ln -nsfv /usr/share/applications/discord.desktop $DESKTOP/
if [[ -f /usr/share/applications/org.torproject.torbrowser-launcher.desktop ]]; then
ln -nsfv /usr/share/applications/org.torproject.torbrowser-launcher.desktop $DESKTOP/
ln -nsfv /usr/share/applications/org.torproject.torbrowser-launcher.settings.desktop $DESKTOP/
else
ln -nsfv /var/lib/flatpak/exports/share/applications/org.torproject.torbrowser-launcher.desktop $DESKTOP/
fi
# scripts repo
ln -nsfv /usr/local/share/applications/a-firefox.desktop $DESKTOP/
ln -nsfv /usr/local/share/applications/a-thunderbird.desktop $DESKTOP/
if [ -f "/usr/bin/vivaldi-stable" ]; then
ln -nsfv /usr/local/share/applications/a-vivaldi.desktop $DESKTOP/
if [ -f /etc/chromium/policies/managed/aminda-pwa.json ]; then
ln -nsfv /usr/local/share/applications/vivaldi-{apps,youtube-music,yle-areena,discord,gmail,gmessages,google-calendar,telegram,twitch,whatsapp,mtv-katsomo,radioplayer,ruutu}.desktop $DESKTOP/
fi
elif [ -f "/usr/bin/chromium-browser" ]; then
ln -nsfv /usr/local/share/applications/a-chromium.desktop $DESKTOP/
if [ -f /etc/chromium/policies/managed/aminda-pwa.json ]; then
ln -nsfv /usr/local/share/applications/chromium-{apps,youtube-music,yle-areena,discord,gmail,gmessages,google-calendar,telegram,twitch,whatsapp,mtv-katsomo,radioplayer,ruutu}.desktop $DESKTOP/
fi
fi
if [ -f "/usr/bin/google-chrome-stable" ]; then
ln -nsfv /usr/local/share/applications/a-google-chrome.desktop $DESKTOP/
ln -nsfv /usr/local/share/applications/chrome-apps.desktop $DESKTOP/
fi
if [ -f "/usr/bin/microsoft-edge-stable" ]; then
ln -nsfv /usr/local/share/applications/a-microsoft-edge.desktop $DESKTOP/
fi
if [ -f "/usr/bin/vivaldi-stable" ]; then
ln -nsfv /usr/local/share/applications/a-vivaldi.desktop $DESKTOP/
ln -nsfv /usr/local/share/applications/vivaldi-apps.desktop $DESKTOP/
fi
if [ -f "/usr/bin/librewolf" ]; then
ln -nsfv /usr/local/share/applications/libreawoo.desktop $DESKTOP/
fi
if [[ -f $HOME/.local/share/icons/hicolor/128x128/apps/syncplay.png && -f /usr/local/bin/syncplay ]]; then
ln -nsfv /usr/local/share/applications/a-syncplay.desktop $DESKTOP
fi
if hash plasma-discover 2> /dev/null; then
ln -nsfv /usr/local/share/applications/plasma-update.desktop $DESKTOP/
fi
ln -nsfv /etc/xdg/autostart/foot*.desktop $DESKTOP/
ln -nsfv /usr/local/share/applications/foot-ncdu.desktop $DESKTOP/
ln -nsfv /usr/local/share/applications/steam-bigpicture.desktop $DESKTOP/
ln -nsfv /usr/local/share/applications/flatpak-steam-bigpicture.desktop $DESKTOP/
ln -nsfv /usr/local/share/applications/a-steam.desktop $DESKTOP/
ln -nsfv /usr/local/share/applications/com.heroicgameslauncher.hgl.desktop $DESKTOP/
if [ -f "/var/lib/flatpak/exports/bin/org.signal.Signal" ]; then
ln -nsfv /usr/local/share/applications/a-signal.desktop $DESKTOP/
fi
ln -nsfv /usr/local/share/applications/a-firefox-cups.desktop $DESKTOP/
ln -nsfv /usr/local/share/applications/a-firefox-gmail.desktop $DESKTOP/
# flatpaks
ln -nsfv /var/lib/flatpak/exports/share/applications/com.valvesoftware.SteamLink.desktop $DESKTOP/
#ln -nsfv /var/lib/flatpak/exports/share/applications/com.heroicgameslauncher.hgl.desktop $DESKTOP/
ln -nsfv /var/lib/flatpak/exports/share/applications/com.rafaelmardojai.Blanket.desktop $DESKTOP/
ln -nsfv /var/lib/flatpak/exports/share/applications/de.haeckerfelix.Shortwave.desktop $DESKTOP/
ln -nsfv /var/lib/flatpak/exports/share/applications/org.pulseaudio.pavucontrol.desktop $DESKTOP/
ln -nsfv /var/lib/flatpak/exports/share/applications/org.telegram.desktop.desktop $DESKTOP/
ln -nsfv /var/lib/flatpak/exports/share/applications/org.kde.audiotube.desktop $DESKTOP/
ln -nsfv /var/lib/flatpak/exports/share/applications/jp.nonbili.noutube.desktop $DESKTOP/
ln -nsfv /var/lib/flatpak/exports/share/applications/rocks.shy.VacuumTube.desktop $DESKTOP/
#ln -nsfv /var/lib/flatpak/exports/share/applications/org.videolan.VLC.desktop $DESKTOP/
ln -nsfv /var/lib/flatpak/exports/share/applications/org.kde.elisa.desktop $DESKTOP/
ln -nsfv /var/lib/flatpak/exports/share/applications/org.libreoffice.LibreOffice.desktop $DESKTOP/
#ln -nsfv /var/lib/flatpak/exports/share/applications/org.onlyoffice.desktopeditors.desktop $DESKTOP/
#ln -nsfv /var/lib/flatpak/exports/share/applications/app.devsuite.Ptyxis.desktop $DESKTOP/
ln -nsfv /var/lib/flatpak/exports/share/applications/org.kde.skanpage.desktop $DESKTOP/
ln -nsfv /var/lib/flatpak/exports/share/applications/org.kde.kclock.desktop $DESKTOP/
ln -nsfv /var/lib/flatpak/exports/share/applications/com.calibre_ebook.calibre.desktop $DESKTOP/
ln -nsfv /var/lib/flatpak/exports/share/applications/com.github.wwmm.easyeffects.desktop $DESKTOP/
ln -nsfv /var/lib/flatpak/exports/share/applications/org.fedoraproject.MediaWriter.desktop $DESKTOP/
ln -nsfv /var/lib/flatpak/exports/share/applications/org.jitsi.jitsi-meet.desktop $DESKTOP/
ln -nsfv /var/lib/flatpak/exports/share/applications/org.kde.itinerary.desktop $DESKTOP/
ln -nsfv /var/lib/flatpak/exports/share/applications/im.kaidan.kaidan.desktop $DESKTOP/
ln -nsfv /var/lib/flatpak/exports/share/applications/org.kde.neochat.desktop $DESKTOP/
ln -nsfv /var/lib/flatpak/exports/share/applications/org.kde.tokodon.desktop $DESKTOP/
if [ -f "/usr/share/applications/info.mumble.Mumble.desktop" ]; then
ln -nsfv /usr/share/applications/info.mumble.Mumble.desktop $DESKTOP/
else
ln -nsfv /var/lib/flatpak/exports/share/applications/info.mumble.Mumble.desktop $DESKTOP/
fi
# snaps
# No libdvdcss!
#ln -nsfv /var/lib/snapd/desktop/applications/vlc_vlc.desktop $DESKTOP/
#ln -nsfv /var/lib/snapd/desktop/applications/discord_discord.desktop $DESKTOP/
fi
# Ensure a-firefox.desktop has an icon
mkdir -p $HOME/.local/share/icons/hicolor/128x128/apps/
if [ -f "$HOME/.local/firefox/browser/chrome/icons/default/default128.png" ]; then
ln -nsfv $HOME/.local/firefox/browser/chrome/icons/default/default128.png ~/.local/share/icons/hicolor/128x128/apps/a-firefox.png
elif [ -f "/usr/share/icons/hicolor/256x256/apps/firefox.png" ]; then
ln -nsfv /usr/share/icons/hicolor/256x256/apps/firefox.png ~/.local/share/icons/hicolor/128x128/apps/a-firefox.png
elif [ -f "/usr/share/icons/HighContrast/256x256/apps/firefox.png" ]; then
ln -nsfv /usr/share/icons/HighContrast/256x256/apps/firefox.png ~/.local/share/icons/hicolor/128x128/apps/a-firefox.png
fi
# Ensure a-thunderbird.desktop has an icon
mkdir -p $HOME/.local/share/icons/hicolor/128x128/apps/
if [ -f "$HOME/.local/thunderbird/browser/chrome/icons/default/default128.png" ]; then
ln -nsfv $HOME/.local/thunderbird/browser/chrome/icons/default/default128.png ~/.local/share/icons/hicolor/128x128/apps/a-thunderbird.png
elif [ -f "/usr/share/icons/hicolor/256x256/apps/thunderbird.png" ]; then
ln -nsfv /usr/share/icons/hicolor/256x256/apps/thunderbird.png ~/.local/share/icons/hicolor/128x128/apps/a-thunderbird.png
elif [ -f "/usr/share/icons/HighContrast/256x256/apps/thunderbird.png" ]; then
ln -nsfv /usr/share/icons/HighContrast/256x256/apps/thunderbird.png ~/.local/share/icons/hicolor/128x128/apps/a-thunderbird.png
fi
# Remove dead symlinks
if hash symlinks 2> /dev/null; then
symlinks -d $DESKTOP/
else
echo "WARNING! Executable named symlinks not found in PATH."
sleep 3
fi
fi
# Make the submoduled fonts available to the system
if [ -d "$HOME/.shell-things" ]; then
mkdir -p $HOME/.local/share/fonts
ln -nsfv $HOME/.shell-things/submodules/comicneue/Fonts/OTF $HOME/.local/share/fonts/comicneue
ln -nsfv $HOME/.shell-things/submodules/comic-shanns-mono/fonts/ComicShannsMono-Regular.otf $HOME/.local/share/fonts/
ln -nsfv $HOME/.shell-things/submodules/opendyslexic/compiled/OpenDyslexic-*.otf $HOME/.local/share/fonts/
ln -nsfv $HOME/.shell-things/submodules/serious-sans/SeriousShanns/otf $HOME/.local/share/fonts/SeriousShanns
ln -nsfv $HOME/.shell-things/submodules/serious-sans/SeriousShanns/NerdFont $HOME/.local/share/fonts/
ln -nsfv $HOME/.shell-things/submodules/serious-sans/SeriousShanns/NerdFontMono $HOME/.local/share/fonts/
ln -nsfv $HOME/.shell-things/submodules/serious-sans/SeriousShanns/NerdFontPropo $HOME/.local/share/fonts/
ln -nsfv $HOME/.shell-things/submodules/Inclusive-Sans/fonts/variable $HOME/.local/share/fonts/Inclusive-Sans
ln -nsfv $HOME/.shell-things/submodules/atkinson-hyperlegible/fonts/otf $HOME/.local/share/fonts/atkinson-hyperlegible
ln -nsfv $HOME/.shell-things/submodules/atkinson-hyperlegible-next/fonts/variable $HOME/.local/share/fonts/atkinson-hyperlegible-next
ln -nsfv $HOME/.shell-things/submodules/atkinson-hyperlegible-next-mono/fonts/variable $HOME/.local/share/fonts/atkinson-hyperlegible-next-mono
ln -nsfv $HOME/.shell-things/submodules/nicoverbruggen-ebook-fonts/fonts $HOME/.local/share/fonts/nicoverbruggen-ebook-fonts
ln -nsfv $HOME/.shell-things/submodules/microsoft-fonts/Symbols/*.ttf $HOME/.local/share/fonts/
ln -nsfv $HOME/.shell-things/submodules/microsoft-fonts/Symbols/*.otf $HOME/.local/share/fonts/
ln -nsfv $HOME/.shell-things/submodules/source-sans/VF/*.otf $HOME/.local/share/fonts/
ln -nsfv $HOME/.shell-things/submodules/source-sans/OTF/ $HOME/.local/share/fonts/source-sans
ln -nsfv $HOME/.shell-things/submodules/source-serif/VAR/*.otf $HOME/.local/share/fonts/
ln -nsfv $HOME/.shell-things/submodules/source-serif/OTF $HOME/.local/share/fonts/source-serif
ln -nsfv $HOME/.shell-things/submodules/source-code-pro/VF/*.otf $HOME/.local/share/fonts/
ln -nsfv $HOME/.shell-things/submodules/source-code-pro/OTF/ $HOME/.local/share/fonts/source-code-pro
ln -nsfv $HOME/.shell-things/submodules/ubuntu-sans/fonts/variable $HOME/.local/share/fonts/ubuntu-sans
ln -nsfv $HOME/.shell-things/submodules/ubuntu-sans-mono/fonts/variable $HOME/.local/share/fonts/ubuntu-sans-mono
ln -nsfv $HOME/.shell-things/submodules/lora-font/fonts/variable $HOME/.local/share/fonts/lora
# Font cleanup
if hash symlinks 2> /dev/null; then
symlinks -d $HOME/.local/share/fonts/
else
echo "WARNING! Executable named symlinks not found in PATH."
sleep 3
fi
fi
if hash fc-cache 2> /dev/null; then
(fc-cache &)
fi
# If the previously mentioned marker is present, include the even more
# questionable script (yay!) into our current execution
if [ -f "$MIKAELA_GREP" ]; then
. .mikaela_install
fi
# If git-lfs is installed, configure git with it, otherwise this will just
# error in forked background process which will no longer hurt the current
# execution.
(git lfs install | true &)
set +x
# vim : set ft=bash :