Add files via upload
This commit is contained in:
10
install.sh
10
install.sh
@@ -114,10 +114,11 @@ mkdir -p "$BIN_DIR"
|
|||||||
|
|
||||||
echo "Installing ZDTT Terminal..."
|
echo "Installing ZDTT Terminal..."
|
||||||
|
|
||||||
# Copy the terminal.py and install.sh to the installation directory
|
# Copy the terminal.py, install.sh, and version.txt to the installation directory
|
||||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||||
cp "$SCRIPT_DIR/terminal.py" "$INSTALL_DIR/terminal.py"
|
cp "$SCRIPT_DIR/terminal.py" "$INSTALL_DIR/terminal.py"
|
||||||
cp "$SCRIPT_DIR/install.sh" "$INSTALL_DIR/install.sh"
|
cp "$SCRIPT_DIR/install.sh" "$INSTALL_DIR/install.sh"
|
||||||
|
cp "$SCRIPT_DIR/version.txt" "$INSTALL_DIR/version.txt"
|
||||||
chmod +x "$INSTALL_DIR/terminal.py"
|
chmod +x "$INSTALL_DIR/terminal.py"
|
||||||
chmod +x "$INSTALL_DIR/install.sh"
|
chmod +x "$INSTALL_DIR/install.sh"
|
||||||
|
|
||||||
@@ -155,7 +156,12 @@ case "$1" in
|
|||||||
echo "ZDTT Terminal has been uninstalled."
|
echo "ZDTT Terminal has been uninstalled."
|
||||||
;;
|
;;
|
||||||
version)
|
version)
|
||||||
echo "ZDTT Terminal v0.0.1.alpha"
|
if [ -f "$ZDTT_DIR/version.txt" ]; then
|
||||||
|
VERSION=$(cat "$ZDTT_DIR/version.txt")
|
||||||
|
echo "ZDTT Terminal v$VERSION"
|
||||||
|
else
|
||||||
|
echo "ZDTT Terminal v0.0.1.a"
|
||||||
|
fi
|
||||||
echo ""
|
echo ""
|
||||||
echo "Features:"
|
echo "Features:"
|
||||||
echo " • Command history (↑/↓ navigation)"
|
echo " • Command history (↑/↓ navigation)"
|
||||||
|
|||||||
27
terminal.py
27
terminal.py
@@ -46,6 +46,9 @@ class ZDTTTerminal:
|
|||||||
self.history_file = os.path.expanduser("~/.zdtt_history")
|
self.history_file = os.path.expanduser("~/.zdtt_history")
|
||||||
self.plugin_dir = os.path.expanduser("~/.zdtt/plugins")
|
self.plugin_dir = os.path.expanduser("~/.zdtt/plugins")
|
||||||
|
|
||||||
|
# Read version from version.txt
|
||||||
|
self.version = self.read_version()
|
||||||
|
|
||||||
# ANSI color codes
|
# ANSI color codes
|
||||||
self.COLOR_RESET = '\033[0m'
|
self.COLOR_RESET = '\033[0m'
|
||||||
self.COLOR_GREEN = '\033[92m'
|
self.COLOR_GREEN = '\033[92m'
|
||||||
@@ -86,9 +89,27 @@ class ZDTTTerminal:
|
|||||||
# Load plugins
|
# Load plugins
|
||||||
self.load_plugins()
|
self.load_plugins()
|
||||||
|
|
||||||
|
def read_version(self):
|
||||||
|
"""Read version from version.txt file"""
|
||||||
|
# Try multiple locations for version.txt
|
||||||
|
version_paths = [
|
||||||
|
os.path.join(os.path.dirname(__file__), 'version.txt'), # Same dir as script
|
||||||
|
os.path.expanduser("~/.local/share/zdtt/version.txt"), # Installed location
|
||||||
|
]
|
||||||
|
|
||||||
|
for path in version_paths:
|
||||||
|
try:
|
||||||
|
with open(path, 'r') as f:
|
||||||
|
return f.read().strip()
|
||||||
|
except FileNotFoundError:
|
||||||
|
continue
|
||||||
|
|
||||||
|
# Fallback version if file not found
|
||||||
|
return "0.0.1.a"
|
||||||
|
|
||||||
def display_banner(self):
|
def display_banner(self):
|
||||||
"""Display the ZDTT ASCII art banner"""
|
"""Display the ZDTT ASCII art banner"""
|
||||||
banner = """
|
banner = f"""
|
||||||
░█████████ ░███████ ░██████████░██████████
|
░█████████ ░███████ ░██████████░██████████
|
||||||
░██ ░██ ░██ ░██ ░██
|
░██ ░██ ░██ ░██ ░██
|
||||||
░██ ░██ ░██ ░██ ░██
|
░██ ░██ ░██ ░██ ░██
|
||||||
@@ -98,7 +119,7 @@ class ZDTTTerminal:
|
|||||||
░█████████ ░███████ ░██ ░██
|
░█████████ ░███████ ░██ ░██
|
||||||
|
|
||||||
|
|
||||||
ZDTT Terminal v0.0.1.alpha
|
ZDTT Terminal v{self.version}
|
||||||
"""
|
"""
|
||||||
print(banner)
|
print(banner)
|
||||||
|
|
||||||
@@ -262,7 +283,7 @@ ZDTT Terminal v0.0.1.alpha
|
|||||||
|
|
||||||
def cmd_about(self, args):
|
def cmd_about(self, args):
|
||||||
"""Display information about ZDTT Terminal"""
|
"""Display information about ZDTT Terminal"""
|
||||||
print("\nZDTT Terminal v0.0.1.alpha")
|
print(f"\nZDTT Terminal v{self.version}")
|
||||||
print("A custom terminal interface for Debian-based Linux")
|
print("A custom terminal interface for Debian-based Linux")
|
||||||
print()
|
print()
|
||||||
print("Features:")
|
print("Features:")
|
||||||
|
|||||||
1
version.txt
Normal file
1
version.txt
Normal file
@@ -0,0 +1 @@
|
|||||||
|
0.0.1.a
|
||||||
Reference in New Issue
Block a user