-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
463 lines (435 loc) · 29.8 KB
/
index.html
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
<!DOCTYPE html>
<html>
<head>
<title>bash PS1</title>
<link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"/>
<link rel="stylesheet" type="text/css" href="style.css"/>
</head>
<body>
<a href="https://github.com/dom111/bash-ps1" class="github-corner" aria-label="View source on Github"><svg width="80" height="80" viewBox="0 0 250 250" style="fill:#C7254E; color:#F9F2F4; position: fixed; top: 0; border: 0; right: 0;" aria-hidden="true"><path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path><path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2" fill="currentColor" style="transform-origin: 130px 106px;" class="octo-arm"></path><path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z" fill="currentColor" class="octo-body"></path></svg></a><style>.github-corner:hover .octo-arm{animation:octocat-wave 560ms ease-in-out}@keyframes octocat-wave{0%,100%{transform:rotate(0)}20%,60%{transform:rotate(-25deg)}40%,80%{transform:rotate(10deg)}}@media (max-width:500px){.github-corner:hover .octo-arm{animation:none}.github-corner .octo-arm{animation:octocat-wave 560ms ease-in-out}}</style>
<div class="jumbotron">
<div class="container">
<h1>bash <code>PS1</code> <span class="version" title="Last updated: 2017-04-10">v0.3</span></h1>
<p>Paste in your existing <code>PS1</code> string to help understand what each of the blocks does.</p>
<p>Add the items you want displayed and style them, with a live preview of how it'll (hopefully) look in your terminal emulator!</p>
</div>
</div>
<div class="container">
<section class="parser panel panel-primary">
<div class="panel-heading panel-heading-lg">
<h2 class="panel-title panel-title-lg">Parser</h2>
</div>
<div class="panel-body">
<div class="form-group label-floating">
<label for="input" class="control-label">Paste your <code><abbr title="Run echo $PS1 in your terminal to see your current prompt.">PS1</abbr></code>, or load an example: <a href="#load" class="load-example" data-content="[\u@\h \W]\$ ">default</a>, <a href="#load" class="load-example" data-content="\[\e[38;5;81m\]\u\[\e[38;5;141m\]@\[\e[38;5;154m\]\h\[\e[38;5;186m\]$(__git_ps1 " [%s]") \[\e[38;5;197m\]\w \[\e[38;5;141m\]\$\[\e[0m\]">monokai-based</a><!--, <a href="#load" class="load-example" data-content="\[\e[48;5;81m\]\[\e[30m\] \u \[\e[38;5;81m\]\[\e[48;5;154m\]▶\[\e[30m\] \h \[\e[38;5;154m\]\[\e[48;5;186m\]▶\[\e[30m\] $(__git_ps1 "%s") \[\e[38;5;186m\]\[\e[48;5;197m\]▶\[\e[30m\] \w \[\e[38;5;197m\]\[\e[48;5;141m\]▶\[\e[30m\] \$ \[\e[38;5;141m\]\[\e[49m\]▶ \[\e[39m\]">powerline/monokai style</a>-->.</label>
<pre class="terminal blink-cursor cursor-pipe colours-256" contenteditable="true"></pre>
</div>
<div class="form-group label-floating">
<label class="control-label">Copy the below into your terminal to test, or paste into your <code>.bashrc</code> to make permanent.</label>
<pre class="copy-paste"><code>export PS1='<span class="contents"></span>';</code><a href="#copy" class="copy btn btn-xs btn-primary" data-clipboard-target="pre.copy-paste code">Copy</a></pre>
</div>
<div class="form-group">
<div class="row">
<div class="col-md-2">
<a href="#" class="share btn btn-lg btn-primary">Share this style...</a>
</div>
<div class="col-md-10">
<span class="url-copied help-block hidden">URL copied to clipboard!</span>
</div>
</div>
</div>
</div>
<div class="panel-footer">
<aside class="options">
<h3>Options</h3>
<div class="global-options">
<div class="form-group">
<div class="checkbox">
<label>
<input type="checkbox" name="root" value="1"> Super user?
</label>
</div>
<p class="help-block">Toggle being root on or off.</p>
</div>
<div class="form-group">
<div class="checkbox">
<label>
<input type="checkbox" name="blink-cursor" value="1" checked> Blink cursor?
</label>
</div>
</div>
<div class="form-group">
<div class="checkbox">
<label>
<input type="checkbox" name="light" value="1"> Light terminal
</label>
</div>
<p class="help-block">White background, black text.</p>
</div>
<!--
<div class="form-group">
<div class="checkbox">
<label>
<input type="checkbox" name="powerline"> Use Powerline font
</label>
</div>
<p class="help-block">You need to be using this font in your terminal emulator too!</p>
</div>
-->
<!--
<div class="form-group">
<div class="checkbox">
<label>
<input type="checkbox" name="bright"> Bold means bright.
</label>
</div>
<p class="help-block">In some terminals, instead of bold fonts, brighter colours are used</p>
</div>
-->
<h4>Colours</h4>
<div class="form-group">
<div class="radio">
<label>
<input type="radio" name="colours" value="16">
16
</label>
</div>
<div class="radio">
<label>
<input type="radio" name="colours" value="256" checked>
256
</label>
</div>
<div class="radio">
<label>
<input type="radio" name="colours" value="true">
True colour
</label>
</div>
</div>
<!--
<div class="form-group">
<label>
<input type="range" name="opacity" min="0" max="1" value="1" step="0.01" class="form-control"> My terminal isn't opaque!
</label>
<p class="help-block">This slider adjusts the opacity of the element, to simlulate your transparency.</p>
</div>
-->
<h4 title="I hate the pipe cursor! Give me the underscore!">Cursor type</h4>
<div class="form-group">
<div class="radio">
<label>
<input type="radio" name="cursor" value="pipe" checked>
Pipe (<code>|</code>)
</label>
</div>
<div class="radio">
<label>
<input type="radio" name="cursor" value="underscore">
Underscore (<code>_</code>)
</label>
</div>
<div class="radio">
<label>
<input type="radio" name="cursor" value="block">
Block (<code>█</code>)
</label>
</div>
</div>
</div>
<div class="specific-options">
<h4 title="I need specific escapes for my terminal (or I'm just controlling)">Escape options</h4>
<div class="form-group">
<button class="btn btn-primary convert-escape" data-value="\x1b">Convert to <code>\x1b</code></button>
<button class="btn btn-primary convert-escape" data-value="\033">Convert to <code>\033</code></button>
<button class="btn btn-primary convert-escape" data-value="\e">Convert to <code>\e</code></button>
<!-- <button class="btn btn-primary convert-escape" data-value="">Convert to literal escape</button> -->
</div>
<h4 title="I hate when my terminal gets confused in the middle of the line...">Wrap Styling</h4>
<p>This sets all styling escape sequences as zero-length preventing most weirdness when your cursor wraps at the end of the line.
<div class="form-group">
<button class="btn btn-primary wrap-styling" data-prefix="\[" data-suffix="\]"><code>\[</code>...<code>\]</code></button>
</div>
</div>
</aside>
</div>
</section>
<section class="builder panel panel-default">
<div class="panel-heading panel-heading-lg">
<h2 class="panel-title panel-title-lg">Breakdown</h2>
</div>
<div class="panel-body">
<div class="sources panel btn-group" role="group">
<a class="draggable btn btn-primary" draggable="true" data-type="styling">Styling</a>
<a class="draggable btn btn-primary" draggable="true" data-type="token">Token</a>
<a class="draggable btn btn-primary" draggable="true" data-type="text">Plain Text</a>
<a class="draggable btn btn-primary" draggable="true" data-type="command">External Action</a>
<!-- <a class="draggable btn btn-primary" draggable="true" data-type="hex">Hex</a> -->
<!-- <a class="draggable btn btn-primary" draggable="true" data-type="octal">Octal</a> -->
</div>
<div class="blocks row"></div>
<div class="templates hidden">
<div class="block styling col-md-3" data-type="styling">
<div class="panel panel-default">
<!-- <div class="panel-heading" draggable="true"> -->
<div class="panel-heading">
<h3 class="panel-title pull-left">Styling</h3>
<a href="#delete-block" class="btn btn-xs btn-danger delete-block pull-right"><span class="glyphicon glyphicon-remove"></span> Delete</a>
</div>
<div class="panel-body">
<div class="form-group">
<label>Background</label>
<div class="checkbox">
<label>
<input type="checkbox" name="bg-default" value="49"> Default
</label>
</div>
<input type="color" name="bg" class="form-control colorpicker" placeholder="Default">
</div>
<div class="form-group">
<label>Text</label>
<div class="checkbox">
<label>
<input type="checkbox" name="fg-default" value="39"> Default
</label>
</div>
<input type="color" name="fg" class="form-control colorpicker" placeholder="Default">
</div>
<div class="row">
<div class="col-md-6 bold">
<div class="checkbox">
<label>
<input type="checkbox" name="bold"> Bold
</label>
</div>
</div>
<div class="col-md-6">
<div class="checkbox">
<label>
<input type="checkbox" name="dim"> Dim
</label>
</div>
</div>
<div class="col-md-6">
<div class="checkbox">
<label>
<input type="checkbox" name="italic"> Italic
</label>
</div>
</div>
<div class="col-md-6">
<div class="checkbox">
<label>
<input type="checkbox" name="underline"> Underline
</label>
</div>
</div>
<div class="col-md-6">
<div class="checkbox">
<label>
<input type="checkbox" name="overline"> Overline
</label>
</div>
</div>
<div class="col-md-6">
<div class="checkbox">
<label>
<input type="checkbox" name="strikethrough"> Strikethrough
</label>
</div>
</div>
<div class="col-md-6">
<div class="checkbox">
<label>
<input type="checkbox" name="blink"> Blink
</label>
</div>
</div>
<div class="col-md-6">
<div class="checkbox">
<label>
<input type="checkbox" name="invert"> Invert
</label>
</div>
</div>
<div class="col-md-6">
<div class="checkbox">
<label>
<input type="checkbox" name="hidden"> Hidden
</label>
</div>
</div>
<div class="col-md-6">
<div class="checkbox">
<label>
<input type="checkbox" name="wrap"> <abbr title="This prevents issues with line wrapping in terminal emulators.">Wrap</abbr>
</label>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="block stylingReset col-md-3" data-type="stylingReset">
<div class="panel panel-default">
<!-- <div class="panel-heading" draggable="true"> -->
<div class="panel-heading">
<h3 class="panel-title pull-left">Styling Reset</h3>
<a href="#delete-block" class="btn btn-xs btn-danger delete-block pull-right"><span class="glyphicon glyphicon-remove"></span> Delete</a>
</div>
<input type="hidden" name="value">
</div>
</div>
<div class="block command col-md-3" data-type="command">
<div class="panel panel-default">
<!-- <div class="panel-heading" draggable="true"> -->
<div class="panel-heading">
<h3 class="panel-title pull-left">External Action</h3>
<a href="#delete-block" class="btn btn-xs btn-danger delete-block pull-right"><span class="glyphicon glyphicon-remove"></span> Delete</a>
</div>
<div class="panel-body">
<div class="form-group">
<label>Command</label>
<input type="text" name="value" class="form-control">
</div>
<div class="row">
<div class="col-md-6">
<div class="checkbox">
<label>
<input type="checkbox" name="wrap"> <abbr title="Check this when the command has no output to prevent issues with line wrapping in terminal emulators.">Wrap</abbr>
</label>
</div>
</div>
</div>
</div>
<div class="panel-footer">
<p class="help-block">Click on the block's definition in the preview area to set a preview.</p>
</div>
</div>
</div>
<div class="block token col-md-3" data-type="token">
<div class="panel panel-default">
<!-- <div class="panel-heading" draggable="true"> -->
<div class="panel-heading">
<h3 class="panel-title pull-left">Token</h3>
<a href="#delete-block" class="btn btn-xs btn-danger delete-block pull-right"><span class="glyphicon glyphicon-remove"></span> Delete</a>
</div>
<div class="panel-body">
<div class="form-group">
<select name="value" class="form-control">
<option></option>
<option value=" ">Space</option>
<option value="\!">History number (125)</option>
<option value="\#">Command number (126)</option>
<option value="\$"># if root, $ otherwise</option>
<option value="\\">Backslash (\)</option>
<option value="\a">Bell (\a)</option>
<option value="\d">Date (Tue Aug 26)</option>
<option value="\h">Hostname (hostname)</option>
<option value="\H">Full hostname (hostname.domain.com)</option>
<option value="\j">Current jobs (0)</option>
<option value="\l">Terminal device name (ttys001)</option>
<option value="\n">Newline (\n)</option>
<option value="\s">Name of the shell (-bash)</option>
<option value="\t">Time (13:26:52)</option>
<option value="\T">Time (01:26:52)</option>
<option value="\@">Time (01:26 pm)</option>
<option value="\u">Username (username)</option>
<option value="\v">Bash version (3.2)</option>
<option value="\V">Bash release (3.2.57)</option>
<option value="\W">Current directory (path)</option>
<option value="\w">Current path (/full/path)</option>
</select>
</div>
</div>
<div class="panel-footer">
<p class="help-block">Click on the block's definition in the preview area to set a preview.</p>
</div>
</div>
</div>
<div class="block text col-md-3" data-type="text">
<div class="panel panel-default">
<!-- <div class="panel-heading" draggable="true"> -->
<div class="panel-heading">
<h3 class="panel-title pull-left">Plain Text</h3>
<a href="#delete-block" class="btn btn-xs btn-danger delete-block pull-right"><span class="glyphicon glyphicon-remove"></span> Delete</a>
</div>
<div class="panel-body">
<div class="form-group">
<label>Text</label>
<input type="text" name="value" class="form-control">
</div>
</div>
</div>
</div>
<div class="block hex col-md-3" data-type="hex">
<div class="panel panel-default">
<!-- <div class="panel-heading" draggable="true"> -->
<div class="panel-heading">
<h3 class="panel-title pull-left">Hex Character</h3>
<a href="#delete-block" class="btn btn-xs btn-danger delete-block pull-right"><span class="glyphicon glyphicon-remove"></span> Delete</a>
</div>
<div class="panel-body">
<div class="form-group">
<label>Character</label>
<input type="text" name="value" class="form-control">
</div>
</div>
</div>
</div>
<div class="octal col-md-3" data-type="octal">
<div class="panel panel-default">
<!-- <div class="panel-heading" draggable="true"> -->
<div class="panel-heading">
<h3 class="panel-title pull-left">Octal Character</h3>
<a href="#delete-block" class="btn btn-xs btn-danger delete-block pull-right"><span class="glyphicon glyphicon-remove"></span> Delete</a>
</div>
<div class="panel-body">
<div class="form-group">
<label>Character</label>
<input type="text" name="value" class="form-control">
</div>
</div>
</div>
</div>
<div class="block variable col-md-3" data-type="variable">
<div class="panel panel-default">
<!-- <div class="panel-heading" draggable="true"> -->
<div class="panel-heading">
<h3 class="panel-title pull-left">Variable</h3>
<a href="#delete-block" class="btn btn-xs btn-danger delete-block pull-right"><span class="glyphicon glyphicon-remove"></span> Delete</a>
</div>
<div class="panel-body">
<div class="form-group">
<label>Variable</label>
<input type="text" name="value" class="form-control">
</div>
</div>
<div class="panel-footer">
<p class="help-block">Click on the block's definition in the preview area to set a preview.</p>
</div>
</div>
</div>
</div>
</div>
</section>
<footer>
<p>Copyright © 2017 <a href="https://dom.hastin.gs/">Dom Hastings</a></p>
</footer>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/1.6.0/clipboard.min.js"></script>
<script type="text/javascript" src="terminal-preview/dist/terminal-min.js"></script>
<script type="text/javascript" src="terminal-preview/dist/parse-min.js"></script>
<script type="text/javascript" src="app.js"></script>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-5273748-7', 'auto');
ga('send', 'pageview');
</script>
</body>
</html>