-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsetup-boot-theme.sh
More file actions
executable file
Β·340 lines (266 loc) Β· 12.2 KB
/
setup-boot-theme.sh
File metadata and controls
executable file
Β·340 lines (266 loc) Β· 12.2 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
#!/bin/bash
#
# NullSec Linux Boot Theme & Updater Setup v1.1
# Creates custom Plymouth theme and rebrands update notifications
# Repository: https://github.com/bad-antics/nullsec
#
set -e
RED='\033[1;31m'
GREEN='\033[1;32m'
CYAN='\033[1;36m'
YELLOW='\033[1;33m'
NC='\033[0m'
echo -e "${RED}"
cat << "EOF"
====
| NullSec Linux Boot Theme & Updater Configuration |
====
EOF
echo -e "${NC}"
# ============================================================================
# STEP 1: Install Plymouth (Boot Splash)
# ============================================================================
echo -e "${GREEN}[+] Step 1: Installing Plymouth boot splash system...${NC}"
sudo apt-get update -qq
sudo apt-get install -y plymouth plymouth-themes plymouth-label
echo -e "${GREEN} β Plymouth installed${NC}"
# ============================================================================
# STEP 2: Create NullSec Plymouth Theme
# ============================================================================
echo -e "${GREEN}[+] Step 2: Creating NullSec Plymouth theme...${NC}"
THEME_DIR="/usr/share/plymouth/themes/nullsec"
sudo mkdir -p "$THEME_DIR"
# Create theme configuration
sudo tee "$THEME_DIR/nullsec.plymouth" > /dev/null << 'PLYMOUTHCONF'
[Plymouth Theme]
Name=NullSec Linux
Description=NullSec Linux Boot Splash
ModuleName=script
[script]
ImageDir=/usr/share/plymouth/themes/nullsec
ScriptFile=/usr/share/plymouth/themes/nullsec/nullsec.script
PLYMOUTHCONF
# Create Plymouth script
sudo tee "$THEME_DIR/nullsec.script" > /dev/null << 'PLYMOUTHSCRIPT'
# NullSec Linux Plymouth Script
# Background
Window.SetBackgroundTopColor(0.0, 0.0, 0.0);
Window.SetBackgroundBottomColor(0.05, 0.05, 0.05);
# Logo
logo.image = Image.Text("NULLSEC LINUX", 1, 0, 0, 1, "Sans Bold 48");
logo.sprite = Sprite(logo.image);
logo.sprite.SetPosition(Window.GetWidth() / 2 - logo.image.GetWidth() / 2,
Window.GetHeight() / 3);
# Version text
version.image = Image.Text("Version 1.0 - Offensive Security Platform", 0.5, 0.5, 0.5, 1, "Sans 16");
version.sprite = Sprite(version.image);
version.sprite.SetPosition(Window.GetWidth() / 2 - version.image.GetWidth() / 2,
Window.GetHeight() / 3 + 80);
# Loading text
loading.image = Image.Text("Loading...", 1, 0, 0, 1, "Sans 18");
loading.sprite = Sprite(loading.image);
loading.sprite.SetPosition(Window.GetWidth() / 2 - loading.image.GetWidth() / 2,
Window.GetHeight() / 2 + 100);
# Progress bar setup
progress_box.image = Image("progress_box.png");
progress_box.sprite = Sprite(progress_box.image);
progress_box.sprite.SetPosition(Window.GetWidth() / 2 - progress_box.image.GetWidth() / 2,
Window.GetHeight() / 2 + 150);
progress_bar.original_image = Image("progress_bar.png");
progress_bar.sprite = Sprite();
progress_bar.sprite.SetPosition(Window.GetWidth() / 2 - progress_box.image.GetWidth() / 2,
Window.GetHeight() / 2 + 150);
# Spinning animation
spin = 0;
fun refresh_callback() {
spin = (spin + 1) % 360;
# Animate loading text
loading.sprite.SetOpacity(Math.Sin(spin * 3.14159 / 180) * 0.5 + 0.5);
}
Plymouth.SetRefreshFunction(refresh_callback);
# Progress bar update
fun progress_callback(duration, progress) {
if (progress_bar.image.GetWidth() != Math.Int(progress_bar.original_image.GetWidth() * progress)) {
progress_bar.image = progress_bar.original_image.Scale(
progress_bar.original_image.GetWidth() * progress,
progress_bar.original_image.GetHeight()
);
progress_bar.sprite.SetImage(progress_bar.image);
}
}
Plymouth.SetBootProgressFunction(progress_callback);
# Message display
message_sprite = Sprite();
message_sprite.SetPosition(10, 10, 10000);
fun message_callback(text) {
my_image = Image.Text(text, 1, 1, 1);
message_sprite.SetImage(my_image);
}
Plymouth.SetMessageFunction(message_callback);
# Quit callback
fun quit_callback() {
logo.sprite.SetOpacity(0);
version.sprite.SetOpacity(0);
loading.sprite.SetOpacity(0);
progress_box.sprite.SetOpacity(0);
progress_bar.sprite.SetOpacity(0);
}
Plymouth.SetQuitFunction(quit_callback);
PLYMOUTHSCRIPT
# Create simple progress bar images
sudo convert -size 400x20 xc:gray30 "$THEME_DIR/progress_box.png" 2>/dev/null || \
sudo convert -size 400x20 canvas:gray30 "$THEME_DIR/progress_box.png" 2>/dev/null || {
# Fallback: create simple file if ImageMagick not available
echo "ImageMagick not found, using text-only boot screen"
}
sudo convert -size 400x20 xc:red "$THEME_DIR/progress_bar.png" 2>/dev/null || \
sudo convert -size 400x20 canvas:red "$THEME_DIR/progress_bar.png" 2>/dev/null || {
echo "ImageMagick not found, using text-only boot screen"
}
echo -e "${GREEN} β NullSec Plymouth theme created${NC}"
# ============================================================================
# STEP 3: Activate Plymouth Theme
# ============================================================================
echo -e "${GREEN}[+] Step 3: Activating NullSec boot theme...${NC}"
sudo update-alternatives --install /usr/share/plymouth/themes/default.plymouth default.plymouth \
"$THEME_DIR/nullsec.plymouth" 100
sudo update-alternatives --set default.plymouth "$THEME_DIR/nullsec.plymouth"
# Update initramfs
echo -e "${CYAN}[*] Updating initramfs (this may take a minute)...${NC}"
sudo update-initramfs -u
echo -e "${GREEN} β Boot theme activated${NC}"
# ============================================================================
# STEP 4: Update GRUB for Quiet Boot
# ============================================================================
echo -e "${GREEN}[+] Step 4: Configuring GRUB for splash screen...${NC}"
sudo cp /etc/default/grub /etc/default/grub.bak.plymouth
# Update GRUB_CMDLINE_LINUX_DEFAULT
sudo sed -i 's/GRUB_CMDLINE_LINUX_DEFAULT=.*/GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"/' /etc/default/grub
sudo update-grub
echo -e "${GREEN} β GRUB configured${NC}"
# ============================================================================
# STEP 5: Rebrand Parrot Update Notifier
# ============================================================================
echo -e "${GREEN}[+] Step 5: Rebranding system updater...${NC}"
# Find and update parrot-upgrade-notifier
if [ -f /usr/bin/parrot-upgrade-notifier ]; then
sudo cp /usr/bin/parrot-upgrade-notifier /usr/bin/parrot-upgrade-notifier.bak
sudo sed -i 's/Parrot/NullSec Linux/g' /usr/bin/parrot-upgrade-notifier
sudo sed -i 's/parrot/nullsec/g' /usr/bin/parrot-upgrade-notifier
echo -e "${GREEN} β Updated upgrade notifier${NC}"
fi
# Update apt-check messages
if [ -f /usr/lib/update-notifier/apt-check ]; then
sudo cp /usr/lib/update-notifier/apt-check /usr/lib/update-notifier/apt-check.bak
sudo sed -i 's/Parrot/NullSec Linux/g' /usr/lib/update-notifier/apt-check 2>/dev/null || true
fi
# Update update-manager if present
if [ -f /usr/bin/update-manager ]; then
sudo cp /usr/bin/update-manager /usr/bin/update-manager.bak
sudo sed -i 's/Parrot/NullSec Linux/g' /usr/bin/update-manager
sudo sed -i 's/parrot/nullsec/g' /usr/bin/update-manager
echo -e "${GREEN} β Updated update-manager${NC}"
fi
# Create custom update notification script
sudo tee /usr/local/bin/nullsec-update-check > /dev/null << 'UPDATECHECK'
#!/bin/bash
# NullSec Linux Update Checker
UPDATES=$(apt list --upgradable 2>/dev/null | grep -c upgradable)
if [ "$UPDATES" -gt 0 ]; then
notify-send "NullSec Linux Updates" \
"$UPDATES updates available for your system" \
--icon=system-software-update \
--urgency=normal
fi
UPDATECHECK
sudo chmod +x /usr/local/bin/nullsec-update-check
echo -e "${GREEN} β Created NullSec update checker${NC}"
# ============================================================================
# STEP 6: Update Desktop Notifications
# ============================================================================
echo -e "${GREEN}[+] Step 6: Configuring startup notifications...${NC}"
# Create autostart entry for update notifications
mkdir -p ~/.config/autostart
cat > ~/.config/autostart/nullsec-updates.desktop << 'AUTOSTART'
[Desktop Entry]
Type=Application
Name=NullSec Update Notifier
Comment=Check for NullSec Linux updates
Exec=/usr/local/bin/nullsec-update-check
Terminal=false
Hidden=false
X-GNOME-Autostart-enabled=true
AUTOSTART
echo -e "${GREEN} β Update notifier configured${NC}"
# ============================================================================
# STEP 7: Create Startup Logo Display
# ============================================================================
echo -e "${GREEN}[+] Step 7: Creating startup logo display...${NC}"
sudo tee /usr/local/bin/nullsec-startup-logo > /dev/null << 'STARTUPLOGO'
#!/bin/bash
# Display NullSec Linux logo on terminal login
cat << "LOGO"
βββ== ββ==ββ== ββ==ββ== ββ== βββββββ==βββββββ== ββββββ==
ββββ== ββ|ββ| ββ|ββ| ββ| ββ====ββ====ββ====
ββ==ββ== ββ|ββ| ββ|ββ| ββ| βββββββ==βββββ== ββ|
ββ|==ββ==ββ|ββ| ββ|ββ| ββ| ==ββ|ββ==== ββ|
ββ| ==ββββ|==ββββββ====βββββββ==βββββββ==βββββββ|βββββββ====ββββββ==
==== ==== ==== ================ ====
L I N U X v1.0 - O F F E N S I V E S E C
[+] NULLSEC Framework: /home/antics/nullsec
[+] Run 'nullsec-fetch' for system info
[+] Run 'nullsec-info' for framework details
LOGO
STARTUPLOGO
sudo chmod +x /usr/local/bin/nullsec-startup-logo
# Add to bash profile if not already there
if ! grep -q "nullsec-startup-logo" ~/.bashrc; then
echo "" >> ~/.bashrc
echo "# NullSec Linux startup logo" >> ~/.bashrc
echo "/usr/local/bin/nullsec-startup-logo" >> ~/.bashrc
fi
echo -e "${GREEN} β Startup logo configured${NC}"
# ============================================================================
# STEP 8: Update Notification Daemon
# ============================================================================
echo -e "${GREEN}[+] Step 8: Configuring notification system...${NC}"
# Update notification-daemon branding if exists
if [ -d /usr/share/notification-daemon ]; then
sudo find /usr/share/notification-daemon -type f -name "*.xml" -exec \
sudo sed -i 's/Parrot/NullSec Linux/g' {} \; 2>/dev/null || true
fi
# Update any .desktop files mentioning Parrot in system directories
sudo find /usr/share/applications -type f -name "*.desktop" -exec \
sudo sed -i 's/Parrot Security/NullSec Linux/g' {} \; 2>/dev/null || true
echo -e "${GREEN} β Notification system updated${NC}"
# ============================================================================
# COMPLETION
# ============================================================================
echo ""
echo -e "${GREEN}====${NC}"
echo -e "${GREEN}| BOOT THEME & UPDATER SETUP COMPLETED! |${NC}"
echo -e "${GREEN}====${NC}"
echo ""
echo -e "${CYAN}Changes Made:${NC}"
echo -e " β Custom Plymouth boot splash (NullSec Linux theme)"
echo -e " β GRUB configured for quiet boot with splash"
echo -e " β Update notifier rebranded to NullSec Linux"
echo -e " β Startup logo displays on terminal login"
echo -e " β Update notifications show 'NullSec Linux'"
echo -e " β Desktop notifications rebranded"
echo ""
echo -e "${CYAN}New Features:${NC}"
echo -e " β’ Boot splash: NullSec Linux logo during startup"
echo -e " β’ Update check: ${RED}nullsec-update-check${NC}"
echo -e " β’ Startup logo: Displays on new terminal sessions"
echo -e " β’ Auto-update notifications with NullSec branding"
echo ""
echo -e "${YELLOW}[!] Reboot required to see boot splash:${NC}"
echo -e " ${RED}sudo reboot${NC}"
echo ""
echo -e "${CYAN}Test Boot Splash (Optional):${NC}"
echo -e " ${RED}sudo plymouthd --debug; sudo plymouth --show-splash${NC}"
echo -e " ${DIM}(Press Ctrl+C to exit test, then: sudo plymouth --quit)${NC}"
echo ""
echo -e "${GREEN}[+] Your system now displays NullSec Linux branding everywhere!${NC}"
echo ""