|
7 | 7 | # (c) 2019-2021 Fascode Network. |
8 | 8 | # |
9 | 9 |
|
10 | | -set -e -u |
11 | | - |
12 | | - |
13 | | -# Default value |
14 | | -# All values can be changed by arguments. |
15 | | -password=alter |
16 | | -boot_splash=false |
17 | | -kernel_config_line=("zen" "vmlinuz-linux-zen" "linux-zen") |
18 | | -theme_name=alter-logo |
19 | | -rebuild=false |
20 | | -username='alter' |
21 | | -os_name="Alter Linux" |
22 | | -install_dir="alter" |
23 | | -usershell="/bin/bash" |
24 | | -debug=false |
25 | | -timezone="UTC" |
26 | | -localegen="en_US\\.UTF-8\\" |
27 | | -language="en" |
28 | | - |
29 | | - |
30 | | -# Parse arguments |
31 | | -while getopts 'p:bt:k:rxu:o:i:s:da:g:z:l:' arg; do |
32 | | - case "${arg}" in |
33 | | - p) password="${OPTARG}" ;; |
34 | | - b) boot_splash=true ;; |
35 | | - t) theme_name="${OPTARG}" ;; |
36 | | - k) kernel_config_line=(${OPTARG}) ;; |
37 | | - r) rebuild=true ;; |
38 | | - u) username="${OPTARG}" ;; |
39 | | - o) os_name="${OPTARG}" ;; |
40 | | - i) install_dir="${OPTARG}" ;; |
41 | | - s) usershell="${OPTARG}" ;; |
42 | | - d) debug=true ;; |
43 | | - x) debug=true; set -xv ;; |
44 | | - a) arch="${OPTARG}" ;; |
45 | | - g) localegen="${OPTARG/./\\.}\\" ;; |
46 | | - z) timezone="${OPTARG}" ;; |
47 | | - l) language="${OPTARG}" ;; |
48 | | - esac |
49 | | -done |
50 | | - |
51 | | - |
52 | | -# Parse kernel |
53 | | -kernel="${kernel_config_line[0]}" |
54 | | -kernel_filename="${kernel_config_line[1]}" |
55 | | -kernel_mkinitcpio_profile="${kernel_config_line[2]}" |
56 | | - |
57 | | - |
58 | | -# Delete file only if file exists |
59 | | -# remove <file1> <file2> ... |
60 | | -function remove () { |
61 | | - local _list |
62 | | - local _file |
63 | | - _list=($(echo "$@")) |
64 | | - for _file in "${_list[@]}"; do |
65 | | - if [[ -f ${_file} ]]; then |
66 | | - rm -f "${_file}" |
67 | | - elif [[ -d ${_file} ]]; then |
68 | | - rm -rf "${_file}" |
69 | | - fi |
70 | | - echo "${_file} was deleted." |
71 | | - done |
72 | | -} |
73 | | - |
74 | | -function installedpkg () { |
75 | | - if pacman -Qq "${1}" 1>/dev/null 2>/dev/null; then |
76 | | - return 0 |
77 | | - else |
78 | | - return 1 |
79 | | - fi |
80 | | -} |
81 | | - |
82 | 10 | # Bluetooth |
83 | 11 | rfkill unblock all |
84 | 12 | systemctl enable bluetooth |
|
0 commit comments