commit 5cac29f4bd37891dfd3ca762852800033c54a4e4 Author: Andrew Date: Tue Oct 28 19:17:37 2025 +0300 initial structure diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..3f791c2 --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +.cache +.vscode +**/__pycache__ +builddir +.venv diff --git a/README.md b/README.md new file mode 100644 index 0000000..c7d676f --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +# Aegnux + +A convenient way to install Adobe After Effects on Linux using Wine. \ No newline at end of file diff --git a/icons/afterfx.png b/icons/afterfx.png new file mode 100644 index 0000000..8735273 Binary files /dev/null and b/icons/afterfx.png differ diff --git a/main.py b/main.py new file mode 100644 index 0000000..ee41117 --- /dev/null +++ b/main.py @@ -0,0 +1,4 @@ +from src.app import main + +if __name__ == "__main__": + exit(main()) \ No newline at end of file diff --git a/run.sh b/run.sh new file mode 100755 index 0000000..db6b130 --- /dev/null +++ b/run.sh @@ -0,0 +1,8 @@ +#!/bin/sh + +SCRIPT_PATH=$(readlink -f "$0") +SCRIPT_DIR=$(dirname "SCRIPT_PATH") + +cd "$SCRIPT_DIR" + +python main.py \ No newline at end of file diff --git a/src/app.py b/src/app.py new file mode 100644 index 0000000..62d4b1e --- /dev/null +++ b/src/app.py @@ -0,0 +1,17 @@ +import sys +from PySide6.QtWidgets import QApplication +from PySide6.QtGui import QIcon +from src.mainwindow import MainWindow +from src.config import DESKTOP_FILE_NAME, AE_ICON_PATH +from translations import load_strings + +def main(): + load_strings() + app = QApplication(sys.argv) + app.setDesktopFileName(DESKTOP_FILE_NAME) + app.setWindowIcon(QIcon(AE_ICON_PATH)) + + mainWindow = MainWindow() + mainWindow.show() + + return app.exec() \ No newline at end of file diff --git a/src/config.py b/src/config.py new file mode 100644 index 0000000..9e0c451 --- /dev/null +++ b/src/config.py @@ -0,0 +1,8 @@ +import os + +DESKTOP_FILE_NAME='com.relative.Aegnux' + +BASE_DIR = os.getcwd() + +AE_ICON_PATH = BASE_DIR + '/icons/afterfx.png' +STYLES_PATH = BASE_DIR + '/styles' \ No newline at end of file diff --git a/src/mainwindow.py b/src/mainwindow.py new file mode 100644 index 0000000..547ffd7 --- /dev/null +++ b/src/mainwindow.py @@ -0,0 +1,15 @@ +from ui.mainwindow import MainWindowUI +from translations import gls +from PySide6.QtCore import Slot + + +class MainWindow(MainWindowUI): + def __init__(self): + super().__init__() + + self.setWindowTitle(gls('welcome_win_title')) + self.install_button.clicked.connect(self.install_button_clicked) + + @Slot() + def install_button_clicked(self): + pass \ No newline at end of file diff --git a/styles/mainwindow.css b/styles/mainwindow.css new file mode 100644 index 0000000..bcf37cc --- /dev/null +++ b/styles/mainwindow.css @@ -0,0 +1,23 @@ +#title_label { + margin-top: 20px; + font-size: 18pt; +} + +#subtitle_label { + color: #999999; + margin-left: 3em; + margin-right: 3em; +} + +#install_button { + margin-top: 30px; + margin-bottom: 30px; + padding-top: 20px; + padding-bottom: 20px; + margin-left: 3em; + margin-right: 3em; +} + +#footer_label { + margin-bottom: 10px; +} \ No newline at end of file diff --git a/translations/__init__.py b/translations/__init__.py new file mode 100644 index 0000000..af69bc4 --- /dev/null +++ b/translations/__init__.py @@ -0,0 +1 @@ +from translations.helper import gls, load_strings \ No newline at end of file diff --git a/translations/en_US.py b/translations/en_US.py new file mode 100644 index 0000000..415f6c4 --- /dev/null +++ b/translations/en_US.py @@ -0,0 +1,7 @@ +STRINGS = { + 'welcome_win_title': 'Aegnux — Welcome', + 'welcome_to_aegnux': 'Welcome to Aegnux!', + 'subtitle_text': 'A simpler way to get After Effects running on GNU/Linux', + 'install': 'Install', + 'footer_text': 'Made with 💙 by Relative' +} \ No newline at end of file diff --git a/translations/helper.py b/translations/helper.py new file mode 100644 index 0000000..a229a69 --- /dev/null +++ b/translations/helper.py @@ -0,0 +1,22 @@ +import os +import importlib +from translations.en_US import STRINGS as EN_STRINGS + +STRINGS = {} + +def get_current_locale() -> str: + return os.getenv('LANG', 'en_US.UTF-8').split('.')[0] + +def load_strings(): + global STRINGS + + locale = get_current_locale() + + try: + mod = importlib.import_module(f'translations.{locale}') + STRINGS = mod.STRINGS + except: + STRINGS = EN_STRINGS + +def gls(key: str) -> str: + return STRINGS.get(key, key) \ No newline at end of file diff --git a/translations/ru_RU.py b/translations/ru_RU.py new file mode 100644 index 0000000..0c1bad1 --- /dev/null +++ b/translations/ru_RU.py @@ -0,0 +1,7 @@ +STRINGS = { + 'welcome_win_title': 'Aegnux — Добро пожаловать', + 'welcome_to_aegnux': 'Добро пожаловать в Aegnux!', + 'subtitle_text': 'Более простой способ заставить работать After Effects на GNU/Linux', + 'install': 'Установить', + 'footer_text': 'Сделано с любовью 💙 Relative' +} \ No newline at end of file diff --git a/ui/mainwindow.py b/ui/mainwindow.py new file mode 100644 index 0000000..76eef5c --- /dev/null +++ b/ui/mainwindow.py @@ -0,0 +1,72 @@ +from PySide6.QtWidgets import ( + QVBoxLayout, QWidget, + QLabel, QMainWindow, QPushButton, + QSpacerItem, QSizePolicy +) +from PySide6.QtCore import Qt, QSize +from PySide6.QtGui import QIcon, QPixmap +from translations import gls +from src.config import AE_ICON_PATH, STYLES_PATH + +class MainWindowUI(QMainWindow): + def __init__(self): + super().__init__() + self._construct_ui() + self._set_styles() + self.setMinimumSize(480, 600) + + def _set_styles(self): + with open(f'{STYLES_PATH}/mainwindow.css') as fp: + self.setStyleSheet(fp.read()) + + def add_expanding_vertical_sizer(self): + self.root_layout.addItem( + QSpacerItem(1, 2, QSizePolicy.Policy.Fixed, QSizePolicy.Policy.Expanding) + ) + + def _construct_ui(self): + central_widget = QWidget() + self.setCentralWidget(central_widget) + + self.root_layout = QVBoxLayout(central_widget) + + self.add_expanding_vertical_sizer() + + logo_label = QLabel() + logo_pixmap = QPixmap(AE_ICON_PATH) + + logo_label.setPixmap(logo_pixmap) + logo_label.setAlignment(Qt.AlignmentFlag.AlignHCenter) + self.root_layout.addWidget(logo_label) + + title_label = QLabel(gls('welcome_to_aegnux')) + title_label.setObjectName('title_label') + title_label.setAlignment(Qt.AlignmentFlag.AlignHCenter) + + self.root_layout.addWidget(title_label) + + + subtitle_label = QLabel(gls('subtitle_text')) + subtitle_label.setObjectName('subtitle_label') + subtitle_label.setWordWrap(True) + subtitle_label.setAlignment(Qt.AlignmentFlag.AlignHCenter) + + self.root_layout.addWidget(subtitle_label) + + + self.install_button = QPushButton(gls('install')) + self.install_button.setIcon(QIcon.fromTheme('install-symbolic')) + self.install_button.setIconSize(QSize(35, 20)) + self.install_button.setObjectName('install_button') + self.root_layout.addWidget(self.install_button) + + + self.add_expanding_vertical_sizer() + + + footer_label = QLabel(gls('footer_text')) + footer_label.setObjectName('footer_label') + footer_label.setWordWrap(True) + footer_label.setAlignment(Qt.AlignmentFlag.AlignHCenter) + + self.root_layout.addWidget(footer_label) \ No newline at end of file