Skip to content

Commit 2c824d5

Browse files
committed
[update] : Added share-extra script
1 parent 8a0a90b commit 2c824d5

File tree

10 files changed

+141
-258
lines changed

10 files changed

+141
-258
lines changed

build.sh

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -808,7 +808,18 @@ make_customize_airootfs() {
808808
[[ "${rebuild}" = true ]] && _airootfs_script_options="${_airootfs_script_options} -r"
809809

810810

811-
_script_list=("/root/customize_airootfs.sh" "/root/customize_airootfs.sh" "/root/customize_airootfs_${channel_name}.sh" "/root/customize_airootfs_${channel_name%.add}.sh")
811+
_script_list=(
812+
"/root/customize_airootfs.sh"
813+
"/root/customize_airootfs.sh"
814+
"/root/customize_airootfs_${channel_name}.sh"
815+
"/root/customize_airootfs_${channel_name%.add}.sh"
816+
)
817+
818+
if [[ "${include_extra}" = true ]]; then
819+
_script_list+=(
820+
"/root/customize_airootfs_share-extra.sh"
821+
)
822+
fi
812823

813824
# Script permission
814825
for _script in ${_script_list[@]}; do

channels/basic/airootfs.any/root/customize_airootfs_basic.sh

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,5 +73,3 @@ function remove () {
7373
# Update system datebase
7474
#dconf update
7575

76-
# Replace link
77-
remove "/etc/skel/Desktop/"

channels/cinnamon/airootfs.any/root/customize_airootfs_cinnamon.sh

Lines changed: 1 addition & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -54,61 +54,13 @@ kernel="${kernel_config_line[0]}"
5454
kernel_filename="${kernel_config_line[1]}"
5555
kernel_mkinitcpio_profile="${kernel_config_line[2]}"
5656

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-
75-
# Bluetooth
76-
rfkill unblock all
77-
systemctl enable bluetooth
78-
79-
# Snap
80-
if [[ "${arch}" = "x86_64" ]]; then
81-
systemctl enable snapd.apparmor.service
82-
systemctl enable apparmor.service
83-
systemctl enable snapd.socket
84-
systemctl enable snapd.service
85-
fi
86-
87-
88-
# firewalld
89-
systemctl enable firewalld.service
90-
91-
92-
# Added autologin group to auto login
93-
groupadd autologin
94-
usermod -aG autologin ${username}
95-
96-
97-
# ntp
98-
systemctl enable systemd-timesyncd.service
99-
100-
10157
# Enable LightDM to auto login
10258
if [[ "${boot_splash}" = true ]]; then
10359
systemctl enable lightdm-plymouth.service
10460
else
10561
systemctl enable lightdm.service
10662
fi
10763

108-
109-
# Set script permission
110-
chmod 755 /usr/bin/alterlinux-gtk-bookmarks
111-
11264
# Replace auto login user
11365
sed -i s/%USERNAME%/${username}/g /etc/lightdm/lightdm.conf
11466

@@ -117,3 +69,4 @@ sed -i s/%PASSWORD%/${password}/g "/etc/dconf/db/local.d/02-disable-lock"
11769

11870
# Update system datebase
11971
dconf update
72+

channels/gnome-mac/airootfs.any/root/customize_airootfs_gnome-mac.sh

Lines changed: 6 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -72,42 +72,6 @@ function remove () {
7272
}
7373

7474

75-
# Replace wallpaper.
76-
if [[ -f /usr/share/backgrounds/xfce/xfce-stripes.png ]]; then
77-
remove /usr/share/backgrounds/xfce/xfce-stripes.png
78-
ln -s /usr/share/backgrounds/alter.png /usr/share/backgrounds/xfce/xfce-stripes.png
79-
fi
80-
[[ -f /usr/share/backgrounds/alter.png ]] && chmod 644 /usr/share/backgrounds/alter.png
81-
82-
83-
# Bluetooth
84-
rfkill unblock all
85-
systemctl enable bluetooth
86-
87-
# Snap
88-
if [[ "${arch}" = "x86_64" ]]; then
89-
systemctl enable snapd.apparmor.service
90-
systemctl enable apparmor.service
91-
systemctl enable snapd.socket
92-
systemctl enable snapd.service
93-
fi
94-
95-
96-
# Update system datebase
97-
dconf update
98-
99-
100-
# firewalld
101-
systemctl enable firewalld.service
102-
103-
104-
# Added autologin group to auto login
105-
groupadd autologin
106-
usermod -aG autologin ${username}
107-
108-
# ntp
109-
systemctl enable systemd-timesyncd.service
110-
11175
# Enable gdm to auto login
11276
if [[ "${boot_splash}" = true ]]; then
11377
systemctl enable gdm-plymouth.service
@@ -116,9 +80,6 @@ else
11680
fi
11781

11882

119-
# Set script permission
120-
chmod 755 /usr/bin/alterlinux-gtk-bookmarks
121-
12283
# Replace auto login user
12384
sed -i s/%USERNAME%/${username}/g /etc/gdm/custom.conf
12485

@@ -144,5 +105,9 @@ fi
144105

145106

146107
# Remove shortcuts
147-
remove "/etc/skel/Desktop/calamares.desktop"
148-
remove "/home/${username}/Desktop/calamares.desktop"
108+
function remove_userfile() {
109+
remove "/home/${username}/${1#/}"
110+
remove "/etc/skel/${1#/}"
111+
}
112+
remove_userfile "Desktop/calamares.desktop"
113+
remove_userfile ".config/autostart/genicon.desktop"

channels/gnome/airootfs.any/root/customize_airootfs_gnome.sh

Lines changed: 8 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -72,42 +72,6 @@ function remove () {
7272
}
7373

7474

75-
# Replace wallpaper.
76-
if [[ -f /usr/share/backgrounds/xfce/xfce-stripes.png ]]; then
77-
remove /usr/share/backgrounds/xfce/xfce-stripes.png
78-
ln -s /usr/share/backgrounds/alter.png /usr/share/backgrounds/xfce/xfce-stripes.png
79-
fi
80-
[[ -f /usr/share/backgrounds/alter.png ]] && chmod 644 /usr/share/backgrounds/alter.png
81-
82-
83-
# Bluetooth
84-
rfkill unblock all
85-
systemctl enable bluetooth
86-
87-
# Snap
88-
if [[ "${arch}" = "x86_64" ]]; then
89-
systemctl enable snapd.apparmor.service
90-
systemctl enable apparmor.service
91-
systemctl enable snapd.socket
92-
systemctl enable snapd.service
93-
fi
94-
95-
96-
# Update system datebase
97-
dconf update
98-
99-
100-
# firewalld
101-
systemctl enable firewalld.service
102-
103-
104-
# Added autologin group to auto login
105-
groupadd autologin
106-
usermod -aG autologin ${username}
107-
108-
# ntp
109-
systemctl enable systemd-timesyncd.service
110-
11175
# Enable gdm to auto login
11276
if [[ "${boot_splash}" = true ]]; then
11377
systemctl enable gdm-plymouth.service
@@ -116,11 +80,8 @@ else
11680
fi
11781

11882

119-
# Set script permission
120-
chmod 755 /usr/bin/alterlinux-gtk-bookmarks
121-
12283
# Replace auto login user
123-
sed -i s/%USERNAME%/${username}/g /etc/gdm/custom.conf
84+
sed -i "s/%USERNAME%/${username}/g" "/etc/gdm/custom.conf"
12485

12586

12687
# Set autologin session
@@ -135,6 +96,7 @@ Icon=/home/${username}/.face
13596
SystemAccount=false
13697
EOF
13798

99+
138100
# Remove file for japanese input
139101
if [[ ! "${language}" = "ja" ]]; then
140102
sed -i "s/export GTK_IM_MODULE=fcitx/#export GTK_IM_MODULE=fcitx/g" "/etc/environment"
@@ -144,5 +106,9 @@ fi
144106

145107

146108
# Remove shortcuts
147-
remove "/etc/skel/Desktop/calamares.desktop"
148-
remove "/home/${username}/Desktop/calamares.desktop"
109+
function remove_userfile() {
110+
remove "/home/${username}/${1#/}"
111+
remove "/etc/skel/${1#/}"
112+
}
113+
remove_userfile "Desktop/calamares.desktop"
114+
remove_userfile ".config/autostart/genicon.desktop"

channels/lxde/airootfs.any/root/customize_airootfs_lxde.sh

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -72,12 +72,6 @@ function remove () {
7272
done
7373
}
7474

75-
76-
# Bluetooth
77-
rfkill unblock all
78-
systemctl enable bluetooth
79-
80-
8175
# Replace panel config
8276
if [[ "${language}" = "ja" ]]; then
8377
remove "/etc/skel/.config/lxpanel/LXDE/panels/panel"
@@ -91,28 +85,6 @@ else
9185
fi
9286

9387

94-
# Update system datebase
95-
dconf update
96-
97-
98-
# Snap
99-
if [[ "${arch}" = "x86_64" ]]; then
100-
systemctl enable snapd.apparmor.service
101-
systemctl enable apparmor.service
102-
systemctl enable snapd.socket
103-
systemctl enable snapd.service
104-
fi
105-
106-
107-
# firewalld
108-
systemctl enable firewalld.service
109-
110-
111-
# Added autologin group to auto login
112-
groupadd autologin
113-
usermod -aG autologin ${username}
114-
115-
11688
# Enable LightDM to auto login
11789
if [[ "${boot_splash}" = true ]]; then
11890
systemctl enable lightdm-plymouth.service
@@ -137,9 +109,3 @@ fi
137109

138110
# Replace auto login user
139111
sed -i s/%USERNAME%/${username}/g /etc/lightdm/lightdm.conf
140-
141-
# Set script permission
142-
chmod 755 /usr/bin/alterlinux-gtk-bookmarks
143-
144-
# ntp
145-
systemctl enable systemd-timesyncd.service

channels/serene/airootfs.any/root/customize_airootfs_serene.sh

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -81,26 +81,6 @@ fi
8181
[[ -f /usr/share/backgrounds/alter.png ]] && chmod 644 /usr/share/backgrounds/alter.png
8282
DISABLED
8383

84-
# Bluetooth
85-
rfkill unblock all
86-
systemctl enable bluetooth
87-
88-
# Snap
89-
if [[ "${arch}" = "x86_64" ]]; then
90-
systemctl enable snapd.apparmor.service
91-
systemctl enable apparmor.service
92-
systemctl enable snapd.socket
93-
systemctl enable snapd.service
94-
fi
95-
96-
97-
# Update system datebase
98-
dconf update
99-
100-
101-
# firewalld
102-
systemctl enable firewalld.service
103-
10484

10585
# Replace right menu
10686
:<< DISABLED
@@ -116,13 +96,6 @@ else
11696
fi
11797
DISABLED
11898

119-
# Added autologin group to auto login
120-
groupadd autologin
121-
usermod -aG autologin ${username}
122-
123-
# ntp
124-
systemctl enable systemd-timesyncd.service
125-
12699

127100
# Enable LightDM to auto login
128101
if [[ "${boot_splash}" = true ]]; then
@@ -132,8 +105,5 @@ else
132105
fi
133106

134107

135-
# Set script permission
136-
chmod 755 /usr/bin/alterlinux-gtk-bookmarks
137-
138108
# Replace auto login user
139109
sed -i s/%USERNAME%/${username}/g /etc/lightdm/lightdm.conf

0 commit comments

Comments
 (0)