/
welcome
executable file
·1712 lines (1473 loc) · 62.5 KB
/
welcome
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
#
# Welcome: the EndeavourOS greeter.
#
# Shows useful basic info about the EndeavourOS and its usage.
# Targeted for people new to EndeavourOS (but not new to Linux).
#
# TODO:
# - add icons to buttons once proper supported exists in yad
export PROGNAME=eos-welcome
export PRETTY_PROGNAME="Welcome"
EOS_SCRIPTS_DIR=/usr/share/endeavouros/scripts
translations_dir=$EOS_SCRIPTS_DIR # used also by the translation.bash !!
source $translations_dir/translations.bash
#################################################################################
EOS_SCRIPTS_YAD=$EOS_SCRIPTS_DIR/eos-script-lib-yad
test -r $EOS_SCRIPTS_YAD || {
echo "ERROR: cannot find $EOS_SCRIPTS_YAD" >&2
exit 1
}
source $EOS_SCRIPTS_YAD
unset EOS_SCRIPTS_YAD
export -f eos_yad
export -f eos_yad_terminal
export -f eos_yad_check_internet_connection
export -f eos_yad_GetArgVal
export -f eos_yad_RunCmdTermBash
export -f eos_yad_problem
export -f eos_yad_DIE
export -f eos_yad_WARN
export -f eos_yad__detectDE
export -f eos_yad_GetDesktopName
export -f eos_GetArch
export -f eos_select_browser
export -f eos_yad_nothing_todo
#################################################################################
export PROG_PACKAGENAME="welcome"
export INSTALLER_PROGRAM=/usr/bin/calamares
export EOS_LIVEUSER=liveuser
export EOS_KEEP_PKGS
export PROG_VERSION="$(/usr/bin/pacman -Q $PROG_PACKAGENAME | awk '{print $2}')"
export INSTALL_LOG_FILE=/home/$EOS_LIVEUSER/endeavour-install.log
AfterTranslations() {
# Here we have definitions that require special treatment because of
# yad running in other processes...
export WH_BUTT_TITLE="$(ltr help_butt_title)"
export WH_BUTT_TEXT="$(ltr help_butt_text)"
export CAL_NOAVAIL="$(ltr cal_noavail)"
export CAL_WARN="$(ltr cal_warn)"
export CAL_INFO1="$(ltr cal_info1)"
export CAL_INFO2="$(ltr cal_info2)"
export CAL_INFO3="$(ltr cal_info3)"
export CAL_INFO4="$(ltr cal_info4)"
export CAL_CHOOSE="$(ltr cal_choose)"
export CAL_METHOD="$(ltr cal_method)"
export CAL_NOSUPPORT="$(ltr cal_nosupport)"
export CAL_NOFILE="$(ltr cal_nofile)"
export CAL_ISTARTED="$(ltr cal_istarted)"
export CAL_ISTOPPED="$(ltr cal_istopped)"
export ISSUES_TITLE="$(ltr issues_title)"
export ISSUES_FRUB="$(ltr issues_grub)"
export ISSUES_RUN="$(ltr issues_run)"
export ISSUES_NO="$(ltr issues_no)"
export SYSUP_NO="$(ltr sysup_no)"
export SYSUP_CHECK="$(ltr sysup_check)"
export INSTALL_INSTALLER="$(ltr install_installer)"
export INSTALL_ALREADY="$(ltr install_already)"
export INSTALL_ING="$(ltr install_ing)"
export INSTALL_DONE="$(ltr install_done)"
export DM_TITLE="$(ltr dm_title)"
export DM_COL_NAME1="$(ltr dm_col_name1)"
export DM_COL_NAME2="$(ltr dm_col_name2)"
export DM_REBOOT_REQUIRED="$(ltr dm_reboot_required)"
export DM_CHANGED="$(ltr dm_changed)"
export DM_FAILED="$(ltr dm_failed)"
export DM_WARNING_TITLE="$(ltr dm_warning_title)"
export AFTER_INSTALL_US="$(ltr after_install_us)"
export AFTER_INSTALL_US_FROM="$(ltr after_install_us_from)"
export AFTER_INSTALL_US_EL="$(ltr after_install_us_el)"
export AFTER_INSTALL_US_DONE="$(ltr after_install_us_done)"
export AFTER_INSTALL_US_FAIL="$(ltr after_install_us_fail)"
export UPDT_NOTHING_TODO="$(ltr updt_nothing_todo)"
export UPDT_UPDATE_CHECK="$(ltr updt_update_check):"
}
IsInstalled() { /usr/bin/pacman -Q "$1" >& /dev/null ; }
export -f IsInstalled
IsInstalling() {
test "$show_installer" = "yes" && return 0
test -x $INSTALLER_PROGRAM && test "$LOGNAME" = "$EOS_LIVEUSER"
}
export -f IsInstalling
yad_tailer() {
local file="$1"
tail -f "$file" | \
eos_yad --text-info --title="$(basename "$file")" \
--button=" $(ltr tail_butt)!dialog-close!$(ltr tail_buttip)":0 \
--width=$width --height=$height --tail --wrap --posx=$posx --posy=$posy \
>& /dev/null &
}
export -f yad_tailer
eos_yad_WARN_debug() {
test "$debugging" = "yes" && eos_yad_WARN "$1"
}
export -f eos_yad_WARN_debug
Welog() {
[ -d /home/$EOS_LIVEUSER ] && echo "$PROGNAME: " "$@" >> $INSTALL_LOG_FILE
}
export -f Welog
yad_Install() {
# Install one or more given packages. Does not reinstall any packages.
local yadcmd=(
eos_yad --text-info --width=600 --height=500 --title="$INSTALL_INSTALLER" --wrap --tail --button=yad-quit:0 --fontname="Mono 10"
)
local pkg pkgs=()
for pkg in "$@" ; do
case "$pkg" in
*/*) pkgs+=("$pkg") ;; # $repo/$pkg: force install
*) IsInstalled "$pkg" >& /dev/null || pkgs+=("$pkg") ;;
esac
done
test -z "$pkgs" && {
echo "$*: $INSTALL_ALREADY" | "${yadcmd[@]}"
return
}
while true ; do
echo "$INSTALL_ING ${pkgs[*]} ..."
pkexec pacman -S --noconfirm "${pkgs[@]}"
echo "$INSTALL_DONE"
break
done |& "${yadcmd[@]}"
}
export -f yad_Install
yad_Remove() {
# Remove one or more given packages.
# TODO: translate these!
local REMOVER="Remover"
local REMOVING="Removing"
local NOT_INSTALLED="not installed"
local yadcmd=(
eos_yad --text-info --title="$REMOVER" --wrap --tail --width=600 --height=500 --button=yad-quit:0 --fontname="Mono 10"
)
local pkg pkgs=()
for pkg in "$@" ; do
IsInstalled "$pkg" >& /dev/null && pkgs+=("$pkg")
done
test -z "$pkgs" && {
echo "$*: $NOT_INSTALLED" | "${yadcmd[@]}"
return
}
while true ; do
echo "$REMOVING ${pkgs[*]} ..."
pkexec pacman -Rdd --noconfirm "${pkgs[@]}"
echo "$INSTALL_DONE"
break
done |& "${yadcmd[@]}"
}
export -f yad_Remove
yad_GetCurrentDM() {
local current=$(ls -l /etc/systemd/system/display-manager.service | awk '{print $NF}')
current="$(basename $current .service)"
echo "$current"
}
export -f yad_GetCurrentDM
yad_ChangeDisplayManager() {
local cmd count
local dmlist="" dm
local dms=(gdm lightdm lxdm sddm)
local current=$(yad_GetCurrentDM)
count="${#dms[@]}"
cmd=(eos_yad --list --radiolist --title="$DM_TITLE" --width=300 --height=200)
cmd+=(--column="$DM_COL_NAME1":rd --column="$DM_COL_NAME2")
for ((ix=0; ix<count; ix++)) ; do
dm="${dms[$ix]}"
case "$dm" in
$current) cmd+=(true "$dm") ;;
*) cmd+=(false "$dm") ;;
esac
done
# selected new dm
dm="$("${cmd[@]}" | cut -d '|' -f 2)"
case "$dm" in
"$current" | "") return ;;
esac
cmd=""
IsInstalled "$dm" >& /dev/null || {
case "$dm" in
lightdm) cmd+="pacman -S ${dm}{,-gtk-greeter{,-settings}} --noconfirm >& /dev/null && ";;
*) cmd+="pacman -S $dm --noconfirm >& /dev/null && " ;;
esac
}
cmd+="systemctl disable $current && systemctl enable $dm"
pkexec bash -c "$cmd"
if [ "$(yad_GetCurrentDM)" = "$dm" ] ; then
echo "$DM_REBOOT_REQUIRED" | \
eos_yad --text-info --title="$DM_CHANGED $dm" --wrap --width=300 --height=200 --button=yad-quit:0
else
echo "$DM_FAILED" | \
eos_yad --text-info --title="$DM_WARNING_TITLE" --width=300 --height=200 --button=yad-quit:0
fi
}
export -f yad_ChangeDisplayManager
yad_vanilla_xfce4_theme() {
local log="$HOME/.config/EOS-xfce-theme.log"
local DE="$(eos_yad_GetDesktopName)"
local new_theme_name="vanilla"
case "$DE" in
XFCE)
local conf="$HOME/.config/xfce4"
local datetime="$(date '+%Y%m%d-%H:%M:%S')"
local msg="If you agree to change Xfce theme to $new_theme_name, your previous theme\nwill be saved into folder <b>$conf.$datetime</b>\n\n"
msg+="To restore the previous theme:\n - remove folder <b>$conf</b>\n - rename <b>$conf.$datetime</b> into <b>$conf</b>\n\n"
msg+="(Note: this info is stored into file $log).\n\n"
msg+="Reboot is required for the theme change to take effect.\n\nAccept theme change and reboot now?"
printf "%s\n" "$msg" | sed -e 's|\\n|\n|g' -e 's|<[/]*b>||g' > "$log"
eos_yad --form --title="Change Xfce theme to $new_theme_name" --text="$msg" --image=$WELCOME_ICON_XFCE_THEME_VANILLA \
--button='yad-cancel!!Do nothing':1 --button='yad-ok!!Accept theme change and reboot now':0
case "$?" in
0) mv $conf $conf.$datetime ; reboot ;;
esac
;;
*) echo "Sorry $DE user, only Xfce is supported." > "$log"
;;
esac
}
export -f yad_vanilla_xfce4_theme
yad_endeavouros_xfce4_theme() {
local log2='$HOME/.config/EOS-xfce-theme.log'
local log="$(eval echo $log2)"
local DE="$(eos_yad_GetDesktopName)"
local new_theme_name="EndeavourOS default"
case "$DE" in
XFCE)
local conf="$HOME/.config/xfce4"
local conf2='$HOME/.config/xfce4'
local datetime="$(date '+%Y%m%d-%H:%M:%S')"
local msg="If you agree to change Xfce theme to $new_theme_name, your previous theme\nwill be saved into folder <b>$conf2.$datetime</b>\n\n"
msg+="To restore the previous theme:\n - remove folder <b>$conf2</b>\n - rename <b>$conf2.$datetime</b> into <b>$conf2</b>\n\n"
msg+="(Note: this info is stored into file $log2).\n\n"
msg+="Reboot is required for the theme change to take effect.\n\nAccept theme change and reboot now?"
printf "%s\n" "$msg" | sed -e 's|\\n|\n|g' -e 's|<[/]*b>||g' > "$log"
eos_yad --form --title="Change Xfce theme to $new_theme_name" --text="$msg" --image=$WELCOME_ICON_XFCE_THEME_EOS \
--button='yad-cancel!!Do nothing':1 --button='yad-ok!!Accept theme change and reboot now':0
case "$?" in
0)
# Backup old xfce4 configuration.
mv $conf $conf.$datetime
# Fetch the EndeavourOS default Xfce theme from github.
local tmpdir=$(mktemp -d)
pushd $tmpdir >/dev/null
if [ 1 -eq 1 ] ; then
git clone $(Github2Gitlab https://github.com/endeavouros-team/endeavouros-xfce4-theming.git) 2>/dev/null || {
popd >/dev/null
rm -rf $tmpdir
return 1
}
local pkgs2=$(cat endeavouros-xfce4-theming/xfce4-packages-list)
local pkg pkg2 group_members pkgs=""
for pkg in $pkgs2 ; do
pacman -Qq $pkg >& /dev/null && continue
if pacman -Si $pkg >& /dev/null ; then
pkgs+=" $pkg"
else
group_members="$(pacman -Sqg $pkg)" # find group members
for pkg2 in $group_members ; do
pacman -Qq $pkg2 >& /dev/null && continue
pkgs+=" $pkg2"
done
fi
done
if [ -n "$pkgs" ] ; then
pkgs="${pkgs:1}"
RunInTerminal "echo 'pacman -S $pkgs' ; $EOS_ROOTER 'pacman -S $pkgs'"
fi
dbus-launch dconf load / < endeavouros-xfce4-theming/xed.dconf
mv endeavouros-xfce4-theming/.config/xfce4 "$(dirname "$conf")"
mv endeavouros-xfce4-theming/.config/gtk-3.0 "$(dirname "$conf")"
else
# the old way
git clone $(Github2Gitlab https://github.com/endeavouros-team/EndeavourOS-iso-next.git) 2>/dev/null
mv EndeavourOS-iso-next/airootfs/etc/skel/.config/xfce4 "$(dirname "$conf")"
mv EndeavourOS-iso-next/airootfs/etc/skel/.config/gtk-3.0 "$(dirname "$conf")"
fi
popd >/dev/null
rm -rf $tmpdir
/usr/share/endeavouros/scripts/wallpaper-once -rr # allows default wallpaper question after reboot
reboot
;;
esac
;;
*) echo "Sorry $DE user, only Xfce is supported." > "$log"
;;
esac
}
export -f yad_endeavouros_xfce4_theme
WelcomeDevelConf() {
# Supported config file variables, defaults, and supported values:
# local _show_change_reso=no # yes or no
#
local varname="$1"
local fallback="$2"
test -n "$fallback" || {
echo "Error: ${FUNCNAME[1]} calling ${FUNCNAME[0]}: must give two parameters!" >&2
return 1
}
# echo "$fallback" ; return
local devconf="$HOME/.config/welcome-devel.conf"
local answer="$fallback"
if [ -r "$devconf" ] ; then
source "$devconf"
answer="${!varname}"
test -n "$answer" || answer="$fallback"
fi
echo "$answer"
}
export -f WelcomeDevelConf
ShowChangeResoButton() {
# Allow showing a button for changing the display resolution?
[ -x /usr/bin/xrandr ] || return
local show_reso_butt="$(WelcomeDevelConf _show_change_reso no)"
if [ "$show_reso_butt" = "no" ] ; then
case "$(device-info --vm)" in
virtualbox | qemu | kvm | vmware)
show_reso_butt=yes ;; # in a VM always show the button
esac
fi
if [ -x $INSTALLER_PROGRAM ] || [ "$LOGNAME" = "$EOS_LIVEUSER" ] || [ "$show_installer" = "yes" ] ; then
show_reso_butt=yes # show the button if installing
fi
if [ "$show_reso_butt" = "yes" ] ; then
tabcontents+=(--field=" $(ltr ins_reso)!$WELCOME_ICON_CHANGE_RESOLUTION!$(ltr ins_resotip)":fbtn ChangeDisplayResolution)
fi
}
export -f ShowChangeResoButton
INSTALL() {
local handle="$1"
local tabnum="$2"
local _exclamation='!' # '!'
local btdoc="https://discovery.endeavouros.com/bluetooth/bluetooth/2021/03"
local INSTALLER_BROWSER=firefox
local tabcontents=(
eos_yad --align-buttons --use-interp
--plug="$handle" --tabnum="$tabnum" --form --columns=2
--image=$WELCOME_ICON_INSTALL_OFFICIAL # $WELCOME_ICON_INSTALL_TAB
--text="<b>$(ltr ins_text)</b>" --text-align=left
--field=" $(ltr ins_start)!$WELCOME_ICON_INSTALL_OFFICIAL!$(ltr ins_starttip)":fbtn "eos-install-mode-run-calamares '$lang' ''"
--field=" $(ltr install_community)!$WELCOME_ICON_INSTALL_COMMUNITY!$(ltr install_community_tip)":fbtn "eos-install-mode-run-calamares '$lang' community"
--field=" EndeavourOS ARM Image Installer!calamares!Start installing EndeavourOS ARM edition":fbtn "arm-eos-welcome-installer"
--field=" $(ltr ins_custom)!$WELCOME_ICON_INSTALLATION_TIPS!$(ltr ins_custom_tip)":fbtn "$INSTALLER_BROWSER 'https://discovery.endeavouros.com/installation/customizing-the-endeavouros-install-process/2022/03'"
--field=" $(ltr after_install_um)!$WELCOME_ICON_MIRROR_UPDATE!$(ltr after_install_umtip)":fbtn reflector-simple
)
ShowChangeResoButton
tabcontents+=(
--field=" $(ltr ins_pm)!$WELCOME_ICON_PARTITION_MANAGER!$(ltr ins_pmtip)":fbtn 'gparted'
)
if eos-connection-checker ; then
tabcontents+=(
--field=" $(ltr ins_blue_notes)!$WELCOME_ICON_BLUETOOTH_INFO!$(ltr ins_blue_notes_tip)":fbtn "$INSTALLER_BROWSER '$btdoc'"
)
fi
tabcontents+=(
--field=" $(ltr ins_rel)!$WELCOME_ICON_LATEST_RELEASE!$(ltr ins_reltip)":fbtn "$INSTALLER_BROWSER https://endeavouros.com/latest-release"
--field=" $(ltr ins_tips)!$WELCOME_ICON_INSTALLATION_TIPS!$(ltr ins_tipstip)":fbtn "$INSTALLER_BROWSER https://discovery.endeavouros.com/category/installation"
# --field=" $(ltr ins_trouble)!$WELCOME_ICON_SYSTEM_RESCUE!$(ltr ins_troubletip)":fbtn "$INSTALLER_BROWSER https://discovery.endeavouros.com/category/system-rescue"
--field=" $(ltr ins_syslog)!$WELCOME_ICON_SYSTEM_LOGS_HOWTO!$(ltr ins_syslogtip)":fbtn "$INSTALLER_BROWSER https://discovery.endeavouros.com/forum-log-tool-options/how-to-include-systemlogs-in-your-post"
# --field=" $(ltr ins_logtool)!$WELCOME_ICON_SYSTEM_LOGS!$(ltr ins_logtooltip)":fbtn "eos-log-tool"
)
[ "$handle" != "calculate" ] && "${tabcontents[@]}" >& /dev/null &
}
GeneralInfo() {
local handle="$1"
local tabnum="$2"
local tabcontents=(
eos_yad --align-buttons
--plug="$handle" --tabnum="$tabnum" --form --columns=2
--image=$WELCOME_ICON_QUESTION
--text="<b>$(ltr general_info_text)</b>" --text-align=left
--field=" $(ltr general_info_ws)!$WELCOME_ICON_WEBSITE!https://endeavouros.com":fbtn "$_WELCOME_BROWSER https://endeavouros.com"
--field=" $(ltr general_info_wi)!$WELCOME_ICON_WIKI!$(ltr general_info_witip)":fbtn "$_WELCOME_BROWSER https://discovery.endeavouros.com"
--field=" $(ltr general_info_ne)!$WELCOME_ICON_NEWS!$(ltr general_info_netip)":fbtn "$_WELCOME_BROWSER https://endeavouros.com/news"
--field=" $(ltr general_info_fo)!$WELCOME_ICON_FORUM!$(ltr general_info_fotip)":fbtn "$_WELCOME_BROWSER https://forum.endeavouros.com"
--field=" $(ltr general_info_do)!$WELCOME_ICON_DONATE!$(ltr general_info_dotip)":fbtn "$_WELCOME_BROWSER https://endeavouros.com/donate"
--field=" $(ltr general_info_ab)!$WELCOME_ICON_ABOUT_WELCOME!$(ltr general_info_abtip)":fbtn "$_WELCOME_BROWSER https://discovery.endeavouros.com/endeavouros-tools/welcome"
)
[ "$handle" != "calculate" ] && "${tabcontents[@]}" >& /dev/null &
}
w_WARN() {
local msg="$1"
shift
eos_yad_WARN "$PRETTY_PROGNAME: ${FUNCNAME[1]}: $msg" --height=200 --width=500 "$@"
}
export -f w_WARN
RunIfInstalled() {
# Usage: $FUNCNAME -a="app" [-p="pkg"] [app-parameters]
local app="" pkg=""
local opt
while [ -n "$1" ] ; do
opt="$1"
case "$opt" in
-a=*) app="${opt#*=}" ; shift ;;
-p=*) pkg="${opt#*=}" ; shift ;;
-*) w_WARN "unsupported option '$opt'" --text="Option unsupported" ; return 1 ;;
*) break ;;
esac
done
if [ -z "$app" ] ; then
w_WARN "app parameter (required) is empty" --text="Application name is empty"
return 1
fi
if [ -z "$(which "$app" 2> /dev/null)" ] ; then
if [ -n "$pkg" ] ; then
w_WARN "app '$app' (from package '$pkg') not found" --text="Application not installed" --width=600
else
w_WARN "app '$app' not found" --text="Application not installed"
fi
return 1
fi
"$app" "$@"
}
export -f RunIfInstalled
if [ 0 -eq 1 ] ; then
NothingToDo_other() {
local text="$1"
local timeout="$2"
local sleep=$(echo "scale=3; $timeout*2/100" | bc -l)
local ix
for ((ix=0; ix<=100; ix+=2)) ; do
echo $ix
sleep 0.1
done | eos_yad --progress --auto-close --width=200 --text="$text" --title="Info" --hide-text
}
export -f NothingToDo_other
fi
UpdateWithAurHelper() {
local helper="$1"
local opts="-Syu --nocombinedupgrade" # first pacman update, then AUR update
declare -A has_updates
local updates=""
echo "$UPDT_UPDATE_CHECK"
# check AUR updates
updates="$($helper -Qua)"
if [ -n "$updates" ] ; then
has_updates[aur]=yes
else
has_updates[aur]=no
fi
# if no AUR updates, check pacman updates
if [ "${has_updates[aur]}" = "no" ] ; then
checkupdates > /dev/null
case "$?" in
0) has_updates[main]=yes ;;
1) return 1 ;; # an error!
2) has_updates[main]=no ;;
esac
fi
[ "${has_updates[main]}" = "yes" ] && echo "Official updates available."
[ "${has_updates[aur]}" = "yes" ] && echo "AUR updates available."
if [ "${has_updates[main]}" = "yes" ] || [ "${has_updates[aur]}" = "yes" ] ; then
echo "\$ $helper $opts"
$helper $opts
else
echo "$UPDT_NOTHING_TODO"
fi
}
export -f UpdateWithAurHelper
AfterInstall() {
local handle="$1"
local tabnum="$2"
local _exclamation='!' # '!'
local _and='&' # '&'
local _question='?' # '?'
local tabcontents=(
eos_yad --align-buttons
--use-interp # don't need explicit 'bash -c' construct when calling functions
--plug="$handle" --tabnum="$tabnum" --form --image=$WELCOME_ICON_INFO
--text="<b>$(ltr after_install_text)</b>" --columns=2
)
if [ "$(eos_GetArch)" != "armv7h" ] ; then
tabcontents+=(
--field=" $(ltr after_install_um)!$WELCOME_ICON_MIRROR_UPDATE!$(ltr after_install_umtip)":fbtn "RunIfInstalled -a=reflector-simple"
)
fi
tabcontents+=(
--field=" $(ltr after_install_us)!$WELCOME_ICON_SYSTEM_UPDATE!$(ltr after_install_ustip)":fbtn "RunInTerminal UpdateInTerminal --lang=$lang"
--field=" $(ltr after_install_pclean)!$WELCOME_ICON_PACCACHE_SRV!$(ltr after_install_pcleantip)":fbtn 'paccache-service-manager'
)
if [ -x /usr/bin/eos-update-notifier-configure ] ; then
tabcontents+=(--field=" $(ltr after_install_conf) eos-update-notifier!$WELCOME_ICON_UPDATE_NOTIFIER_CONF!$(ltr after_install_conf) eos-update-notifier":fbtn "eos-update-notifier-configure")
fi
if [ "$(eos_GetArch)" != "armv7h" ] ; then
tabcontents+=(--field=" $(ltr after_install_cdm)!$WELCOME_ICON_CHANGE_DISPLAY_MANAGER!$(ltr after_install_cdmtip)":fbtn 'yad_ChangeDisplayManager')
fi
ShowChangeResoButton
tabcontents+=(
--field=" $(ltr after_install_ew)!$WELCOME_ICON_WALLPAPER_SET_DEFAULT!$(ltr after_install_ewtip)":fbtn 'eos-wallpaper-set DEFAULT'
--field=" $(ltr after_install_ew2)!$WELCOME_ICON_WALLPAPER_SET!$(ltr after_install_ewtip2)":fbtn 'eos-wallpaper-set'
--field=" $(ltr after_install_more_wall)!$WELCOME_ICON_WALLPAPER_DOWNLOAD!$(ltr after_install_more_wall_tip)":fbtn 'RunInTerminal eos-download-wallpapers'
)
if IsR8168Card ; then
tabcontents+=(
--field=" $(ltr after_install_r8168)!$WELCOME_ICON_TOGGLE_r8169_DRIVER!$(ltr after_install_r8168_tip)":fbtn "ethernet_toggle_r8168_r8169"
)
fi
tabcontents+=(--field=" $(ltr ins_logtool)!$WELCOME_ICON_SYSTEM_LOGS!$(ltr ins_logtooltip)":fbtn "eos-log-tool" )
case "$(eos_yad_GetDesktopName)" in
XFCE)
tabcontents+=(
--field=" $(ltr after_install_themevan)!$WELCOME_ICON_XFCE_THEME_VANILLA!$(ltr after_install_themevantip)":fbtn 'yad_vanilla_xfce4_theme'
--field=" $(ltr after_install_themedef)!$WELCOME_ICON_XFCE_THEME_EOS!$(ltr after_install_themedeftip)":fbtn 'yad_endeavouros_xfce4_theme'
)
;;
esac
VboxGuestEnable
tabcontents+=(--field=" $(ltr after_install_itab)!$WELCOME_ICON_INITIAL_TAB!$(ltr after_install_itab_tip)":fbtn "bash -c WelcomeInitialTab")
[ "$handle" != "calculate" ] && "${tabcontents[@]}" >& /dev/null &
}
PacdiffIcon() {
# see /etc/eos-script-lib-yad.conf for differs
for differ in "${EOS_WELCOME_PACDIFFERS[@]}" ; do
if [ -x /usr/bin/$differ ] ; then
case "$differ" in
kompare) differ_icon=$differ ;;
meld) differ_icon=org.gnome.meld ;;
*) differ_icon=$(eos_IconGrasp "$differ") ;; #kdiff3|diffuse|code|vim)
esac
break
fi
done
}
DailyAssistant() {
local handle="$1"
local tabnum="$2"
local _exclamation='!' # '!'
local _and='&' # '&'
local differ="" # PacdiffIcon may change
local differ_icon=preferences-system # PacdiffIcon may change
PacdiffIcon
local tabcontents=(
eos_yad --align-buttons --use-interp # don't need explicit 'bash -c' construct when calling functions
--plug="$handle" --tabnum="$tabnum" --form --image=$WELCOME_ICON_INFO
--text="<b>$(ltr daily_assistant_text)</b>" --columns=2
--field=" $(ltr after_install_us)!$WELCOME_ICON_SYSTEM_UPDATE!$(ltr after_install_ustip)":fbtn "RunInTerminal UpdateInTerminal --lang=$lang"
)
if [ "$EOS_WELCOME_USE_AUR_HELPERS_TESTING" = "yes" ] ; then
if [ -x /usr/bin/yay ] ; then
tabcontents+=(
--field=" $(ltr after_install_us) (yay)!$WELCOME_ICON_SYSTEM_UPDATE!$(ltr after_install_ustip)":fbtn "RunInTerminal UpdateWithAurHelper yay"
)
fi
if [ -x /usr/bin/paru ] ; then
tabcontents+=(
--field=" $(ltr after_install_us) (paru)!$WELCOME_ICON_SYSTEM_UPDATE!$(ltr after_install_ustip)":fbtn "RunInTerminal UpdateWithAurHelper paru"
)
fi
fi
if [ "$(eos_GetArch)" != "armv7h" ] ; then
tabcontents+=(
--field=" $(ltr after_install_um)!$WELCOME_ICON_MIRROR_UPDATE!$(ltr after_install_umtip)":fbtn "RunIfInstalled -a=reflector-simple"
)
fi
tabcontents+=(--field=" Pacdiff $_and $differ!$differ_icon!$(ltr after_install_pacdiff_tip) $differ":fbtn "eos-pacdiff --nt")
tabcontents+=(
--field=" $(ltr ins_logtool)!$WELCOME_ICON_SYSTEM_LOGS!$(ltr ins_logtooltip)":fbtn "eos-log-tool"
)
#IsInstalled eos-apps-info && {
# tabcontents+=(
# --field=" EndeavourOS apps help!$WELCOME_ICON_EOS_GENERIC!Show manual pages of EndeavourOS apps":fbtn "/usr/bin/eos-apps-info"
# )
#}
# General app browsing buttons:
if [ "$(eos_GetArch)" = "armv7h" ] ; then
tabcontents+=(
--field=" $(ltr add_more_apps_arch)!!$(ltr add_more_apps_done2_tip1)":fbtn "$_WELCOME_BROWSER https://www.archlinuxarm.org/packages"
)
else
tabcontents+=(
--field=" $(ltr add_more_apps_arch)!!$(ltr add_more_apps_done2_tip1)":fbtn "$_WELCOME_BROWSER https://www.archlinux.org/packages"
)
fi
tabcontents+=(
--field=" $(ltr add_more_apps_aur)!!$( ltr add_more_apps_done2_tip2)":fbtn "$_WELCOME_BROWSER https://aur.archlinux.org/packages"
--field=" $(ltr daily_assist_apps)!!$(ltr daily_assist_apps_tip)":fbtn "$_WELCOME_BROWSER https://wiki.archlinux.org/title/List_of_applications"
)
local DE=""
eos_yad__detectDE # lowercase
if [ 0 -eq 1 ] ; then
# Adjust DE names for the Arch web page! Note: all could be lower case...
case "$DE" in
xfce) DE=Xfce;;
budgie) DE=Budgie;;
cinnamon) DE=Cinnamon;;
lxqt) DE=LXQt;;
i3) DE=i3;;
bspwm) DE=bspwm;;
sway) DE=sway;;
openbox) DE=Openbox;;
qtile) DE=Qtile;;
gnome3) DE=GNOME;;
gnome|kde|mate) ;;
*) DE="";;
esac
fi
if [ -n "$DE" ] ; then
tabcontents+=(
--field=" $DE: $(ltr daily_assist_DEinfo)!!$DE: $(ltr daily_assist_DEinfo_tip)":fbtn "$_WELCOME_BROWSER https://wiki.archlinux.org/title/$DE"
)
fi
[ "$handle" != "calculate" ] && "${tabcontents[@]}" >& /dev/null &
}
WelcomeInitialTab() {
## Welcome tabs are numbered starting from 1.
## Note1: This setting is not used while installing.
## Note2: This overrides the related setting 'activate_own_commands_tab'
## or the first parameter in call to personal_commands_init()
## in file ~/.config/welcome-own-cmds.conf.
if [ ! -r "$welcome_configurator" ] ; then
echo "EOS_WELCOME_ACTIVE_TAB_NUMBER=2 # default: 2 (=After Install)" > $welcome_configurator
fi
source "$welcome_configurator"
[ -z "$EOS_WELCOME_ACTIVE_TAB_NUMBER" ] && export EOS_WELCOME_ACTIVE_TAB_NUMBER=2
local count="$_NOTEBOOK_TABS_COUNT"
local txt=""
txt+="Welcome tabs are numbered from 1 to $count.\n"
txt+="For example, the <b>After Install</b> tab is number 2.\n"
txt+="Select the number of the Welcome tab to show initially.\n"
txt+="After selecting the initial tab, Welcome will be restarted.\n"
local cmd=(
eos_yad --form --align-buttons --use-interp --title="Welcome initial tab"
--text="$txt" --image=$WELCOME_ICON_PREFERENCES
--field="Initial tab number\t\t":num "$EOS_WELCOME_ACTIVE_TAB_NUMBER!1..$count!1"
)
local result="$("${cmd[@]}" | cut -d '|' -f1)"
[ -z "$result" ] && return
sed -i $welcome_configurator -e "s|^EOS_WELCOME_ACTIVE_TAB_NUMBER=[0-9]*|EOS_WELCOME_ACTIVE_TAB_NUMBER=$result|"
local tmpfile=$(mktemp $HOME/.cache/.greeter_restart.XXXXX)
cat <<EOF > $tmpfile
pkill -f "/usr/bin/yad --window-icon=$EOS_WICON"
sleep 0.2
eos-welcome ${WELCOME_ARGS} &
sleep 0.5
rm -f $tmpfile
EOF
chmod +x $tmpfile
$tmpfile
}
export -f WelcomeInitialTab
Github2Gitlab() {
eos-github2gitlab "$@"
}
export -f Github2Gitlab
UsefulTips() {
local handle="$1"
local tabnum="$2"
local _and='&' # '&'
local tabcontents+=(
eos_yad --align-buttons
--plug="$handle" --tabnum="$tabnum" --form --columns=2
--image=$WELCOME_ICON_TIPS
--text="<b>$(ltr useful_tips_text)</b>"
--field=" $(ltr after_install_pm)!$WELCOME_ICON_TIPS!$(ltr after_install_pmtip)":fbtn "$_WELCOME_BROWSER 'https://discovery.endeavouros.com/?s=pacman'"
--field=" $(ltr after_install_ay)!$WELCOME_ICON_TIPS!$(ltr after_install_aytip)":fbtn "$_WELCOME_BROWSER 'https://discovery.endeavouros.com/category/aur'"
)
if [ -x /usr/bin/firewalld ] ; then
tabcontents+=(--field=" $(ltr after_install_fw)!$WELCOME_ICON_TIPS!$(ltr after_install_fwtip)":fbtn "$_WELCOME_BROWSER 'https://discovery.endeavouros.com/applications/firewalld/2022/03'")
fi
tabcontents+=(
--field=" $(ltr after_install_hn)!$WELCOME_ICON_TIPS!$(ltr after_install_hntip)":fbtn "$_WELCOME_BROWSER 'https://discovery.endeavouros.com/?s=Hardware'"
--field=" $(ltr after_install_bt)!$WELCOME_ICON_TIPS!$(ltr after_install_bttip)":fbtn "$_WELCOME_BROWSER 'https://discovery.endeavouros.com/bluetooth/bluetooth/2021/03'" # 'https://discovery.endeavouros.com/bluetooth'
)
test "$(eos_GetArch)" != "armv7h" && \
tabcontents+=(--field=" $(ltr after_install_nv)!$WELCOME_ICON_TIPS!$(ltr after_install_nvtip)":fbtn "$_WELCOME_BROWSER https://discovery.endeavouros.com/category/nvidia")
tabcontents+=(
--field=" $(ltr after_install_ft)!$WELCOME_ICON_TIPS!$(ltr after_install_fttip)":fbtn "$_WELCOME_BROWSER https://discovery.endeavouros.com/forum-log-tool-options/how-to-include-systemlogs-in-your-post"
--field=" EndeavourOS $_and ARM!$WELCOME_ICON_ARM!EndeavourOS $_and ARM $(ltr after_install_info)":fbtn "$_WELCOME_BROWSER https://arm.endeavouros.com"
--field=" $(ltr butt_owncmds_help)!$WELCOME_ICON_TIPS!$(ltr nb_tab_owncmdstip)":fbtn "$_WELCOME_BROWSER $(Github2Gitlab https://github.com/endeavouros-team/PKGBUILDS/blob/master/welcome/Adding-own-commands.md)"
--field=" $(ltr butt_owncmds_dnd)!$EOS_WICON!$(ltr butt_owncmds_dnd_help)":fbtn "welcome-dnd"
)
[ "$handle" != "calculate" ] && "${tabcontents[@]}" >& /dev/null &
}
IsEosYadInstalled() {
# Determines if yad-eos is installed.
# Some yad alternative must be installed if we can use this program!
local installed_yad="$(LANG=C /usr/bin/pacman -Qi yad 2>/dev/null | /usr/bin/grep -w ^Name | /usr/bin/awk '{print $3}')"
if [ "$installed_yad" = "yad-eos" ] ; then
return 0 # yad-eos is installed
else
return 1 # some other yad alternative is installed
fi
}
AddMoreApps() {
local handle="$1"
local tabnum="$2"
local tabcontents=(
eos_yad --align-buttons --use-interp
--plug="$handle" --tabnum="$tabnum" --form --text-align=left --columns=2
--image=$WELCOME_ICON_INSTALL_INFO
)
local shown_app_buttons=0
local use_eos_quickstart=no
local WELCOME_ICON_LIBREOFFICE=libreoffice-fresh
local WELCOME_ICON_CHROMIUM=chromium
local WELCOME_ICON_AKM=system-software-install
local WELCOME_ICON_BLUETOOTH=$(eos_IconGrasp bluetooth)
[ -x /usr/bin/eos-quickstart ] && use_eos_quickstart=yes
if [ "$use_eos_quickstart" = "no" ] ; then
local DE="$(eos_yad_GetDesktopName)"
# local gufw="$(eos_IconGrasp gufw network-firewall firewall-config)"
# local libreoffice="$(eos_IconGrasp libreoffice-writer)"
local chromium="$(eos_IconGrasp chromium web-browser)"
local libreoffice="libreoffice-fresh"
IsInstalled "$libreoffice" || {
((shown_app_buttons++))
tabcontents+=( --field=" LibreOffice fresh!$WELCOME_ICON_LIBREOFFICE!$(ltr add_more_apps_lotip)":fbtn "yad_Install $libreoffice")
}
IsInstalled chromium || {
((shown_app_buttons++))
tabcontents+=(--field=" $(ltr add_more_apps_ch)!$WELCOME_ICON_CHROMIUM!$(ltr add_more_apps_chtip)":fbtn 'yad_Install chromium')
}
#IsInstalled gufw || {
# ((shown_app_buttons++))
# tabcontents+=(--field=" $(ltr add_more_apps_fw)!$gufw!$(ltr add_more_apps_fwtip)":fbtn 'yad_Install gufw')
#}
if [ "$(eos_GetArch)" != "armv7h" ] ; then
IsInstalled akm || {
((shown_app_buttons++))
tabcontents+=(--field=" $(ltr add_more_apps_akm)!$WELCOME_ICON_AKM!$(ltr add_more_apps_akmtip)":fbtn 'yad_Install akm')
}
fi
#IsInstalled eos-apps-info || {
# ((shown_app_buttons++))
# tabcontents+=(--field=" EndeavourOS apps info!$system_software_install!Show info about EndeavourOS apps":fbtn 'yad_Install eos-apps-info')
#}
case "$DE" in
XFCE)
while true ; do # Show buttons only if none of them are installed.
IsInstalled blueberry && break
IsInstalled blueman && break
((shown_app_buttons+=2))
local bluetooth="$(eos_IconGrasp bluetooth)"
tabcontents+=(
--field=" $(ltr add_more_apps_bt)!$WELCOME_ICON_BLUETOOTH!Blueberry":fbtn 'yad_Install blueberry bluez-utils'
--field=" $(ltr add_more_apps_bt_bm)!$WELCOME_ICON_BLUETOOTH!Blueman":fbtn 'yad_Install blueman bluez-utils pulseaudio-bluetooth'
)
break
done
;;
esac
if (! IsEosYadInstalled) ; then
tabcontents+=(--field=" Yad (patched)!$(yad-tools -i yad)!Patched version of yad fixes the window height issue":fbtn "yad_Install yad-eos")
fi
fi
# General app browsing buttons:
if [ "$(eos_GetArch)" = "armv7h" ] ; then
tabcontents+=(--field=" $(ltr add_more_apps_arch)!!$(ltr add_more_apps_done2_tip1)":fbtn "$_WELCOME_BROWSER https://www.archlinuxarm.org/packages")
else
tabcontents+=(--field=" $(ltr add_more_apps_arch)!!$(ltr add_more_apps_done2_tip1)":fbtn "$_WELCOME_BROWSER https://www.archlinux.org/packages")
fi
tabcontents+=(--field=" $(ltr add_more_apps_aur)!!$( ltr add_more_apps_done2_tip2)":fbtn "$_WELCOME_BROWSER https://aur.archlinux.org/packages")
if [ "$use_eos_quickstart" = "yes" ] ; then
((shown_app_buttons++))
tabcontents+=(--field=" $(ltr add_more_apps_qs)!$EOS_WICON!$(ltr add_more_apps_qstip)":fbtn "eos-quickstart")
fi
# Now we know if we have any apps in the install list.
if [ $shown_app_buttons -eq 0 ] ; then
tabcontents+=(--text="<b>$(ltr add_more_apps_done1_text)$(ltr add_more_apps_done2_text)</b>")
else
tabcontents+=(--text="<b>$(ltr add_more_apps_text) $(ltr add_more_apps_done2_text)</b>")
fi
[ "$handle" != "calculate" ] && "${tabcontents[@]}" >& /dev/null &
}
#### Support for personal commands:
personal_commands_add() { # add one personal command
local commandline="$1"
local name="$2"
local icon="$3"
local description="$4"
local cmd="$5"
[ -n "$description" ] || description="$commandline"
[ -n "$cmd" ] || cmd="$(echo "$commandline" | /usr/bin/awk '{print $1}')"
if (/usr/bin/which $cmd &> /dev/null) ; then
welcome_own_commands+=(--field=" $name!$icon!$description":fbtn "$commandline")
else
printf "%s: %s\n %s\n" "$(/usr/bin/date "+%x %X")" "$FUNCNAME:" "warning: command '$cmd' not found" >> /tmp/welcome-personal-commands.log
echo "$FUNCNAME: warning: command '$cmd' not found" >&2
fi
}
personal_commands_init() { # initialize user settings for personal commands
[ -n "$1" ] && activate_own_commands_tab="$1"
[ -n "$2" ] && columns_for_own_commands="$2"
[ -n "$3" ] && show_predefined_buttons_at_own_commands="$3"
}
_align_buttons_on_tab() {
# handles old _align() marking in ~/.config/welcome-own-cmds.conf
local -n arr="$1"
local handle="$2"
local ix xx
# just remove possible legacy "_align(...) construct"
ix=0
for xx in "${arr[@]}" ; do
case "$xx" in
--field=*)
if [ "$xx" != "${xx/*_align(/}" ] ; then
arr[$ix]="$(echo "$xx" | sed 's|_align(\(.*\))!| \1!|')"
fi
;;
esac
((ix++))
done
}
OwnCommands() {
local handle="$1"
local tabnum="$2"
local cols="$columns_for_own_commands"
local show_buttons="$show_predefined_buttons_at_own_commands"
case "$show_buttons" in
no) ;;
*) show_buttons=yes ;;
esac
while true ; do
if [ -z "$cols" ] ; then
cols=2
elif [ -n "$(echo "$cols" | tr -d '0-9')" ] ; then
cols=2
echo "Warning: value '$columns_for_own_commands' for variable 'columns_for_own_commands' is unsupported, using $cols." >&2
elif [ $cols -lt 1 ] || [ $cols -gt 20 ] ; then
cols=2
echo "Warning: value '$columns_for_own_commands' for variable 'columns_for_own_commands' is unsupported, using $cols." >&2
fi
break
done
local tabcontents=(
eos_yad --align-buttons
--plug="$handle" --tabnum="$tabnum" --form --columns=$cols
--image=$WELCOME_ICON_OWN_COMMANDS
--text="<b>$(ltr nb_tab_owncmds_text)</b>"
)
if [ "$show_buttons" = "yes" ] ; then
tabcontents+=(
--field=" $(ltr butt_owncmds_help)!$WELCOME_ICON_TIPS!$(ltr nb_tab_owncmdstip)":fbtn
"$_WELCOME_BROWSER $(Github2Gitlab https://github.com/endeavouros-team/PKGBUILDS/blob/master/welcome/Adding-own-commands.md)"
--field=" $(ltr butt_owncmds_dnd)!$EOS_WICON!$(ltr butt_owncmds_dnd_help)":fbtn "welcome-dnd"
)
fi
tabcontents+=("${welcome_own_commands[@]}")
_align_buttons_on_tab tabcontents "$handle"
[ "$handle" != "calculate" ] && "${tabcontents[@]}" >& /dev/null &
}
# Fields explanation:
# --field="ButtonName!IconName!Tooltip":fbtn "Command"
### These variables are required:
CreateNotebookCommands() {
IsInstalling && {
_NOTEBOOK_TABS=( # names of functions above
INSTALL
GeneralInfo
)
} || {
_NOTEBOOK_TABS=( # names of functions above
GeneralInfo
AfterInstall
DailyAssistant
UsefulTips
AddMoreApps
)
}
if [ -n "$welcome_own_commands" ] ; then