initial structure

This commit is contained in:
Andrew
2025-10-28 19:17:37 +03:00
commit 5cac29f4bd
14 changed files with 192 additions and 0 deletions

5
.gitignore vendored Normal file
View File

@@ -0,0 +1,5 @@
.cache
.vscode
**/__pycache__
builddir
.venv

3
README.md Normal file
View File

@@ -0,0 +1,3 @@
# Aegnux
A convenient way to install Adobe After Effects on Linux using Wine.

BIN
icons/afterfx.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

4
main.py Normal file
View File

@@ -0,0 +1,4 @@
from src.app import main
if __name__ == "__main__":
exit(main())

8
run.sh Executable file
View File

@@ -0,0 +1,8 @@
#!/bin/sh
SCRIPT_PATH=$(readlink -f "$0")
SCRIPT_DIR=$(dirname "SCRIPT_PATH")
cd "$SCRIPT_DIR"
python main.py

17
src/app.py Normal file
View File

@@ -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()

8
src/config.py Normal file
View File

@@ -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'

15
src/mainwindow.py Normal file
View File

@@ -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

23
styles/mainwindow.css Normal file
View File

@@ -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;
}

1
translations/__init__.py Normal file
View File

@@ -0,0 +1 @@
from translations.helper import gls, load_strings

7
translations/en_US.py Normal file
View File

@@ -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'
}

22
translations/helper.py Normal file
View File

@@ -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)

7
translations/ru_RU.py Normal file
View File

@@ -0,0 +1,7 @@
STRINGS = {
'welcome_win_title': 'Aegnux — Добро пожаловать',
'welcome_to_aegnux': 'Добро пожаловать в Aegnux!',
'subtitle_text': 'Более простой способ заставить работать After Effects на GNU/Linux',
'install': 'Установить',
'footer_text': 'Сделано с любовью 💙 Relative'
}

72
ui/mainwindow.py Normal file
View File

@@ -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)