28 lines
795 B
Python
28 lines
795 B
Python
|
from pathlib import Path
|
||
|
|
||
|
# Apps directory
|
||
|
apps_dir = Path.home() / "Apps"
|
||
|
|
||
|
# Create the Apps directory if doesn't exists
|
||
|
def ensure_apps_dir():
|
||
|
if not apps_dir.exists():
|
||
|
apps_dir.mkdir(parents=True)
|
||
|
print(f"Created {apps_dir} directory.")
|
||
|
else:
|
||
|
print(f"{apps_dir} directory exists.")
|
||
|
|
||
|
# List AppImage files in the directory
|
||
|
def list_appimage_files():
|
||
|
appimage_files = [file.name for file in apps_dir.iterdir() if file.is_file() and file.suffix == ".AppImage"]
|
||
|
if appimage_files:
|
||
|
print("AppImage files found:")
|
||
|
for app in appimage_files:
|
||
|
print(f" - {app}")
|
||
|
else:
|
||
|
print("No AppImage files found in ~/Apps directory.")
|
||
|
|
||
|
# Ensure the Apps directory exists
|
||
|
ensure_apps_dir()
|
||
|
|
||
|
# List AppImage files
|
||
|
list_appimage_files()
|