-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup_Ubuntu.sh
More file actions
1104 lines (979 loc) · 37 KB
/
Copy pathsetup_Ubuntu.sh
File metadata and controls
1104 lines (979 loc) · 37 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
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#!/bin/bash
################################################################################
# #
# setup_Ubuntu #
# #
################################################################################
# #
# LICENCE INFORMATION #
# #
# This program sets up an Ubuntu personal installation. #
# #
# copyright (C) 2011 Will Breaden Madden, wbm@protonmail.ch #
# #
# This software is released under the terms of the GNU General Public License #
# version 3 (GPLv3). #
# #
# This program is free software: you can redistribute it and/or modify it #
# under the terms of the GNU General Public License as published by the Free #
# Software Foundation, either version 3 of the License, or (at your option) #
# any later version. #
# #
# This program is distributed in the hope that it will be useful, but WITHOUT #
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or #
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for #
# more details. #
# #
# For a copy of the GNU General Public License, see #
# <http://www.gnu.org/licenses>. #
# #
################################################################################
################################################################################
# #
# SCRIPT DOCUMENTATION #
# #
# This is a setup script for Ubuntu. It is likely to work well with the most #
# recent version of Ubuntu (and should work to varying degrees with earlier #
# versions). There are some Boolean option variables that should be set before #
# running this script in a special function near the top of this script. #
# #
################################################################################
version="2026-05-19T2002Z"
#¯`·.¸¸.·´¯`·.¸¸.·´¯`·.¸¸.·´¯`·.¸¸.·´¯`·.¸¸.·´¯`·.¸¸.·´¯`·.¸¸.·´¯`·.¸¸.·´><(((º>
reload_options(){
# =======\ /=======
# =======> THIS IS THE PLACE WHERE YOU SET THE SCRIPT CONFIGURATION <=======
# =======/ \=======
#
# 0: no, don't set up
# 1: yes, do set up
AirVPN=1
LaTeX=1
ROOT=0
Sage=0
Mathics=0
Mattermost=0
VirtualBox=0
GPU=0 # install GPU utilities
Telegram=0
theme_Bash=1
Indicator_SysMonitor=1
Wine=1
VeraCrypt=1
}
note(){
# This function echos text given to a log file.
timestamp="$(date -u +"%Y-%m-%dT%H%M%SZ")"
text="${*}"
echo ""${timestamp}" "${text}""
log_file="log.txt"
echo ""${timestamp}" "${text}"" >> "${log_file}"
#echo "${text}" | festival --tts &
}
echo_pause(){
# This function echos text given and pauses for a key press.
text="${*}"
echo "${text}" | festival --tts &
read -s -n 1 -p "${text}"
echo
}
actuality(){
# This function checks for the existence of a program. It returns a truth
# value and is intended for use in conditional branching code. Example:
#
# if actuality root; then
# echo "ROOT exists."
# fi
# if !(actuality zappo); then
# echo "zappo does not exist."
# fi
type "$1" &> /dev/null;
}
text_in_lower_case(){
# This function converts text to lower case.
text="${1}"
echo "$(echo "${text}" | sed 's/\(.*\)/\L\1/')"
}
terminal_dimension(){
# This function takes one argument, the required "type" of dimension
# (size, height or width) of the terminal. The required dimension then is
# returned. If no argument is specified, nothing is returned. The dimensions
# are as follows:
#
# size: the width and height of the terminal separated by a space
# (e.g., 24 80)
# height: the height of the terminal (e.g., 24)
# width: the width of the terminal (e.g., 80)
dimension="${1}"
if [ "${dimension}" = "size" ]; then
stty size
else
if [ "${dimension}" = "height" ]; then
stty size | cut -d" " -f1
else
if [ "${dimension}" = "width" ]; then
stty size | cut -d" " -f2
fi
fi
fi
}
print_character(){
# This function takes two arguments, the first being the character to print
# and the second being the number of times to print the character. This
# function prints the specified character the specified number of times
# without carriage returns.
character="${1}"
number_of_times_to_print_character="${2}"
for (( current_print_number=0;
current_print_number<=${number_of_times_to_print_character};
current_print_number++ )); do
echo -n "${character}"
done
}
pp(){
# This function prints one line on the terminal. It may be used for the
# purpose of terminal output legibility. This function initially determines
# the terminal width and then prints one line of _ characters.
#
# prerequisite_functions:
#
# print_character
# terminal_dimension
number_of_lines=1
terminal_width="$(terminal_dimension "width")"
number_of_characters_to_print=$(
echo "${number_of_lines}*(${terminal_width})-1" | bc
)
print_character "_" "${number_of_characters_to_print}"
}
instate(){
# This is a quick function for installation of some object. It attempts to
# install the specified object (program, package archive etc.) on the local
# computer system. First, the system is checked for the object. If the
# object exists for the system, then the installation is aborted. If the
# object does not exist for the system, then the installation is attempted.
for current_program in "${@}"; do
# If the program exists for the system, do not attempt to install it.
echo "check for actuality of program "${current_program}""
if actuality "${current_program}"; then
echo "program actualised -- abort instatement"
else
echo "install "${current_program}""
# Attempt to install the program.
if [[ "$(text_in_lower_case "${current_program}")" == "edex-ui" ]]; then
wget https://github.com/GitSquared/edex-ui/releases/download/v2.2.8/eDEX-UI-Linux-x86_64.AppImage
chmod 755 eDEX-UI-Linux-x86_64.AppImage
./eDEX-UI-Linux-x86_64.AppImage #--no-sandbox
elif [[ "$(text_in_lower_case "${current_program}")" == "gimp-plugin-registry" ]]; then
sudo add-apt-repository -y ppa:otto-kesselgulasch/gimp
sudo apt update
time sudo apt -y install gimp-plugin-registry
elif [[ "$(text_in_lower_case "${current_program}")" == "mathics" ]]; then
time git clone https://github.com/poeschko/Mathics.git
cd Mathics
time sudo pip3 install pint
time sudo python3 setup.py install
time sudo python3 setup.py initialize
cd ../
sudo rm -rf Mathics
elif [[ "$(text_in_lower_case "${current_program}")" == "signal" ]]; then
wget -O- https://updates.signal.org/desktop/apt/keys.asc | gpg --dearmor > signal-desktop-keyring.gpg
cat signal-desktop-keyring.gpg | sudo tee -a /usr/share/keyrings/signal-desktop-keyring.gpg > /dev/null
echo 'deb [arch=amd64 signed-by=/usr/share/keyrings/signal-desktop-keyring.gpg] https://updates.signal.org/desktop/apt xenial main' | \
sudo tee -a /etc/apt/sources.list.d/signal-xenial.list
sudo apt update
time sudo apt -y install signal-desktop
elif [[ "$(text_in_lower_case "${current_program}")" == "simplescreenrecorder" ]]; then
sudo add-apt-repository -y ppa:maarten-baert/simplescreenrecorder
sudo apt update
time sudo apt -y install \
libavcodec-extra \
libavformat-extra \
pavucontrol \
simplescreenrecorder
elif [[ "$(text_in_lower_case "${current_program}")" == "virtualbox" ]]; then
wget https://download.virtualbox.org/virtualbox/7.0.22/virtualbox-7.0_7.0.22-165102~Ubuntu~noble_amd64.deb
sudo su -c 'DEBIAN_FRONTEND=noninteractive apt -y install ./virtualbox-7.0_7.0.22-165102~Ubuntu~noble_amd64.deb'
rm virtualbox-7.0_7.0.22-165102~Ubuntu~noble_amd64.deb
else
time sudo apt -y install "${current_program}"
fi
sudo apt -f install
fi
done
}
pp; note "setup_Ubuntu.sh version "${version}""
# prerequisites -------------------------------------------------------------- #
pp; note "set up prerequisites"
pp; note "set display not to dim and to blank after 15 minutes"
gsettings set org.gnome.settings-daemon.plugins.power idle-dim false
gsettings set org.gnome.desktop.session idle-delay 900
pp; note "enable volume over-amplification"
gsettings set org.gnome.desktop.sound allow-volume-above-100-percent true
pp; note "apt update"
sudo apt -y update
pp; note "install bc (Basic Calculator)"
instate bc
pp; note "install build-essential"
instate build-essential
pp; note "install Festival"
instate festival
pp; note "install Geany"
instate geany
pp; note "install Git"
instate git
pp; note "install python3-launchpadlib"
nstate python3-launchpadlib
pp; note "install Sed (Stream Editor)"
instate sed
pp; note "install SoX (Sound eXchange)"
instate sox
# Python, pip and virtualenv
pp; note "install Python"
sudo add-apt-repository -y ppa:deadsnakes/ppa
sudo apt -y update
instate python3-dev
instate python3-tk
pp; note "install and set up pip"
instate python3-pip
sudo python3 -m pip config set global.break-system-packages true
pp; note "install virtualenv"
sudo pip3 install virtualenv
pp; note "install docopt"
sudo pip3 install docopt
pp; note "install pypandoc"
sudo pip3 install pypandoc
# package management
# AppImageLauncher
#pp; note "install AppImageLauncher"
#sudo add-apt-repository -y ppa:appimagelauncher-team/stable
#sudo apt -y update
#instate appimagelauncher
# npm
pp; note "install npm"
instate npm
# Flatpak
pp; note "install Flatpak"
instate flatpak gnome-software-plugin-flatpak
sudo flatpak remote-add --if-not-exists flathub \
https://flathub.org/repo/flathub.flatpakrepo
# updates and fixes
pp; note "apt update, apt upgrade and apt fix"
time sudo apt -f install
time sudo apt -y update
time sudo apt -y upgrade
time sudo apt -f install
################################################################################
text="starting initial script interactions"
pp; note "${text}"
echo "${text}" | festival --tts &
################################################################################
pp; note "set up Ubuntu"
echo_pause "Press any key to start."
echo -e "\nPlease run this script as a non-root user and please ensure that \
the output of this script is not being redirected to a file as this is done \
by the script. In this script, there are initial interactions to advise on \
more manual steps, then the script advises when these steps are complete. \
Following this, various non-interactive installations are completed. Before \
continuing, please ensure that configuration options for the script are set \
appropriately in the function \"reload_options\"."
# security ------------------------------------------------------------------- #
# VeraCrypt
reload_options
if [ ${VeraCrypt} -eq 1 ]; then
pp; note "create veracrypt group"
sudo groupadd veracrypt
echo "add current user ("${USER}") to the group VeraCrypt"
sudo gpasswd -a "${USER}" veracrypt
pp; note "install VeraCrypt"
instate dbus-x11 libfuse2
mkdir veracrypt
cd veracrypt
wget https://launchpadlibrarian.net/289850375/veracrypt-1.19-setup.tar.bz2
tar -xvf veracrypt-1.19-setup.tar.bz2
sudo ./veracrypt-1.19-setup-console-x64
#sudo ./veracrypt-1.19-setup-gui-x64
cd ..
rm -rf veracrypt
fi
# MAC address
pp; note "install macchanger"
instate macchanger
# interfaces ----------------------------------------------------------------- #
# Indicator-SysMonitor (a system tray system monitor notification indicator)
reload_options
if [ ${Indicator_SysMonitor} -eq 1 ]; then
pp; note "install and set up Indicator-SysMonitor"
instate python3-psutil gir1.2-appindicator3-0.1
git clone https://github.com/wdbm/indicator-sysmonitor.git
cd indicator-sysmonitor
sudo make install
cd ..
rm -rf indicator-sysmonitor
nohup indicator-sysmonitor &
IFS= read -d '' text << "EOF"
|{net} |{publiccountryiso}|cpu:{cpu}/{cputemp}|m/fs:{mem}/{fs///}|
EOF
echo -e "Set Indicator-SysMonitor to run on startup (the executable is \
indicator-sysmonitor) and set the output format as appropriate. The following \
is an example:"
echo
echo_pause "${text}"
fi
# video
pp; note "install codecs"
instate libdvdnav4 libdvd-pkg gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly libdvd-pkg
# ydotool
pp; note "install and set up ydotool"
pp; instate ydotool
# grant user access to `/dev/uinput`
sudo groupadd --force input
sudo usermod -aG input "${USER}"
# create a udev rule
printf '%s\n' 'KERNEL=="uinput", MODE="0660", GROUP="input"' | \
sudo tee /etc/udev/rules.d/80-uinput.rules >/dev/null
# reload the rule and trigger it
sudo modprobe uinput
sudo udevadm control --reload-rules
sudo udevadm trigger /dev/uinput
################################################################################
text="initial script interactions complete"
pp; note "${text}"
echo "${text}" | festival --tts &
################################################################################
# security ------------------------------------------------------------------- #
# private user area
pp; note "make user home area private"
sudo chmod 750 /home/"${USER}"
# Globus
pp; note "install Globus Toolkit"
instate globus-gsi-cert-utils-progs
# disable recently-used files lists
pp; note "disable GNOME Recent Files"
gsettings set org.gnome.desktop.privacy remember-recent-files false
# Fail2Ban
pp; note "install Fail2Ban"
instate fail2ban
sudo cp /etc/fail2ban/jail.conf /etc/fail2ban/jail.local
# Apache2
pp; note "stop Apache2"
sudo systemctl stop apache2
# unattended upgrades
pp; note "enable unattended upgrades"
instate unattended-upgrades
sudo dpkg-reconfigure -pmedium unattended-upgrades
# disable GNOME tracking
pp; note "disable GNOME Tracker" # see also Activity Log Manager
# GNOME 46
# https://discourse.gnome.org/
# t/can-tracker-extract-be-disabled-in-gnome-46/20782
sudo rm /usr/share/tracker3-miners/extract-rules/*
# up to GNOME 46:
sudo systemctl --user mask \
tracker-extract-3.service \
tracker-miner-fs-3.service \
tracker-miner-rss-3.service \
tracker-writeback-3.service \
tracker-xdg-portal-3.service \
tracker-miner-fs-control-3.service
tracker3 reset -s -r
# to re-enable:
#sudo systemctl --user unmask \
# tracker-extract-3.service \
# tracker-miner-fs-3.service \
# tracker-miner-rss-3.service \
# tracker-writeback-3.service \
# tracker-xdg-portal-3.service \
# tracker-miner-fs-control-3.service
# GNOME error-reporting
pp; note "disable Apport"
sudo systemctl disable --now apport.service
sudo systemctl mask apport.service
# to re-enable:
#sudo systemctl unmask apport.service
#sudo systemctl enable apport.service
# interfaces ----------------------------------------------------------------- #
# terminal theme
pp; echo "set up terminal theme"
list_of_gsettings_schemas="$(gsettings list-relocatable-schemas | grep -i terminal)"
uuid_profile_default="$(gsettings get org.gnome.Terminal.ProfilesList default)" # returns UUID4 profile label
uuid_profile_default="${uuid_profile_default:1:-1}" # remove leading and trailing single quotes
gsettings set org.gnome.Terminal.Legacy.Profile:/org/gnome/terminal/legacy/profiles:/:${uuid_profile_default}/ scrollback-unlimited true
gsettings set org.gnome.Terminal.Legacy.Profile:/org/gnome/terminal/legacy/profiles:/:${uuid_profile_default}/ use-theme-colors false
gsettings set org.gnome.Terminal.Legacy.Profile:/org/gnome/terminal/legacy/profiles:/:${uuid_profile_default}/ foreground-color "#ffffff"
gsettings set org.gnome.Terminal.Legacy.Profile:/org/gnome/terminal/legacy/profiles:/:${uuid_profile_default}/ background-color "#000000"
gsettings set org.gnome.Terminal.Legacy.Profile:/org/gnome/terminal/legacy/profiles:/:${uuid_profile_default}/ use-transparent-background false
gsettings set org.gnome.Terminal.Legacy.Profile:/org/gnome/terminal/legacy/profiles:/:${uuid_profile_default}/ background-transparency-percent "10"
# Bash Agnoster theme with Powerline
reload_options
if [ ${theme_Bash} -eq 1 ]; then
pp; note "set up Bash Agnoster theme with Powerline"
pp; note "install Agnoster"
# install Powerline fonts
pp; note "install fonts patched for Powerline (note: https://superuser.com/a/1336614/705613)"
# install Powerline fonts for user
mkdir ~/.fonts
wget --content-disposition -N -O ~/.fonts/Monofur_for_Powerline.ttf https://raw.githubusercontent.com/powerline/fonts/master/Monofur/Monofur%20for%20Powerline.ttf
wget --content-disposition -N -O ~/.fonts/Monofur_Bold_for_Powerline.ttf https://raw.githubusercontent.com/powerline/fonts/master/Monofur/Monofur%20Bold%20for%20Powerline.ttf
wget --content-disposition -N -O ~/.fonts/Monofur_Italic_for_Powerline.ttf https://raw.githubusercontent.com/powerline/fonts/master/Monofur/Monofur%20Italic%20for%20Powerline.ttf
# install Powerline fonts for system
sudo wget --content-disposition -N -O /usr/local/share/fonts/Monofur_for_Powerline.ttf https://raw.githubusercontent.com/powerline/fonts/master/Monofur/Monofur%20for%20Powerline.ttf
sudo wget --content-disposition -N -O /usr/local/share/fonts/Monofur_Bold_for_Powerline.ttf https://raw.githubusercontent.com/powerline/fonts/master/Monofur/Monofur%20Bold%20for%20Powerline.ttf
sudo wget --content-disposition -N -O /usr/local/share/fonts/Monofur_Italic_for_Powerline.ttf https://raw.githubusercontent.com/powerline/fonts/master/Monofur/Monofur%20Italic%20for%20Powerline.ttf
gsettings set org.gnome.Terminal.Legacy.Profile:/org/gnome/terminal/legacy/profiles:/:${uuid_profile_default}/ font "monofur for Powerline bold 12"
# definition of Agnoster configuration for .bashrc
IFS= read -d '' text << "EOF"
export THEME=${HOME}/.bash/themes/agnoster-bash/agnoster.bash
if [[ -f ${THEME} ]]; then
export DEFAULT_USER="$(whoami)"
source ${THEME}
fi
EOF
mkdir -p ${HOME}/.bash/themes/agnoster-bash
git clone https://github.com/speedenator/agnoster-bash.git ${HOME}/.bash/themes/agnoster-bash
if grep -Fxq "agnoster" ~/.bashrc; then
echo "configuration found, not overwriting"
echo "${text}"
else
echo "${text}" >> ~/.bashrc
fi
fi
# fonts
pp; note "install fonts etc."
echo ttf-mscorefonts-installer msttcorefonts/accepted-mscorefonts-eula select true | sudo debconf-set-selections
instate ttf-mscorefonts-installer
pp; note "install ARandR"
instate arandr
#pp; note "install eDEX-UI"
#instate edex-ui
pp; note "install Graphical Disk Map"
instate gdmap
pp; note "install genact"
sudo snap install genact
pp; note "install Hollywood"
instate hollywood
pp; note "install Ranger"
instate ranger
pp; note "install Screen"
instate screen
pp; note "install s-tui"
sudo pip3 install s-tui --ignore-installed psutil
pp; note "install Tilix"
instate tilix
pp; note "install TUIFI Manager"
sudo pip3 install tuifimanager
pp; note "install x11-apps"
instate x11-apps
pp; note "install xcalib"
instate xcalib
pp; note "install xtrlock"
instate xtrlock
pp; note "install xvkbd"
instate xvkbd
# tmux
pp; note "install tmux"
instate tmux
wget --content-disposition -O ~/.tmux.conf \
https://raw.githubusercontent.com/wdbm/tmux_config/master/.tmux.conf
# desktop environments
pp; note "install GNOME Tweaks, shell extensions etc."
pp; instate gnome-tweaks
pp; instate gnome-shell-extensions
pp; instate chrome-gnome-shell
pp; instate gnome-shell-extension-manager
pp; instate unity-tweak-tool
pp; instate gnome-extensions-app
pp; instate gnome-shell-extension-prefs
gnome-extensions disable tiling-assistant@ubuntu.com
gnome-extensions-cli install 5829
gnome-extensions-cli install 3733
gnome-extensions-cli install 3843
gnome-extensions-cli install 1723
pp; note "enable GNOME click-to-minimize"
gsettings set org.gnome.shell.extensions.dash-to-dock click-action 'minimize'
pp; note "turn off GNOME screenshot camera sound"
sudo mv /usr/share/sounds/freedesktop/stereo/camera-shutter.oga /usr/share/sounds/freedesktop/stereo/damn-camera-shutter.oga.bak
# keyboard shortcuts
pp; note "set some keyboard shortcuts"
create_shortcut() {
local shortcut_name="${1}"
local shortcut_binding="${2}"
local shortcut_command="${3}"
local keybinding_path="/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/${shortcut_name}/"
# Fetch current custom keybindings.
current_keybindings=$(gsettings get org.gnome.settings-daemon.plugins.media-keys custom-keybindings)
# Initialize new_keybindings variable based on the current state.
if [[ "${current_keybindings}" == "@as []" ]]; then
# If the list is empty, initialise it with the new keybinding path.
new_keybindings="['${keybinding_path}']"
elif [[ "${current_keybindings}" != *"${keybinding_path}"* ]]; then
# If the keybinding does not exist, add it to the list.
new_keybindings=$(echo "${current_keybindings}" | sed "s|]$|, '${keybinding_path}']|")
else
# If the keybinding already exists, use the current list.
new_keybindings="${current_keybindings}"
fi
# Update the custom keybindings list if modified.
if [[ "${new_keybindings}" != "${current_keybindings}" ]]; then
gsettings set org.gnome.settings-daemon.plugins.media-keys custom-keybindings "${new_keybindings}"
fi
# Set the properties for the new shortcut.
gsettings set org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:"${keybinding_path}" name "${shortcut_name}"
gsettings set org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:"${keybinding_path}" binding "${shortcut_binding}"
gsettings set org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:"${keybinding_path}" command "${shortcut_command}"
}
# shortkey: xtrlock
create_shortcut \
"xtrlock" \
"<Control><Shift>l" \
"xtrlock"
# shortkey: volume up
# pactl set-sink-volume @DEFAULT_SINK@ +5%
create_shortcut \
"volume_up" \
"<Control><Shift>Page_Up" \
"pactl set-sink-volume @DEFAULT_SINK@ +5%"
# shortkey: volume down
# pactl set-sink-volume @DEFAULT_SINK@ -5%
create_shortcut \
"volume_down" \
"<Control><Shift>Page_Down" \
"pactl set-sink-volume @DEFAULT_SINK@ -5%"
# shortkey: type datetime
# X11:
# bash -c 'sleep 0.1; xvkbd -text "$(date "+%Y-%m-%dT%H%MZ" --utc)" 2>/dev/null'
# Wayland:
# bash -c 'sleep 0.2; ydotool type "$(date "+%Y-%m-%dT%H%MZ" --utc)"'
case "${XDG_SESSION_TYPE}" in
wayland)
create_shortcut "type_datetime" \
"<Control><Shift>d" \
"bash -c 'sleep 0.2; ydotool type \"\$(date \"+%Y-%m-%dT%H%MZ\" --utc)\"'"
;;
x11)
create_shortcut "type_datetime" \
"<Control><Shift>d" \
"bash -c 'sleep 0.1; xvkbd -text \"\$(date \"+%Y-%m-%dT%H%MZ\" --utc)\" 2>/dev/null'"
;;
esac
## shortkey: copy datetime
## bash -c "(date "+%Y-%m-%dT%H%MZ" --utc) | xclip -selection c"
#create_shortcut \
# "copy_datetime" \
# "<Control><Shift>t" \
# "bash -c '(date \"+%Y-%m-%dT%H%MZ\" --utc) | xclip -selection c'"
# editors, coding, typesetting ----------------------------------------------- #
pp; note "install gedit"
instate gedit
pp; note "install LibreOffice"
instate libreoffice
pp; note "install Kate"
instate kate
pp; note "install Kompare"
instate kompare
# Calibre
pp; note "install Calibre"
instate calibre
# Geany
pp; note "install enscript"
instate enscript
pp; note "install Geany"
instate geany
pp; note "install highlight"
instate highlight
# LaTeX
reload_options
if [ ${LaTeX} -eq 1 ]; then
pp; note "install LaTeX"
instate pdflatex
instate texlive-full
instate texlive-latex-extra
instate texlive-fonts-recommended
instate texlive-fonts-extra
instate texlive-metapost
instate texworks
instate texinfo
instate texi2html
fi
# Mini Text
pp; note "install Mini-Text"
sudo snap install mini-text
# Nice Editor
pp; note "install Nice Editor"
instate ne
# Pandoc
pp; note "install Pandoc"
instate pandoc
pp; note "install PDFtk"
instate pdftk
sudo snap install pdftk
pp; note "install pdftotext"
instate pdftotext
# Typora
sudo mkdir -p /etc/apt/keyrings
curl -fsSL https://downloads.typora.io/typora.gpg | sudo tee /etc/apt/keyrings/typora.gpg > /dev/null
echo "deb [signed-by=/etc/apt/keyrings/typora.gpg] https://downloads.typora.io/linux ./" | sudo tee /etc/apt/sources.list.d/typora.list
sudo apt update
instate typora
# Xournal
#pp; note "install Xournal"
#instate xournal
# Xournal++
pp; note "install Xournal++"
sudo snap install xournalpp
# Python packages
pp; note "install some Python packages"
sudo pip3 install dataset
sudo pip3 install ttkthemes
# networking and communications ---------------------------------------------- #
# upcoming: separate:
IFS= read -d '' text << "EOF"
# Allow users of the group airvpn to run AirVPN as root.
%airvpn ALL=(root) NOPASSWD:/usr/bin/eddie-ui
# Allow users of the group OpenVPN to run openvpn as root.
%openvpn ALL=(root) NOPASSWD:/usr/sbin/openvpn
# Allow users of the group veracrypt to run VeraCrypt as root.
%veracrypt ALL=(root) NOPASSWD:/usr/bin/veracrypt
EOF
if sudo grep -q "veracrypt" /etc/sudoers; then
echo "The string 'veracrypt' was found in /etc/sudoers, so the file is" \
" not to be modified."
else
echo "The string 'veracrypt' was not found in /etc/sudoers, so the file" \
" is to be modified to include the following text:"
echo "${text}"
echo "${text}" | sudo tee -a /etc/sudoers
fi
# OpenVPN
pp; note "create openvpn group"
sudo groupadd openvpn
sudo gpasswd -a "${USER}" openvpn
echo "add current user ("${USER}") to the group openvpn"
# AirVPN
reload_options
if [ ${AirVPN} -eq 1 ]; then
pp; note "create airvpn group"
sudo groupadd airvpn
echo "add current user ("${USER}") to the group airvpn"
sudo gpasswd -a "${USER}" airvpn
# apt-key deprecated:
#wget -qO - https://eddie.website/repository/keys/eddie_maintainer_gpg.key | sudo apt-key add -
#sudo add-apt-repository -y "deb http://eddie.website/repository/apt stable main"
#echo "deb [signed-by=/usr/share/keyrings/eddie.website-keyring.asc] http://eddie.website/repository/apt stable main" | sudo tee /etc/apt/sources.list.d/eddie.website.list
curl -fsSL https://eddie.website/repository/keys/eddie_maintainer_gpg.key | sudo tee /usr/share/keyrings/eddie.website-keyring.asc > /dev/null
echo "deb [signed-by=/usr/share/keyrings/eddie.website-keyring.asc] http://eddie.website/repository/apt stable main" | sudo tee /etc/apt/sources.list.d/eddie.website.list
sudo apt update
pp; note "install Eddie"
instate eddie-ui
instate eddie-cli
# Edit the file /usr/share/polkit-1/actions/org.airvpn.eddie.ui.elevated.policy,
# changing "auth_admin" to "yes".
sudo sed -i 's/auth_admin/yes/g' /usr/share/polkit-1/actions/org.airvpn.eddie.ui.elevated.policy
fi
# proxy server
instate sshuttle
# Mattermost
reload_options
if [ ${Mattermost} -eq 1 ]; then
pp; note "install Mattermost"
curl -fsS -o- https://deb.packages.mattermost.com/setup-repo.sh | sudo bash
instate mattermost-desktop
fi
# Signal
pp; note "install Signal"
instate signal-desktop
# Telegram
reload_options
if [ ${Telegram} -eq 1 ]; then
pp; note "install Telegram"
sudo snap install telegram-desktop
fi
# torrenting
pp; note install "Transmission"
sudo snap install transmission
pp; note "install transmission-cli"
instate transmission-cli
pp; note "install net-tools"
instate net-tools
# SSH
pp; note "install OpenSSH Server"
instate openssh-server
# SSH client
pp; note "add SSH configurations to keep connections alive"
IFS= read -d '' text << "EOF"
TCPKeepAlive yes
ExitOnForwardFailure yes
ServerAliveInterval 60
Protocol 2,1
EOF
if grep -Fxq "ServerAliveInterval" /etc/ssh/ssh_config; then
echo "configuration found, not overwriting"
else
echo "${text}" | sudo tee -a /etc/ssh/ssh_config
fi
# SSH server
IFS= read -d '' text << "EOF"
ClientAliveInterval 60
EOF
if grep -Fxq "ClientAliveInterval" /etc/ssh/sshd_config; then
echo "configuration found, not overwriting"
else
echo "${text}" | sudo tee -a /etc/ssh/sshd_config
fi
# SSH Filesystem
pp; note "install SSH Filesystem"
pp; instate sshfs
# VNC
pp; note "install VPN infrastructure"
pp; instate xtightvncviewer #vncviewer
pp; instate tightvncserver #vnc4server
pp; instate vpnc
# system, monitoring, management and utilities ------------------------------- #
# GRUB
pp; note "set up GRUB, enabling terminal output on boot"
sudo sed -i 's/GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"/GRUB_CMDLINE_LINUX_DEFAULT="text"/' /etc/default/grub
sudo update-grub
# sudo timeout and root privileges for programs
pp; note "set up sudoer sudo environment reset timeout and sudoer permissions"
if sudo grep -q "timestamp_timeout" /etc/sudoers; then
echo "The string 'timestamp_timeout' was found in /etc/sudoers, so the"\
"file is not to be modified."
else
echo "The string 'timestamp_timeout' was not found in /etc/sudoers, so"\
"the file is be modified to include timestamp_timeout=120."
sudo sed -i 's/Defaults\s\+env_reset/Defaults env_reset, timestamp_timeout=120/' /etc/sudoers
fi
# hibernation
pp; note "set up hibernation";
IFS= read -d '' text << "EOF"
[Re-enable hibernate by default in upower]
Identity=unix-user:*
Action=org.freedesktop.upower.hibernate
ResultActive=yes
[Re-enable hibernate by default in logind]
Identity=unix-user:*
Action=org.freedesktop.login1.hibernate
ResultActive=yes
EOF
echo "${text}" \
| sudo tee \
/etc/polkit-1/localauthority/50-local.d/com.ubuntu.enable-hibernate.pkla
pp; note "install Dynamic Kernel Module Support"
instate dkms
pp; note "install ubuntu-restricted-extras"
instate ubuntu-restricted-extras
pp; note "install pulseaudio-utils"
instate pulseaudio-utils
pp; note "install ACPI"
instate acpi
pp; note "install and set up TLP"
instate tlp
sudo systemctl enable tlp.service
pp; note "install atool"
instate atool
pp; note "install GdMap"
instate gdmap
pp; note "install GParted"
instate gparted
pp; note "install htop"
instate htop
pp; note "install iftop"
instate iftop
pp; note "install Pipe Viewer"
instate pv
pp; note "install NetHogs"
instate nethogs
pp; note "install realpath"
instate realpath
pp; note "install sockstat"
instate sockstat
pp; note "install TkCVS"
instate tkcvs
pp; note "install tree"
instate tree
pp; note "install unrar-free"
instate unrar-free
# GPU
if [ ${GPU} -eq 1 ]; then
pp; note "install nvtop"
git clone https://github.com/Syllo/nvtop.git
mkdir -p nvtop/build && cd nvtop/build
cmake ..
make
sudo make install
cd ../..
rm -rf nvtop
cd
fi
# DOSBox
pp; note "install DOSBox"
instate dosbox
# VirtualBox
reload_options
if [ ${VirtualBox} -eq 1 ]; then
pp; note "install VirtualBox"
instate virtualbox
fi
# Wine
reload_options
if [ ${Wine} -eq 1 ]; then
pp; note "install Wine"
#instate wine-development
instate wine
fi
# browsers etc. -------------------------------------------------------------- #
pp; note "install Chromium"
instate chromium-browser
pp; note "install cURL"
instate curl
pp; note "install ELinks"
instate elinks
pp; note "install Tor"
instate tor
instate torbrowser-launcher
# media ---------------------------------------------------------------------- #
# text
# PDF
pp; note "install Okular"; instate okular
# RSS
pp; note "install Fluent Reader"
sudo snap install fluent-reader --candidate
# sound
pp; note "install Audacious"; instate audacious
pp; note "install Audacity"; instate audacity
pp; note "install cmus"; instate cmus
pp; note "install faad"; instate faad
pp; note "install FFmpreg"; instate ffmpeg
pp; note "install LAME"; instate lame
pp; note "install libsox-fmt-all"; instate libsox-fmt-all
pp; note "install libtheora-dev"; instate libtheora-dev
pp; note "install Pico-TTS"; instate libttspico0 libttspico-utils libttspico-data
pp; note "install lingot"; instate lingot
pp; note "install mediainfo"; instate mediainfo
pp; note "install MPlayer"; instate mplayer
pp; note "install PulseAudio Volume Control"; instate pavucontrol
# Audio Recorder
pp; echo "instate Audio Recorder"
wget https://raw.githubusercontent.com/wdbm/media_editing/master/setup/audio-recorder/audio-recorder_1.7-5%7Exenial_amd64.deb
sudo apt -y install ./audio-recorder_1.7-5~xenial_amd64.deb
rm audio-recorder_1.7-5~xenial_amd64.deb
# Rhythmbox
pp; note "remove Rhythmbox"
sudo apt -y remove rhythmbox
# image
pp; note "install ASCII Draw"
sudo snap install ascii-draw
pp; note "install Colour ASCII Art Library"
instate caca-utils
pp; note "install Python character encoding detector"
sudo pip3 install chardet
pp; note "install ExifTool"
instate exiftool
pp; note "install FIGlet"
instate figlet
pp; note "install Hugin"
flatpak install -y flathub net.sourceforge.Hugin
pp; note "install ImageMagick"
instate imagemagick
pp; note "install img2pdf"
instate img2pdf
pp; note "install Inkspace"
instate inkscape
pp; note "install gallery-dl"
sudo pip3 install gallery-dl
pp; note "install GIMP with GIMP plugin registry"
pp; instate gimp
pp; instate gimp-plugin-registry
pp; note "install GNOME Screenshot"
instate gnome-screenshot
pp; note "install Graphviz"
instate graphviz