-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
404 lines (376 loc) · 21.3 KB
/
Copy pathindex.html
File metadata and controls
404 lines (376 loc) · 21.3 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>dotbashrc — Interactive .bashrc Customizer & Visualizer</title>
<meta name="description" content="Configure prompts, aliases, helper functions, and history settings interactively. Visualized in a live terminal simulator. Export a unified .bashrc config file instantly.">
<!-- SEO & OpenGraph Meta Tags -->
<meta property="og:title" content="dotbashrc — Interactive .bashrc Builder & Visualizer">
<meta property="og:description" content="Configure prompts, aliases, shell scripts, and behavior settings in a live terminal mockup.">
<meta property="og:type" content="website">
<!-- Google Fonts -->
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Fira+Code:wght@400;500;600;700&family=Outfit:wght@300;400;500;600;700;800&display=swap" rel="stylesheet">
<!-- Main Stylesheet -->
<link rel="stylesheet" href="style.css">
</head>
<body class="dark-mode">
<div id="app-wrapper">
<!-- Header -->
<header class="app-header">
<div class="header-logo">
<div class="logo-icon">🐚</div>
<div class="logo-text">
<h1>dotbashrc</h1>
<span class="logo-subtitle">Interactive .bashrc Builder & Visualizer</span>
</div>
</div>
<div class="header-controls">
<!-- Global Theme Toggle -->
<button id="btn-theme-toggle" class="icon-button" aria-label="Toggle light/dark theme" title="Toggle Light/Dark Theme">
<span class="theme-icon-dark">🌙</span>
<span class="theme-icon-light" style="display: none;">☀️</span>
</button>
<!-- Terminal Color Palette Selector -->
<div class="select-wrapper">
<label for="select-terminal-theme" class="sr-only">Terminal Theme</label>
<select id="select-terminal-theme" title="Select Terminal Theme">
<option value="dracula">Dracula (Dark)</option>
<option value="onedark">One Dark (Dark)</option>
<option value="nord">Nord (Dark)</option>
<option value="retro-green">Matrix Green (Retro)</option>
<option value="solarized-light">Solarized (Light)</option>
<option value="github-light">GitHub (Light)</option>
</select>
</div>
</div>
</header>
<!-- Main Content Grid -->
<main class="app-content">
<!-- Left Panel: Category Settings Dashboard -->
<section id="catalog-section" class="panel catalog-panel" aria-labelledby="catalog-title">
<div class="panel-header">
<h2 id="catalog-title">Configuration Dashboard</h2>
<span class="panel-badge" id="catalog-count">Settings</span>
</div>
<!-- Left Panel Category Navigation Tabs -->
<div class="category-tabs" role="tablist">
<button class="category-tab-btn active" data-target="panel-themes" title="Theme and PS1 selection" role="tab" aria-selected="true">🎨 Themes</button>
<button class="category-tab-btn" data-target="panel-variables" title="Custom variables like host/username" role="tab" aria-selected="false">⚙️ Vars</button>
<button class="category-tab-btn" data-target="panel-aliases" title="Command shortcuts" role="tab" aria-selected="false">🚀 Aliases</button>
<button class="category-tab-btn" data-target="panel-functions" title="Utility shell scripts" role="tab" aria-selected="false">📦 Funcs</button>
<button class="category-tab-btn" data-target="panel-options" title="Bash shell options" role="tab" aria-selected="false">🔧 Options</button>
</div>
<!-- Settings Content Area -->
<div class="category-content">
<!-- 1. Themes Tab Panel -->
<div class="category-panel-view active" id="panel-themes" role="tabpanel">
<div class="catalog-filters">
<div class="search-box">
<span class="search-icon">🔍</span>
<input type="text" id="search-templates" placeholder="Search prompts..." aria-label="Search prompt templates">
</div>
<div class="filter-tags" id="category-filters">
<button class="filter-btn active" data-category="all">All</button>
<button class="filter-btn" data-category="minimal">Minimal</button>
<button class="filter-btn" data-category="colorful">Colorful</button>
<button class="filter-btn" data-category="powerline">Powerline</button>
<button class="filter-btn" data-category="git">Git-Ready</button>
</div>
</div>
<!-- Scrollable templates container -->
<div class="templates-list" id="templates-list">
<!-- Dynamic rendering via JS -->
</div>
</div>
<!-- 2. Variables Tab Panel -->
<div class="category-panel-view" id="panel-variables" role="tabpanel" style="display: none;">
<div class="settings-scroll-box">
<div class="variables-form">
<div class="form-group">
<label for="input-username">Username (\u)</label>
<input type="text" id="input-username" value="guest" placeholder="e.g. guest">
</div>
<div class="form-group">
<label for="input-hostname">Hostname (\h)</label>
<input type="text" id="input-hostname" value="linux" placeholder="e.g. localhost">
</div>
<div class="form-group">
<label for="input-directory">Working Directory (\w)</label>
<input type="text" id="input-directory" value="~/projects/dotbashrc" placeholder="e.g. ~/dev/app">
</div>
<div class="form-group">
<label for="input-git-branch">Git Branch (Simulated)</label>
<div class="git-input-group">
<input type="text" id="input-git-branch" value="main" placeholder="e.g. main">
<label class="switch-toggle" title="Enable Git Branch in preview">
<input type="checkbox" id="toggle-git" checked>
<span class="slider"></span>
</label>
</div>
</div>
<div class="form-group">
<span class="label-text">Shell Status Indicator</span>
<div class="toggles-row-vertical">
<label class="toggle-control">
<input type="checkbox" id="toggle-root">
<span class="control-label">Root privileges (\$) - display '#'</span>
</label>
<label class="toggle-control">
<input type="checkbox" id="toggle-exit-code">
<span class="control-label">Last command failed exit status</span>
</label>
</div>
</div>
</div>
</div>
</div>
<!-- 3. Aliases Tab Panel -->
<div class="category-panel-view" id="panel-aliases" role="tabpanel" style="display: none;">
<div class="settings-scroll-box">
<div class="aliases-section">
<h3>Predefined Alias Bundles</h3>
<div class="toggles-row-vertical">
<label class="toggle-control">
<input type="checkbox" id="alias-group-git" checked>
<span class="control-label">Git Shortcuts (`g`, `gs`, `gp`, `gd`, `gcm`)</span>
</label>
<label class="toggle-control">
<input type="checkbox" id="alias-group-nav" checked>
<span class="control-label">Navigation Hacks (`..`, `...`, `ll`, `la`)</span>
</label>
<label class="toggle-control">
<input type="checkbox" id="alias-group-safe">
<span class="control-label">Safety Prompts (`rm -i`, `cp -i`, `mv -i`)</span>
</label>
</div>
<h3 class="section-title">Add Custom Alias</h3>
<div class="custom-alias-form">
<div class="input-row">
<input type="text" id="custom-alias-name" placeholder="Name (e.g. c)" aria-label="Alias name">
<span class="equals-symbol">=</span>
<input type="text" id="custom-alias-value" placeholder="Command (e.g. clear)" aria-label="Alias command">
</div>
<button type="button" id="btn-add-alias" class="panel-btn">Add Alias</button>
</div>
<h3 class="section-title">Custom Aliases</h3>
<div class="custom-aliases-list" id="custom-aliases-list">
<!-- Rendered dynamically by JS -->
</div>
</div>
</div>
</div>
<!-- 4. Functions Tab Panel -->
<div class="category-panel-view" id="panel-functions" role="tabpanel" style="display: none;">
<div class="settings-scroll-box">
<div class="functions-section">
<h3>Shell Functions</h3>
<p class="section-description">Toggle advanced shell utility functions to add to your bashrc configuration.</p>
<div class="functions-list">
<div class="function-item">
<div class="function-header">
<label class="toggle-control">
<input type="checkbox" id="fn-toggle-mkcd" checked>
<span class="control-label font-bold">mkcd</span>
</label>
</div>
<p class="function-desc">Creates a directory and immediately changes into it (e.g. <code>mkcd folder_name</code>).</p>
</div>
<div class="function-item">
<div class="function-header">
<label class="toggle-control">
<input type="checkbox" id="fn-toggle-extract" checked>
<span class="control-label font-bold">extract</span>
</label>
</div>
<p class="function-desc">A smart, universal extraction script that unpacks any zip/tar archive automatically based on extension.</p>
</div>
<div class="function-item">
<div class="function-header">
<label class="toggle-control">
<input type="checkbox" id="fn-toggle-weather">
<span class="control-label font-bold">weather</span>
</label>
</div>
<p class="function-desc">Fetches a clean command-line weather forecast summary from <code>wttr.in</code>.</p>
</div>
<div class="function-item">
<div class="function-header">
<label class="toggle-control">
<input type="checkbox" id="fn-toggle-todo">
<span class="control-label font-bold">todo</span>
</label>
</div>
<p class="function-desc">A lightweight, simple to-do list manager stored locally in <code>~/.todo.txt</code>.</p>
</div>
</div>
</div>
</div>
</div>
<!-- 5. Options Tab Panel -->
<div class="category-panel-view" id="panel-options" role="tabpanel" style="display: none;">
<div class="settings-scroll-box">
<div class="options-section">
<h3>Shell Behavior (shopt)</h3>
<div class="toggles-row-vertical">
<label class="toggle-control">
<input type="checkbox" id="opt-shopt-autocd" checked>
<span class="control-label">autocd (Cd automatically by typing dir name)</span>
</label>
<label class="toggle-control">
<input type="checkbox" id="opt-shopt-cdspell" checked>
<span class="control-label">cdspell (Autocorrect spelling errors in cd path)</span>
</label>
<label class="toggle-control">
<input type="checkbox" id="opt-shopt-globstar" checked>
<span class="control-label">globstar (Enable recursive ** globbing)</span>
</label>
</div>
<h3 class="section-title">Terminal History Rules</h3>
<div class="history-grid">
<div class="form-group">
<label for="input-histsize">Memory History Size (HISTSIZE)</label>
<input type="number" id="input-histsize" value="10000" min="0" max="1000000">
</div>
<div class="form-group">
<label for="input-histfilesize">File History Size (HISTFILESIZE)</label>
<input type="number" id="input-histfilesize" value="20000" min="0" max="1000000">
</div>
</div>
<div class="toggles-row-vertical" style="margin-top: 12px;">
<label class="toggle-control">
<input type="checkbox" id="opt-hist-ignoredups" checked>
<span class="control-label">Ignore consecutive duplicate entries</span>
</label>
<label class="toggle-control">
<input type="checkbox" id="opt-hist-ignorespace" checked>
<span class="control-label">Ignore commands starting with a space</span>
</label>
<label class="toggle-control">
<input type="checkbox" id="opt-hist-timestamp" checked>
<span class="control-label">Include timestamps in history output</span>
</label>
</div>
</div>
</div>
</div>
</div>
</section>
<!-- Right Panel: Terminal Preview & Customizer -->
<section id="workspace-section" class="panel workspace-panel">
<!-- Terminal Window Mockup -->
<div class="terminal-window" id="terminal-window" data-theme="dracula">
<div class="terminal-titlebar">
<div class="terminal-dots">
<span class="dot close"></span>
<span class="dot minimize"></span>
<span class="dot expand"></span>
</div>
<div class="terminal-title" id="terminal-window-title">bash — guest@linux: ~/projects</div>
<div class="terminal-actions">
<button id="btn-clear-terminal" class="terminal-action-btn" title="Clear terminal screen">Clear</button>
</div>
</div>
<!-- Terminal Screen Body -->
<div class="terminal-body" id="terminal-screen">
<!-- Simulated Scrollback History -->
<div id="terminal-history">
<div class="history-line text-muted">Welcome to the interactive Bash Prompt Visualizer.</div>
<div class="history-line text-muted">Type commands in the prompt below! Try "help", "ls", "git status", or "cowsay hello".</div>
</div>
<!-- Active Prompt Row -->
<div class="active-prompt-row">
<span class="prompt-container" id="terminal-prompt-preview"></span>
<span class="input-wrapper">
<span id="terminal-input-display"></span>
<span class="cursor" id="terminal-cursor"></span>
<input type="text" id="terminal-input" autocomplete="off" spellcheck="false" aria-label="Terminal input" autofocus>
</span>
</div>
</div>
</div>
<!-- Editor & Settings Controls -->
<div class="editor-controls">
<!-- Tab Headers -->
<div class="tabs-header" role="tablist">
<button class="tab-btn active" role="tab" aria-selected="true" aria-controls="tab-instructions" id="btn-tab-instructions">Export ~/.bashrc</button>
<button class="tab-btn" role="tab" aria-selected="false" aria-controls="tab-editor" id="btn-tab-editor">Raw PS1 Prompt Editor</button>
</div>
<!-- Tab Panels -->
<div class="tabs-content">
<!-- Tab 1: Instructions & Export -->
<div class="tab-panel active" id="tab-instructions" role="tabpanel" aria-labelledby="btn-tab-instructions">
<div class="export-container">
<div class="export-block">
<div class="export-header">
<span>Generated ~/.bashrc Code Block</span>
<button id="btn-copy-export" class="copy-btn">Copy to Clipboard</button>
</div>
<pre class="export-code"><code id="code-export-output"># Loading...</code></pre>
</div>
<div class="instruction-steps">
<h3>How to Apply:</h3>
<ol>
<li>Open your terminal.</li>
<li>Open your bash configuration file in an editor: <code>nano ~/.bashrc</code></li>
<li>Scroll to the bottom of the file and paste the copied block of code.</li>
<li>Save and close the file (in nano, press <code>Ctrl+O</code>, <code>Enter</code>, then <code>Ctrl+X</code>).</li>
<li>Apply the changes immediately by running: <code>source ~/.bashrc</code></li>
</ol>
</div>
</div>
</div>
<!-- Tab 2: Raw PS1 Editor -->
<div class="tab-panel" id="tab-editor" role="tabpanel" aria-labelledby="btn-tab-editor" style="display: none;">
<div class="editor-layout">
<div class="editor-textarea-wrapper">
<label for="input-ps1" class="sr-only">Raw PS1 String</label>
<textarea id="input-ps1" spellcheck="false" aria-label="Raw PS1 Value">\[\e[01;32m\]\u@\h\[\e[00m\]:\[\e[01;34m\]\w\[\e[00m\]\$ </textarea>
</div>
<!-- Quick Insertion Bar -->
<div class="editor-shortcuts">
<div class="shortcut-group">
<span class="shortcut-group-label">Macros:</span>
<button class="btn-insert" data-value="\u" title="Insert username">Username</button>
<button class="btn-insert" data-value="\h" title="Insert hostname">Host</button>
<button class="btn-insert" data-value="\w" title="Insert full working directory path">Dir (Full)</button>
<button class="btn-insert" data-value="\W" title="Insert working directory base name">Dir (Base)</button>
<button class="btn-insert" data-value="\t" title="Insert current time (HH:MM:SS)">Time</button>
<button class="btn-insert" data-value="\$" title="Insert '$' (or '#' for root)">Symbol</button>
<button class="btn-insert" data-value="\n" title="Insert newline character">Newline</button>
</div>
<div class="shortcut-group">
<span class="shortcut-group-label">Colors:</span>
<button class="btn-insert color-badge bg-reset" data-value="\[\e[00m\]" title="Reset text color/formatting">Reset</button>
<button class="btn-insert color-badge bg-green" data-value="\[\e[01;32m\]" title="Bold Green text">Green</button>
<button class="btn-insert color-badge bg-blue" data-value="\[\e[01;34m\]" title="Bold Blue text">Blue</button>
<button class="btn-insert color-badge bg-cyan" data-value="\[\e[01;36m\]" title="Bold Cyan text">Cyan</button>
<button class="btn-insert color-badge bg-yellow" data-value="\[\e[01;33m\]" title="Bold Yellow text">Yellow</button>
<button class="btn-insert color-badge bg-magenta" data-value="\[\e[01;35m\]" title="Bold Magenta text">Magenta</button>
<button class="btn-insert color-badge bg-red" data-value="\[\e[01;31m\]" title="Bold Red text">Red</button>
</div>
</div>
<!-- Live PS1 Breakdown Inspector -->
<div class="inspector-section">
<h4>Prompt Inspector & Syntax Breakdown</h4>
<div class="inspector-elements" id="ps1-breakdown">
<!-- Dynamic breakdown via JS -->
</div>
</div>
</div>
</div>
</div>
</div>
</section>
</main>
<!-- Footer -->
<footer class="app-footer">
<p>© 2026 dotbashrc. Designed with Premium Terminal Aesthetics.</p>
</footer>
</div>
<!-- App Main Logic Script -->
<script src="app.js"></script>
</body>
</html>