-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcli.py
83 lines (82 loc) · 3.84 KB
/
cli.py
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
# This is a basic terminal with added aria + my functionality
# Some of this is customised towards me: for example "Ultimate" is the hostname of my home raspbery pi server
# Customise it to your needs
# I have this start in windows terminal by defualt
# This is Aria v2.0
# Have fun!
import os
import psutil
import socket
import login
hostname=socket.gethostname()
IPAddr=socket.gethostbyname(hostname)
battery = psutil.sensors_battery()
def secs2hours(secs):
mm, ss = divmod(secs, 60)
hh, mm = divmod(mm, 60)
return "%d:%02d:%02d" % (hh, mm, ss)
def cmd_ui():
try:
while True:
op=input('> ')
if op == 'su':
os.system('powershell C:/Users/vivaa/Onedrive/Desktop/Other/ssh.bat')
elif op == 'sc':
host=input('Host: ')
username=input(host+' login: ')
os.system('powershell ssh '+username+'@'+host)
elif op == 'sa':
print('Aria not availiable yet.')
elif op == 'stu':
print('powershell ssh pi@ultimate neofetch')
elif op == 'ou':
os.system('powershell wsl -d ubuntu')
elif op == 'op':
os.system('powershell')
elif op == 'vo':
print('Please select an option: SSH to Ultimate [SU], SSH to custom host [SC], View status of Ultimate [STU], Open Ubuntu [OU], Open Debian [OD], Open windows powershell [OP], Open Browse [OB], View these options again [VO], Start Shizuku [SS], Launch adb [LA], Screen mirror [SM], Bluestacks [BS].')
elif op == 'lud':
print('It is no longer recommended to launch Ubuntu Desktop as it interferes with Chrome OS Flex and requires a fresh install of ubuntu to fix. Due to this the feature has been disabled.')
elif op == 'ob':
os.system(r'C:\Windows\py.exe "C:\Users\vivaa\Projects\python-utils\browser.py"')
elif op == 'cros':
print('It is now recomended to just boot straight from the ChromeOS Usb')
elif op == 'ss':
os.system('cd C:/Users/vivaa/Google/platform-tools && adb shell sh /storage/emulated/0/Android/data/moe.shizuku.privileged.api/start.sh ')
elif op == 'la':
os.system('cd C:/Users/vivaa/Google/platform-tools && cmd')
elif op == 'sm':
os.system('C:/Users/vivaa/Google/Scrcpy/scrcpy.exe')
elif op == 'bs':
os.system('"C:\Program Files\BlueStacks_nxt\HD-Player.exe" --instance Nougat64')
elif op == 'discord':
if login.login():
os.system(r'C:\Users\vivaa\AppData\Local\Discord\app-1.0.9006\Discord.exe')
elif op == 'od':
os.system('powershell wsl -d debian')
elif op == '':
continue
else:
os.system('powershell.exe "'+op+'"')
except:
cmd_ui()
print('Welcome to Aria Terminal')
print('')
print('Please select an option: SSH to Ultimate [SU], SSH to custom host [SC], View status of Ultimate [STU], Open Ubuntu [OU], Open Debian [OD], Open powershell [OP], Open Browse [OB], View these options again [VO], Start Shizuku [SS], Launch adb [LA], Screen mirror [SM], Bluestacks [BS], Start Aria [SA]')
print('')
print('Computer Status: ')
if battery.power_plugged:
print("Charging: "+str(battery.percent)+"%")
else:
print("Not Charging: "+str(battery.percent)+"%")
print("Discharge time: ", secs2hours(int(battery.secsleft)))
print("Computer Name: "+hostname)
print("Computer IP Address: "+IPAddr)
if IPAddr == '172.30.64.1':
print('Wifi Status: Not Connected')
else:
print('Wifi Status: Connected')
print('')
print('© Vivaan Modi. All Rights Reserved.')
cmd_ui()
os.system('powershell pause')