Skip to content

Commit

Permalink
Uploaded Version 1.0.0, Woooo!
Browse files Browse the repository at this point in the history
I uploaded version 1.0.0 of OmniShell!
  • Loading branch information
D1j1t0 authored Aug 3, 2022
1 parent c7d77ec commit 83dc866
Show file tree
Hide file tree
Showing 12 changed files with 295 additions and 0 deletions.
Binary file added README.md
Binary file not shown.
55 changes: 55 additions & 0 deletions boot.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
#this runs your .omnirc file
exec(open('.omnirc.py').read())

#This section imports the dependent libraries
import sys
import subprocess
import os
import theme
import options
from rich.console import Console
from rich.prompt import Prompt as prompt
import shutil
from importlib import reload
from pathlib import Path
import time

#defines the login sequence
def login():
f = open("password.txt", "r")
lgin = (f.read())
usr = input("Please enter your Username: ")
usr = (usr + "\n")
pss = input("Now enter your Password: ")
usrpss = (usr + pss)
if lgin == usrpss:
print("Correct!")
else:
print("Incorrect, try again!")
login()

#This section shows the splash logo
logo = theme.logo
if options.dologo == True:
Console().print(logo)

#This section checks if the setup has already been completed
stpcmplt = (os.path.isfile("./password.txt"))

#This section does the main setup
if stpcmplt == (bool(False)):
usrnm = input("Please assign a Username: ")
psswrd = input("Please assign a Password: ")
usrnm = (usrnm + "\n")
lgn = (usrnm + psswrd)
print("Writing Password...")
f = open("password.txt", "w")
f.write(lgn)
f.close()
print("Setup complete")
exec(open('prompt.py').read())
else:
#calls the login sequence
if options.dologin == True:
login()
exec(open('prompt.py').read())
Binary file added icon.ico
Binary file not shown.
5 changes: 5 additions & 0 deletions options.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#This file is made as an easy way for addons and other scripts to add user configurable variables/options

dologin = False #this feature is just a proof of concept at the moment and provides basically no extra security
dologo = True
unixmode = False
65 changes: 65 additions & 0 deletions prompt.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
#loads theme and asks for input
cmdno = Console().input(theme.prompt)
reload(theme)
prompt = (theme.prompt)

#exits omnishell
if cmdno.lower() == ("exit"):
print("Bye, Bye")

#show current directory
elif cmdno == ("cdir"):
dir_path = os.path.dirname(os.path.realpath(__file__))
print(dir_path)
exec(open('prompt.py').read())

#does nothing, just prints new prompt
elif cmdno == (""):
exec(open('prompt.py').read())

#runs different files and scripts
else:
#checks which file types exist in ./scripts/
filechkpy = (os.path.isfile("./scripts/" + cmdno + "/" + cmdno + ".py"))
filechkbat = (os.path.isfile("./scripts/" + cmdno + "/" + cmdno + ".bat"))
filechkexe = (os.path.isfile("./scripts/" + cmdno + "/" + cmdno + ".exe"))
filechklnk = (os.path.isfile("./scripts/" + cmdno + "/" + cmdno + ".lnk"))

#prioritises python files
if filechkpy == (bool(True)):
cmd = (cmdno + ".py")
Console().print(prompt + "executing: " + cmd)
exec(open("./scripts/" + cmdno + "/" + cmd).read())
exec(open('prompt.py').read())

#then .bat files
elif filechkbat == (bool(True)) and options.unixmode == (bool(False)):
cmd = (cmdno + ".bat")
dir_path = os.path.dirname(os.path.realpath(__file__))
bat_path = os.path.join(dir_path, "scripts", cmdno, cmd)
Console().print(prompt + "executing: " + cmd)
subprocess.call([bat_path])
exec(open('prompt.py').read())

#next .exe files
elif filechkexe == (bool(True)) and options.unixmode == (bool(False)):
cmd = (cmdno + ".exe")
dir_path = os.path.dirname(os.path.realpath(__file__))
exe_path = os.path.join(dir_path, "scripts", cmdno, cmd)
Console().print(prompt + "executing: " + cmd)
subprocess.call(exe_path)
exec(open('prompt.py').read())

#last .lnk files (shortcuts)
elif filechklnk == (bool(True)) and options.unixmode == (bool(False)):
cmd = (cmdno + ".lnk")
dir_path = os.path.dirname(os.path.realpath(__file__))
lnk_path = os.path.join(dir_path, "scripts", cmdno, cmd)
Console().print(prompt + "executing: " + cmd)
os.startfile(lnk_path)
exec(open('prompt.py').read())

#if no file exists, it will then try and run it as a shell command
else:
os.system(cmdno)
exec(open('prompt.py').read())
44 changes: 44 additions & 0 deletions scripts/themetool/themetool.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#prints all installed themes and asks you to select one
print("\nPick a theme", os.listdir("./themes/"))
selecttheme = input("Type the name of a theme: ")
themechk = os.path.isdir("./themes/" + selecttheme + "/")
themepath = ("./themes/" + selecttheme)

#if the theme you selected is valid it imports it
if themechk == True:
sys.path.insert(0, themepath)
import theme
sys.modules.pop('theme')
import theme

#if the theme has an info variable it will print it
if hasattr(theme, 'info'):
Console().print(theme.info)

#it then checks if the theme has a logo and prompt
print("Features:")
if hasattr(theme, 'logo'):
print(u'\u2714' + " Custom Logo")
else:
print(u'\u2717' + " Custom Logo")
if hasattr(theme, 'prompt'):
print(u'\u2714' + " Custom Prompt")
else:
print(u'\u2717' + " Custom Prompt")

#then it asks if you would like to install the theme and if yes then it will install it
switch = input("\nDo you want to switch to this theme? y/n: ")
if switch.lower() == ("y"):
if hasattr(theme, 'logo') and hasattr(theme, 'prompt'):
path = (os.path.dirname(os.path.realpath(__file__)))
oldtheme = os.path.join(path, 'theme.py')
applytheme = os.path.join(path, 'themes', selecttheme, 'theme.py')
shutil.copyfile(applytheme, oldtheme)
else:
print("\nError: Missing variables in theme file")
else:
sys.path.insert(0, "./")
reload(theme)
#if theme doesn't exist it will exit
elif themechk == False:
print("Theme does not exist")
17 changes: 17 additions & 0 deletions theme.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
info = """###########
#Omnishell#
###########
-----------
Omnishell's default theme.
-----------
By: D1j1t"""

logo = """[yellow] ____ __ ____ ___________ __ __________ __
/ __ \/ |/ / | / / _/ ___// / / / ____/ / / /
/ / / / /|_/ / |/ // / \__ \/ /_/ / __/ / / / /
/ /_/ / / / / /| // / ___/ / __ / /___/ /___/ /___
\____/_/ /_/_/ |_/___//____/_/ /_/_____/_____/_____/"""

prompt = """[yellow]
/OMNISHELL
\_"""
31 changes: 31 additions & 0 deletions themes/Aperture/theme.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
info = """##########
#Aperture#
##########
-----------
A theme based off of the portal games
-----------
By: D1j1t"""

logo = """[blue] .,-:;//;:=,
. :H@@@MM@M#H/.,+%;,
,/X+ +M@@M@MM%=,-%HMMM@X/,
-+@MM; $M@@MH+-,;XMMMM@MMMM@+-
;@M@@M- XM@X;. -+XXXXXHHH@M@M#@/.
,%MM@@MH ,@%= .---=-=:=,.
-@#@@@MX ., -%HX$$%%%+;
=-./@M@M$ .;@MMMM@MM:
X@/ -$MM/ .+MM@@@M$
,@M@H: :@: . -X#@@@@-
,@@@MMX, . /H- ;@M@M=
.H@@@@M@+, %MM+..%#$.
/MMMM@MMH/. XM@MH; -;
/%+%$XHH@$= , .H@@@@MX,
.=--------. -%H.,@@@@@MX,
.%MM@@@HHHXX$$$%+- .:$MMX -M@@MM%.
=XMMM@MM@MM#H;,-+HMM@M+ /MMMX=
=%@M@M#@$-.=$@MM@@@M; %M%=
,:+$+-,/H#MMMMMMM@- -,
=++%%%%+/:-."""

prompt = """[blue]
\\"""
21 changes: 21 additions & 0 deletions themes/GeOS/theme.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
info = """######
#GeOS#
######
-----------
A theme that looks like the first version of Omni-Shell.
-----------
By: D1j1t"""

logo = """[yellow] ___ ___ ___ ___
/ /\ / /\ / /\ / /\\
/ /::\ / /::\ / /::\ / /::\\
/ /:/\:\ / /:/\:\ / /:/\:\ /__/:/\:\\
/ /:/ \:\ / /::\ \:\ / /:/ \:\ _\_ \:\ \:\\
/__/:/_\_ \:\ /__/:/\:\ \:\ /__/:/ \__\:\ /__/\ \:\ \:\\
\ \:\__/\_\/ \ \:\ \:\_\/ \ \:\ / /:/ \ \:\ \:\_\/
\ \:\ \:\ \ \:\ \:\ \ \:\ /:/ \ \:\_\:\\
\ \:\/:/ \ \:\_\/ \ \:\/:/ \ \:\/:/
\ \::/ \ \:\ \ \::/ \ \::/
\__\/ \__\/ \__\/ \__\/"""

prompt = """[yellow][GeOS}-{"""
17 changes: 17 additions & 0 deletions themes/L3V14TH4N/theme.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
info = """###########
#L3V14TH4N#
###########
-----------
A theme based on a very old version of Omni-Shell.
-----------
By: D1j1t"""

logo = """[red] ___ _ _ _
/ ! ! _____ _/ ! __ _! !_! !__ __ _ _ __
/ /! ! / _ \ \ / / !/ _` ! __! '_ \ / _` ! '_ \\
/ / ! !___! __/\ V /! ! (_! ! !_! ! ! ! (_! ! ! ! !
/_/ !____/\___! \_/ !_!\__,_!\__!_! !_!\__,_!_! !_!"""

prompt = """[red]
/L3V14TH4N
\_"""
17 changes: 17 additions & 0 deletions themes/OmniShell/theme.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
info = """###########
#Omnishell#
###########
-----------
Omnishell's default theme.
-----------
By: D1j1t"""

logo = """[yellow] ____ __ ____ ___________ __ __________ __
/ __ \/ |/ / | / / _/ ___// / / / ____/ / / /
/ / / / /|_/ / |/ // / \__ \/ /_/ / __/ / / / /
/ /_/ / / / / /| // / ___/ / __ / /___/ /___/ /___
\____/_/ /_/_/ |_/___//____/_/ /_/_____/_____/_____/"""

prompt = """[yellow]
/OMNISHELL
\_"""
23 changes: 23 additions & 0 deletions themes/Turtleshell/theme.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
from datetime import datetime
now = datetime.now()
usrname = ("put your username here")
logo = (u'\ue73c')

info = """[blink][red] ____[yellow]_ [green] [blue] _ [purple] _ [red] [yellow] _ [green] [blue] _[purple] _
|[red]_ _[yellow]| _[green] _ __[blue]| |_|[purple] | __[red]_ __[yellow]_| |_[green]_ _[blue]__| |[purple] |
[red]| || [yellow]| | |[green] '__|[blue] __| [purple]|/ _ [red]\/ __[yellow]| '_ [green]\ / _[blue] \ | [purple]|
|[red] || |[yellow]_| | [green]| | [blue]|_| |[purple] __/[red]\__ \ [yellow]| | [green]| __[blue]/ | |[purple]
|_[red]| \__[yellow],_|_|[green] \_[blue]_|_|\_[purple]__||[red]___/_[yellow]| |_|[green]\___|[blue]_|_|
[/red][/yellow][/green][/blue][/purple][/red][/yellow][/green][/blue][/purple][/red][/yellow][/green][/blue][/purple][/red][/yellow][/green][/blue][/purple][/red][/yellow][/green][/blue][/purple][/red][/yellow][/green][/blue][/purple][/red][/yellow][/green][/blue][/purple][/red][/yellow][/green][/blue][/purple][/red][/yellow][/green][/blue][/purple][/red][/yellow][/green][/blue][/blink]
- Showing off the [b]power[/b] of [yellow]Omni[/yellow]-[blue]Shell[/blue]
Author: D1j1t"""

prompt = ('\n' + u'[green]\ue0b6' + u'\u2588[/green]' + "[black on green]" + logo + "[/black on green]" + u'[green]\u2588[/green]' + u'[green on yellow]\ue0b0[/green on yellow]' + u'[yellow]\u2588[/yellow]' + "[black on yellow]" + usrname + "[/black on yellow]" + u'[yellow]\u2588[/yellow]' + u'[yellow on blue]\ue0b0[/yellow on blue]' + u'[blue]\u2588' + '[black on blue]' + now.strftime('%H:%M:%S') + '[/black on blue]' + u'\u2588' + u'\ue0b0[/blue]' + " ")

logo = """[blink][red] ____[yellow]_ [green] [blue] _ [purple] _ [red] [yellow] _ [green] [blue] _[purple] _
|[red]_ _[yellow]| _[green] _ __[blue]| |_|[purple] | __[red]_ __[yellow]_| |_[green]_ _[blue]__| |[purple] |
[red]| || [yellow]| | |[green] '__|[blue] __| [purple]|/ _ [red]\/ __[yellow]| '_ [green]\ / _[blue] \ | [purple]|
|[red] || |[yellow]_| | [green]| | [blue]|_| |[purple] __/[red]\__ \ [yellow]| | [green]| __[blue]/ | |[purple]
|_[red]| \__[yellow],_|_|[green] \_[blue]_|_|\_[purple]__||[red]___/_[yellow]| |_|[green]\___|[blue]_|_|
[/red][/yellow][/green][/blue][/purple][/red][/yellow][/green][/blue][/purple][/red][/yellow][/green][/blue][/purple][/red][/yellow][/green][/blue][/purple][/red][/yellow][/green][/blue][/purple][/red][/yellow][/green][/blue][/purple][/red][/yellow][/green][/blue][/purple][/red][/yellow][/green][/blue][/purple][/red][/yellow][/green][/blue][/purple][/red][/yellow][/green][/blue][/blink]"""

0 comments on commit 83dc866

Please sign in to comment.