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
|
Module TerminalInternalApps
Public Sub Cowsay_Say(Say As String)
Select Case Say.Length
Case 1 To 40
Dim SubtractLength As Integer = Say.Length + 1
NewLine(" ")
Do
AddLine("_")
SubtractLength = SubtractLength - 1
If SubtractLength = 0 Then
AddLine("_")
SubtractLength = Say.Length + 1
Exit Do
End If
Loop
NewLine("< " & Say & " >")
NewLine(" ")
Do
AddLine("-")
SubtractLength = SubtractLength - 1
If SubtractLength = 0 Then
AddLine("-")
SubtractLength = Say.Length + 1
Exit Do
End If
Loop
NewLine(" \ ^__^")
NewLine(" \ (oo)\_______")
NewLine(" (__)\ )\/\")
NewLine(" ||----w |")
NewLine(" || ||")
Case 41 To 80
NewLine(" __________________________________________ ")
NewLine("/ " & Say.Substring(0, 40) & " \")
Say = Say.Substring(40, Say.Length - 40)
NewLine("\ " & Say)
Dim Spaces As Integer = 40 - Say.Length
Do
AddLine(" ")
If Spaces = 0 Then
AddLine("/")
Exit Do
End If
Spaces = Spaces - 1
Loop
NewLine(" ------------------------------------------ ")
NewLine(" \ ^__^")
NewLine(" \ (oo)\_______")
NewLine(" (__)\ )\/\")
NewLine(" ||----w |")
NewLine(" || ||")
Case >= 81
NewLine("cowsay: Character limit exceeded")
'Dim SubtractLength As Integer = Say.Length + 1
'Terminal.TextBox1.Text = Terminal.TextBox1.Text & Environment.NewLine & " __________________________________________ "
'Terminal.TextBox1.Text = Terminal.TextBox1.Text & Environment.NewLine & "/ " & Say.Substring(0, 40) & " \"
'Dim CurrentLength As Integer = 40
'Dim WhatSay As String
'Dim Spaces As Integer
'Do
' Try
' WhatSay = Say.Substring(CurrentLength, 40)
' Catch ex As Exception
' WhatSay = Say.Substring(CurrentLength, (CurrentLength + 40) - Say.Length)
' End Try
' Spaces = 40 - WhatSay.Length
' If Spaces > 0 Then
' Terminal.TextBox1.Text = Terminal.TextBox1.Text & Environment.NewLine & "\ " & WhatSay
' Do
' Terminal.TextBox1.Text = Terminal.TextBox1.Text & " "
' If Spaces = 0 Then
' Terminal.TextBox1.Text = Terminal.TextBox1.Text & "/"
' Exit Do
' End If
' Spaces = Spaces - 1
' Loop
' Exit Do
' Else
' Terminal.TextBox1.Text = Terminal.TextBox1.Text & Environment.NewLine & "| " & WhatSay & " |"
' CurrentLength = CurrentLength + 40
' End If
'Loop
End Select
End Sub
Public Sub Help()
NewLine("ShiftOS Help Manual")
NewLine(Nothing)
NewLine("You can type 'help' to get all available commands and its corresponding action.")
If Strings.AvailableFeature(0) = 1 Then
NewLine("To get help on each command, you can type 'man [command]'")
NewLine(Nothing)
Else
NewLine(Nothing)
End If
If Strings.AvailableFeature(9) = 1 Then
NewLine("BC Basic Calculator for simple calculation")
End If
If Strings.AvailableFeature(16) = 1 Then
NewLine("CD Changes directory to a selected one")
End If
If Strings.AvailableFeature(1) = 1 Then
NewLine("CLEAR Clear the terminal")
End If
NewLine("CODEPOINT Display Codepoint(s) from your wallet")
NewLine("COLOR Changes Terminal Text And Background color To the corresponding choice")
NewLine("COLORS Shows available colors support For the terminal")
If Strings.AvailableFeature(22) = 1 Then
NewLine("COWSAY Spawn a cow And saying anything you want")
End If
If Strings.AvailableFeature(24) = 1 Then
NewLine("DATE Displays date in days since first day of the year format")
ElseIf Strings.AvailableFeature(24) = 3 Then
If Strings.AvailableFeature(25) = 1 Then
NewLine("DATE Displays date in weeks since first week of the year format")
ElseIf Strings.AvailableFeature(25) = 3 Then
If Strings.AvailableFeature(26) = 1 Then
NewLine("DATE Displays date in months since first month of the year format")
ElseIf Strings.AvailableFeature(26) = 3 Then
If Strings.AvailableFeature(27) = 1 Then
NewLine("DATE Displays date in year format format")
ElseIf Strings.AvailableFeature(27) = 3 Then
If Strings.AvailableFeature(28) = 1 Then
NewLine("DATE Displays date in MM/YYYY format")
ElseIf Strings.AvailableFeature(28) = 3 Then
If Strings.AvailableFeature(29) = 1 Then
NewLine("DATE Displays date in general DD/MM/YYYY format")
End If
End If
End If
End If
End If
End If
If Strings.AvailableFeature(16) = 1 Then
NewLine("DEL Delete a selected file from the directory")
NewLine("DIR Displays subdirectories And files In a directory")
End If
NewLine("GUESS Runs 'Guess the Number' application")
NewLine("HELP Shows all commands available and its corresponding action")
If Strings.AvailableFeature(20) = 1 Then
NewLine("HOSTNAME Sets the name of current hostname/computer name with a new one")
End If
If Strings.AvailableFeature(4) = 1 Then
NewLine("INFOBAR Displays informations about current session such as current app, current user, current time, etc.")
End If
If Strings.AvailableFeature(0) = 1 Then
NewLine("MAN Shows a command, its corresponding action, and its example usage")
End If
If Strings.AvailableFeature(16) = 1 Then
NewLine("MKDIR Creating a directory")
End If
If Strings.AvailableFeature(16) = 1 Then
NewLine("PWD Display current directory navigated on ShiftOS")
End If
If Strings.AvailableFeature(2) = 1 Then
NewLine("PRINT Prints a corresponding text entered in the command")
End If
NewLine("REBOOT Terminate and re-run ShiftOS session")
If Strings.AvailableFeature(21) = 1 Then
NewLine("REV Turn any sentences you want and making it reversed")
End If
If Strings.AvailableFeature(16) = 1 Then
NewLine("RMDIR Deleting a directory")
End If
If Strings.AvailableFeature(8) = 1 Then
NewLine("SHIFTFETCH Shows informations about your computer")
End If
NewLine("SHIFTORIUM A software center for upgrading features on ShiftOS")
NewLine("SHUTDOWN Terminate ShiftOS session")
NewLine("SU Runs terminal as super user")
If Strings.AvailableFeature(17) = 1 Then
NewLine("TEXTPAD Simple text-editor for ShiftOS")
End If
If Strings.AvailableFeature(5) = 1 Then
NewLine("TIME Display the current time in the form of seconds since midnight")
ElseIf Strings.AvailableFeature(5) = 3 Then
If Strings.AvailableFeature(6) = 1 Then
NewLine("TIME Display the current time in the form of minutes since midnight")
ElseIf Strings.AvailableFeature(6) = 3 Then
If Strings.AvailableFeature(7) = 1 Then
NewLine("TIME Display the current time in the form of hours since midnight")
ElseIf Strings.AvailableFeature(7) = 3 Then
If Strings.AvailableFeature(12) = 1 Then
NewLine("TIME Display the current time in the form of PM and AM format")
End If
End If
End If
End If
If Strings.AvailableFeature(20) = 1 Then
NewLine("USERNAME Sets the name of current user with a new one")
End If
NewLine("VER Printing current version of ShiftOS TheRevival")
End Sub
Public Sub Manual(Command As String)
'MAN command starts with this kinda format
'ShiftOS Help Manual
'
''command' Usage: [switch/value if needed]
'
'Summary of the command's action
'
'Example usage : command
NewLine("ShiftOS Help Manual")
NewLine(Nothing)
'Terminal.TextBox1.Text = Terminal.TextBox1.Text & Environment.NewLine & command.Substring(4)
Dim mancommand As String = Command.Replace("man ", "")
Dim TempUsage As String = "'" & mancommand & "' Usage: "
Select Case mancommand
'In process to convert every command from printing from code to printing from text file
Case "bc"
If Strings.AvailableFeature(9) = "1" Then
TempUsage = TempUsage & "bc"
Console.TextBox1.Text = Console.TextBox1.Text & TempUsage & Environment.NewLine & Environment.NewLine & My.Resources.man_bc & Environment.NewLine
Console.BadCommand = False
End If
Case "cd"
If Strings.AvailableFeature(16) = "1" Then
TempUsage = TempUsage & "cd [DIRECTORY]"
Console.TextBox1.Text = Console.TextBox1.Text & TempUsage & Environment.NewLine & Environment.NewLine & My.Resources.man_cd & Environment.NewLine
Console.BadCommand = False
End If
Case "clear"
If Strings.AvailableFeature(1) = "1" Then
TempUsage = TempUsage & "clear"
Console.TextBox1.Text = Console.TextBox1.Text & TempUsage & Environment.NewLine & Environment.NewLine & My.Resources.man_clear & Environment.NewLine
Console.BadCommand = False
End If
Case "color"
TempUsage = TempUsage & "color [bg][fg]"
Console.TextBox1.Text = Console.TextBox1.Text & TempUsage & Environment.NewLine & Environment.NewLine & My.Resources.man_color & Environment.NewLine
Console.BadCommand = False
Case "colors"
TempUsage = TempUsage & "colors"
Console.TextBox1.Text = Console.TextBox1.Text & TempUsage & Environment.NewLine & Environment.NewLine & My.Resources.man_colors & Environment.NewLine
Console.BadCommand = False
Case "cowsay"
If Strings.AvailableFeature(22) = 1 Then
TempUsage = TempUsage & "cowsay [STRING]"
Console.TextBox1.Text = Console.TextBox1.Text & TempUsage & Environment.NewLine & Environment.NewLine & My.Resources.man_cowsay & Environment.NewLine
Console.BadCommand = False
End If
Case "codepoint"
TempUsage = TempUsage & "codepoint"
Console.TextBox1.Text = Console.TextBox1.Text & TempUsage & Environment.NewLine & Environment.NewLine & My.Resources.man_codepoint & Environment.NewLine
Console.BadCommand = False
Case "del"
If Strings.AvailableFeature(16) = 1 Then
TempUsage = TempUsage & "del [FILENAME.TXT]"
Console.TextBox1.Text = Console.TextBox1.Text & TempUsage & Environment.NewLine & Environment.NewLine & My.Resources.man_del & Environment.NewLine
Console.BadCommand = False
End If
Case "dir"
If Strings.AvailableFeature(16) = "1" Then
TempUsage = TempUsage & "dir"
Console.TextBox1.Text = Console.TextBox1.Text & TempUsage & Environment.NewLine & Environment.NewLine & My.Resources.man_dir & Environment.NewLine
Console.BadCommand = False
End If
Case "guess"
TempUsage = TempUsage & "guess"
Console.TextBox1.Text = Console.TextBox1.Text & TempUsage & Environment.NewLine & Environment.NewLine & My.Resources.man_guess & Environment.NewLine
Console.BadCommand = False
Case "help"
TempUsage = TempUsage & "help"
Console.TextBox1.Text = Console.TextBox1.Text & TempUsage & Environment.NewLine & Environment.NewLine & My.Resources.man_help & Environment.NewLine
Console.BadCommand = False
Case "hostname"
If Strings.AvailableFeature(20) = 1 Then
TempUsage = TempUsage & "hostname [HOSTNAME]"
Console.TextBox1.Text = Console.TextBox1.Text & TempUsage & Environment.NewLine & Environment.NewLine & My.Resources.man_hostname & Environment.NewLine
Console.BadCommand = False
End If
Case "infobar"
If Strings.AvailableFeature(4) = 1 Then
TempUsage = TempUsage & "infobar [ON|OFF] [OPTION]"
Console.TextBox1.Text = Console.TextBox1.Text & TempUsage & Environment.NewLine & Environment.NewLine & My.Resources.man_infobar & Environment.NewLine
Console.BadCommand = False
End If
Case "man"
If Strings.AvailableFeature(0) = "1" Then
TempUsage = TempUsage & "man [command]"
Console.TextBox1.Text = Console.TextBox1.Text & TempUsage & Environment.NewLine & Environment.NewLine & My.Resources.man_man & Environment.NewLine
Console.BadCommand = False
End If
Case "mkdir"
If Strings.AvailableFeature(16) = "1" Then
TempUsage = TempUsage & "mkdir [DIRECTORY]"
Console.TextBox1.Text = Console.TextBox1.Text & TempUsage & Environment.NewLine & Environment.NewLine & My.Resources.man_mkdir & Environment.NewLine
Console.BadCommand = False
End If
Case "print"
If Strings.AvailableFeature(2) = "1" Then
TempUsage = TempUsage & "print [text]"
Console.TextBox1.Text = Console.TextBox1.Text & TempUsage & Environment.NewLine & Environment.NewLine & My.Resources.man_print & Environment.NewLine
Console.BadCommand = False
End If
Case "pwd"
If Strings.AvailableFeature(16) = "1" Then
TempUsage = TempUsage & "pwd"
Console.TextBox1.Text = Console.TextBox1.Text & TempUsage & Environment.NewLine & Environment.NewLine & My.Resources.man_pwd & Environment.NewLine
Console.BadCommand = False
End If
Case "reboot"
TempUsage = TempUsage & "reboot"
Console.TextBox1.Text = Console.TextBox1.Text & TempUsage & Environment.NewLine & Environment.NewLine & My.Resources.man_reboot & Environment.NewLine
Console.BadCommand = False
Case "rmdir"
If Strings.AvailableFeature(16) = "1" Then
TempUsage = TempUsage & "rmdir [DIRECTORY]"
Console.TextBox1.Text = Console.TextBox1.Text & TempUsage & Environment.NewLine & Environment.NewLine & My.Resources.man_rmdir & Environment.NewLine
Console.BadCommand = False
End If
Case "shiftfetch"
If Strings.AvailableFeature(8) = "1" Then
TempUsage = TempUsage & "shiftfetch"
Console.TextBox1.Text = Console.TextBox1.Text & TempUsage & Environment.NewLine & Environment.NewLine & My.Resources.man_shiftfetch & Environment.NewLine
Console.BadCommand = False
End If
Case "shiftorium"
TempUsage = TempUsage & "shiftorium [option] [featureName]"
Console.TextBox1.Text = Console.TextBox1.Text & TempUsage & Environment.NewLine & Environment.NewLine & My.Resources.man_shiftorium & Environment.NewLine
Console.BadCommand = False
Case "shutdown"
TempUsage = TempUsage & "shutdown"
Console.TextBox1.Text = Console.TextBox1.Text & TempUsage & Environment.NewLine & Environment.NewLine & My.Resources.man_shutdown & Environment.NewLine
Console.BadCommand = False
Case "textpad"
If Strings.AvailableFeature(17) = "1" Then
TempUsage = TempUsage & "textpad [FILENAME.TXT]"
Console.TextBox1.Text = Console.TextBox1.Text & TempUsage & Environment.NewLine & Environment.NewLine & My.Resources.man_textpad & Environment.NewLine
Console.BadCommand = False
End If
Case "time"
If Strings.AvailableFeature(17) = "1" Then
TempUsage = TempUsage & "time"
Console.TextBox1.Text = Console.TextBox1.Text & TempUsage & Environment.NewLine & Environment.NewLine & My.Resources.man_time & Environment.NewLine
Console.BadCommand = False
End If
Case "username"
If Strings.AvailableFeature(19) = "1" Then
TempUsage = TempUsage & "username"
Console.TextBox1.Text = Console.TextBox1.Text & TempUsage & Environment.NewLine & Environment.NewLine & My.Resources.man_username & Environment.NewLine
Console.BadCommand = False
End If
Case "ver"
TempUsage = TempUsage & "ver"
Console.TextBox1.Text = Console.TextBox1.Text & TempUsage & Environment.NewLine & Environment.NewLine & My.Resources.man_ver & Environment.NewLine
Console.BadCommand = False
Case Else
NewLine("MAN : Invalid command")
End Select
End Sub
Public Sub Shiftfetch()
If Strings.OnceInfo(0) = "Yes" Then
NewLine(" :^!7?JJJJJ?7!^: root@" & Strings.ComputerInfo(0))
Else
NewLine(" :^!7?JJJJJ?7!^: " & Strings.ComputerInfo(1) & "@" & Strings.ComputerInfo(0))
End If
NewLine(" .~?PB###BGP555PGB###BP?~. ----------------------")
NewLine(" .!P#&B57^..:: ^~~!!~^::~7YG!. OS: ShiftOS TheRevival")
NewLine(" .?#@G7: .^ :^::!5&#?. Host: " & Environment.MachineName)
NewLine(" .?#@5^ ! .^!!..J&#? Kernel: " & My.Resources.CurrentVersion)
NewLine(" B@G^ .J : 7?..J@G: Uptime : N/ A")
NewLine(" ~&@Y 7 ~PB&#Y:. ~G7 ~&&^ Packages: " & Strings.ComputerInfo(4))
NewLine(" ^&@Y Y 5#5??YB@&B~ .GJ :&&: Shell: sos-justshell")
NewLine(" G@B ? 5P ^YB! .#! ~@G Window Manager: -")
NewLine(" ^@@! : @Y .:::^~:. 7# Y@^ Window Manager Theme: -")
NewLine(" 7@@: ! B@&BBBBGPPB@#Y. :&^ ^@? Terminal: shiftos-terminal")
NewLine(" ?@@: 7 :??7~:. 5@@5 :&^ .&? Terminal Font: Consolas, 11pt")
NewLine(" ~@@! !@ G#&B!. Y@@B 7#. Y~ CPU: " & My.Computer.Registry.GetValue("HKEY_LOCAL_MACHINE\HARDWARE\DESCRIPTION\System\CentralProcessor\0", "ProcessorNameString", Nothing))
NewLine(" B@G B@J ...~&G. 7@@@? .#? 7 GPU: N/A")
Dim TripleDigitRAM As String
TripleDigitRAM = (My.Computer.Info.TotalPhysicalMemory / 1024 / 1024 / 1024)
NewLine(" ~&@? ^@Y !G#57~~!YB@#Y^ .GP .. Memory: " & TripleDigitRAM.Substring(0, 4) & " GB")
NewLine(" !@@7 ~#J 5#&&BG57^ ~BY Codepoint: " & Strings.ComputerInfo(2))
NewLine(" ~#@Y .5P~ ^5G~ ")
NewLine(" .J&#! ^JY!:. ^?P5! ")
NewLine(" :J&B?..!JYY7!~::...::~!7Y5Y7: ")
NewLine(" .7PBP?^::~!?JJJJJJJ?7~: ")
NewLine(" .~?55Y?!^:... ")
NewLine(" .:~~^~^^::. ")
End Sub
End Module
|