Compare commits

...

2 Commits

Author SHA1 Message Date
8af5428b35 themetext 2024-07-08 15:56:41 +08:00
f842646d25 v1.5.5 fix bugs and new theme 2024-07-08 15:14:30 +08:00
9 changed files with 31 additions and 30 deletions

2
.gitignore vendored Normal file
View File

@@ -0,0 +1,2 @@
/build/
/dist/

View File

@@ -1,20 +0,0 @@
import os,sys
if len(sys.argv) > 1:
try:
if not sys.argv[1] == "-c":
# 判断当前目录有没有main.py
os.system("pip install pluginbase")
if os.path.exists("main.py"):
os.system("python3 main.py")
else:
if os.path.exists("autozshell.zip"):
os.system("unzip autozshell.zip")
os.system("python3 main.py")
except:
pass
if sys.argv[1] == "-c":
os.system("zip autozshell.zip *")

Binary file not shown.

2
ash.py Normal file
View File

@@ -0,0 +1,2 @@
import os
os.system("python3 main.py")

View File

@@ -77,13 +77,7 @@ while True:
with open(current_file_dir + "/" + "themetext", "r") as f:
themetext = f.read()
# 获取当前用户和地址
user = os.getlogin()
address = os.getcwd()
# 把inputtext这个变量里的{user}换成user变量
inputtext = themetext.replace("{user}", user)
# 把inputtext这个变量里的{address}换成address变量
inputtext = inputtext.replace("{address}", address)
inputtext = themetext
text1 = str(input(inputtext))
if text1 == "exit":

View File

@@ -1,7 +1,7 @@
import configparser
import sys,os
import fun
version = "1.5.0"
version = "1.5.5"
config = configparser.ConfigParser()
if not os.path.exists(os.path.expanduser('~') + '/.ashrc'):

View File

@@ -1,8 +1,12 @@
import os
theme_name = "default"
theme_version = "1.0.0"
head = "{user}@{address}$ "
import os
user = os.getlogin()
address = os.getcwd()
head = f"\033[31m{user}\033[0m@\033[32m{address}\033[0m$ "
# 获取当前文件的绝对路径
current_file_path = os.path.abspath(__file__)

18
theme/sus/theme.py Normal file
View File

@@ -0,0 +1,18 @@
import os
theme_name = "sus"
theme_version = "1.0.0"
user = os.getlogin()
address = os.getcwd()
head = f"\033[31mSUS的{user}\033[0m@\033[32m{address}\033[0m$ "
# 获取当前文件的绝对路径
current_file_path = os.path.abspath(__file__)
# 从绝对路径中提取目录
current_file_dir = os.path.dirname(current_file_path)
# 拼接成配置文件路径
current_file_dir = current_file_dir.split("/")
current_file_dir = "/".join(current_file_dir[:-1])
with open(current_file_dir + "text", "w") as f:
f.write(head)

1
themetext Normal file
View File

@@ -0,0 +1 @@
root@/root/PycharmProjects/autozshell$