1
0
mirror of https://github.com/Swordfish90/cool-retro-term.git synced 2026-02-08 08:42:22 +00:00

23 Commits

Author SHA1 Message Date
Filippo Scognamiglio
fe92fa7330 Merge pull request #913 from Swordfish90/feature/improve-workflows
Replace workflows with a single one which is triggered on tags.
2026-01-22 23:15:50 +01:00
Filippo Scognamiglio
eba69d3a54 Replace workflows with a single one which is triggered on tags. 2026-01-22 23:12:02 +01:00
Filippo Scognamiglio
403bb11e7e Merge pull request #912 from Swordfish90/fix/actions-regressions
Fix regressions in shortcuts on Linux
2026-01-22 23:08:20 +01:00
Filippo Scognamiglio
9f05d729a7 Fix fullscreen menu not added on linux. 2026-01-22 22:58:15 +01:00
Filippo Scognamiglio
25695c0a9f Fix warning in terminal destruction. 2026-01-22 02:07:17 +01:00
Filippo Scognamiglio
b77a1b5962 Fix shortcuts on macOS. 2026-01-22 01:20:06 +01:00
Filippo Scognamiglio
29dc67d96b Fix menu behaviour on Linux. 2026-01-22 00:35:30 +01:00
Filippo Scognamiglio
2e4536ecdf Revert "Make actions between the different menus global."
This reverts commit e70268bb73.
2026-01-22 00:16:31 +01:00
Filippo Scognamiglio
8cf303132f Fix workflows. 2026-01-19 11:39:15 +01:00
Filippo Scognamiglio
55ef7cb7e0 Merge pull request #911 from Swordfish90/feature/qt6
Migrate to Qt6
2026-01-19 01:39:05 +01:00
Filippo Scognamiglio
77434e463e Fix github workflows. 2026-01-19 01:12:56 +01:00
Filippo Scognamiglio
6bcb54114d Update the readme to mention Qt6 instead of Qt5. 2026-01-19 00:50:13 +01:00
Filippo Scognamiglio
09f813a7e0 Fix terminal size not displayed when resizing. 2026-01-19 00:13:45 +01:00
Filippo Scognamiglio
a6a7768e42 Add version to build packages. 2026-01-19 00:13:15 +01:00
Filippo Scognamiglio
33878dae24 Bump QMLTermWidget version to 2.0. 2026-01-17 22:15:18 +01:00
Filippo Scognamiglio
0313a00b4f Move showMenuBar toggle inside advanced settings. 2026-01-17 22:09:29 +01:00
Filippo Scognamiglio
be4b1f366c Make version number dynamic. 2026-01-17 21:44:40 +01:00
Filippo Scognamiglio
c54dcb1c1c Add build script for macos dmgs. 2026-01-17 18:53:38 +01:00
Filippo Scognamiglio
5795aeb6b7 Fix fullscreen not tied to multiple windows. 2026-01-17 18:35:05 +01:00
Filippo Scognamiglio
e70268bb73 Make actions between the different menus global. 2026-01-17 17:20:37 +01:00
Filippo Scognamiglio
e72faa1d2c Set up appimage build. 2026-01-17 13:53:12 +01:00
Filippo Scognamiglio
e1fc767431 Some improvements to default themes and small cleanups. 2026-01-17 13:51:27 +01:00
Filippo Scognamiglio
737d289a19 Allow enabling and disabling italic. 2026-01-15 23:57:10 +01:00
43 changed files with 372 additions and 390 deletions

View File

@@ -1,98 +0,0 @@
name: "ci"
on:
push:
tags: "**"
workflow_dispatch:
defaults:
run:
shell: bash
jobs:
appimage:
runs-on: ubuntu-18.04
steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
submodules: true
- name: Install dependencies
run: |
sudo add-apt-repository -y ppa:beineri/opt-qt-5.15.2-bionic
sudo apt-get update -qq
sudo apt-get install -y \
build-essential make wget libgl1-mesa-dev \
qt515declarative qt515graphicaleffects \
qt515quickcontrols qt515quickcontrols2
- name: Download QT appimage builder
run: |
wget -c -O linuxdeployqt.AppImage \
https://github.com/probonopd/linuxdeployqt/releases/download/continuous/linuxdeployqt-continuous-x86_64.AppImage
chmod a+x linuxdeployqt.AppImage
- name: Build project
run: |
source /opt/qt*/bin/qt*-env.sh && \
qmake -v && \
qmake CONFIG+=release PREFIX=/usr && \
make -j$(nproc)
- name: Install to appdir
run: |
source /opt/qt*/bin/qt*-env.sh && \
make INSTALL_ROOT=appdir -j$(nproc) install
- name: Extract version number
run: |
# Extract version for linuxdeployqt to name the file. Use the tag as
# release name but remove prefix.
echo "VERSION=$(echo '${{ github.ref }}' | sed 's;.*/;;')" >> $GITHUB_ENV
- name: Build appimage directory
run: |
mkdir -p \
appdir/usr/bin \
appdir/usr/lib \
appdir/usr/share/applications \
appdir/usr/share/metainfo \
appdir/usr/share/icons/hicolor/128x128/apps
cp cool-retro-term appdir/usr/bin/
cp cool-retro-term.desktop appdir/usr/share/applications/
cp packaging/appdata/cool-retro-term.appdata.xml appdir/usr/share/metainfo/
cp app/icons/128x128/cool-retro-term.png appdir/usr/share/icons/hicolor/128x128/apps/
cp -r ./app/qml appdir/usr/
# Workaround for https://github.com/probonopd/linuxdeployqt/issues/78
cp -r ./qmltermwidget/QMLTermWidget appdir/usr/qml/
find appdir | sort
- name: Build appimage
run: |
source /opt/qt*/bin/qt*-env.sh && \
./linuxdeployqt.AppImage appdir/usr/share/applications/cool-retro-term.desktop \
-verbose=1 -appimage \
-qmldir=./app/qml/ \
-qmldir=./qmltermwidget/
env:
# Unset environment variables
QTDIR:
QT_PLUGIN_PATH:
LD_LIBRARY_PATH:
- name: Upload release
uses: softprops/action-gh-release@v1
with:
body: appimage release
files: ./**/Cool_Retro_Term-*-x86_64.AppImage
- name: Clean up
if: always()
run: |
find appdir -executable -type f -exec ldd {} \; | grep " => /usr" | cut -d " " -f 2-3 | sort | uniq
make clean
rm -rf appdir

129
.github/workflows/release.yml vendored Normal file
View File

@@ -0,0 +1,129 @@
name: Release
on:
workflow_dispatch:
push:
branches:
- main
- master
tags:
- '*'
permissions:
contents: write
jobs:
build-appimage:
name: Build (Linux, AppImage)
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Install build deps
run: |
sudo apt update
sudo apt install -y build-essential rsync wget
- name: Install Qt
uses: jurplel/install-qt-action@v4
with:
version: 6.10.0
dir: ..
modules: qt5compat qtshadertools
setup-python: false
cache: true
- name: Build AppImage
run: |
./scripts/build-appimage.sh
- name: Collect artifact
run: |
mkdir -p release
mv ./*.AppImage release/
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: cool-retro-term-appimage
path: ./release/*
build-dmg:
name: Build (macOS, DMG)
runs-on: macos-14
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Install Qt
uses: jurplel/install-qt-action@v4
with:
version: 6.10.*
modules: qt5compat qtshadertools
setup-python: true
python-version: '3.11'
cache: true
- name: Build DMG
run: |
JOBS="$(sysctl -n hw.ncpu)"
./scripts/build-dmg.sh
- name: Collect artifact
run: |
mkdir -p release
mv ./*.dmg release/
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: cool-retro-term-dmg
path: ./release/*
release:
name: Create Release
runs-on: ubuntu-22.04
needs:
- build-appimage
- build-dmg
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Download AppImage
uses: actions/download-artifact@v4
with:
name: cool-retro-term-appimage
path: ./release
- name: Download DMG
uses: actions/download-artifact@v4
with:
name: cool-retro-term-dmg
path: ./release
- name: Update rolling tag
if: startsWith(github.ref, 'refs/heads/')
run: |
git tag -f rolling
git push -f origin rolling
- name: Publish rolling release
if: startsWith(github.ref, 'refs/heads/')
uses: softprops/action-gh-release@v2
with:
tag_name: rolling
name: Rolling Release
prerelease: true
files: ./release/*
- name: Publish tagged release
if: startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ github.ref_name }}
files: ./release/*

6
.gitignore vendored
View File

@@ -41,11 +41,17 @@ Makefile*
*.json *.json
# Excludes compiled files # Excludes compiled files
imports imports
cool-retro-term cool-retro-term
build build
# Linux
*.AppImage
# Mac OSX # Mac OSX
.DS_Store .DS_Store
*.app *.app
*.dmg

View File

@@ -1,37 +0,0 @@
sudo: required
dist: trusty
language: c++
install:
- sudo add-apt-repository -y ppa:beineri/opt-qt58-trusty
- sudo apt-get update -qq
- sudo apt-get -y install build-essential qt58declarative qt58graphicaleffects qt58quickcontrols libgl1-mesa-dev
- source /opt/qt*/bin/qt*-env.sh
script:
- qmake CONFIG+=release PREFIX=/usr
- make -j$(nproc)
- mkdir -p appdir/usr/share/metainfo appdir/usr/bin
- cp packaging/appdata/cool-retro-term.appdata.xml appdir/usr/share/metainfo/
- cp cool-retro-term appdir/usr/bin/
- cp ./cool-retro-term.desktop appdir/
- cp ./app/icons/128x128/cool-retro-term.png appdir/
- cp -r ./app/qml appdir/usr/
- cp -r ./qmltermwidget/QMLTermWidget appdir/usr/qml/ # Workaround for https://github.com/probonopd/linuxdeployqt/issues/78
- wget -c https://github.com/probonopd/linuxdeployqt/releases/download/continuous/linuxdeployqt-continuous-x86_64.AppImage
- chmod a+x linuxdeployqt-*.AppImage
- unset QTDIR; unset QT_PLUGIN_PATH ; unset LD_LIBRARY_PATH
- export VERSION=$(git rev-parse --short HEAD) # linuxdeployqt uses this for naming the file
- ./linuxdeployqt-*.AppImage appdir/usr/bin/cool-retro-term -qmldir=./app/qml/ -qmldir=./qmltermwidget/ # -verbose=3 2>&1 | grep "path:" -C 3
- ./linuxdeployqt-*.AppImage appdir/usr/bin/cool-retro-term -qmldir=./app/qml/ -qmldir=./qmltermwidget/ -verbose=2 -appimage
after_success:
- find appdir -executable -type f -exec ldd {} \; | grep " => /usr" | cut -d " " -f 2-3 | sort | uniq
- # curl --upload-file Cool*.AppImage https://transfer.sh/Cool_Retro_Term-git.$(git rev-parse --short HEAD)-x86_64.AppImage
- wget -c https://github.com/probonopd/uploadtool/raw/master/upload.sh
- bash upload.sh Cool*.AppImage*
branches:
except:
- # Do not build tags that we create when we upload to GitHub Releases
- /^(?i:continuous)/

View File

@@ -10,7 +10,7 @@ It has been designed to be eye-candy, customizable, and reasonably lightweight.
It uses the QML port of qtermwidget (Konsole): https://github.com/Swordfish90/qmltermwidget. It uses the QML port of qtermwidget (Konsole): https://github.com/Swordfish90/qmltermwidget.
This terminal emulator works under Linux and macOS and requires Qt5. It's suggested that you stick to the latest LTS version. This terminal emulator works under Linux and macOS and requires Qt6.
Settings such as colors, fonts, and effects can be accessed via context menu. Settings such as colors, fonts, and effects can be accessed via context menu.

View File

@@ -1,5 +1,8 @@
QT += qml quick widgets sql quickcontrols2 QT += qml quick widgets sql quickcontrols2
TARGET = cool-retro-term TARGET = cool-retro-term
APP_VERSION = $$system(git -C $$PWD/.. describe --tags --always --dirty=-dirty)
isEmpty(APP_VERSION): APP_VERSION = "unknown"
DEFINES += APP_VERSION=\\\"$$APP_VERSION\\\"
# TODO: When migrating to CMake, use KDSingleApplication's CMakeLists.txt instead of these manual sources. # TODO: When migrating to CMake, use KDSingleApplication's CMakeLists.txt instead of these manual sources.
INCLUDEPATH += $$PWD/../KDSingleApplication/src INCLUDEPATH += $$PWD/../KDSingleApplication/src

View File

@@ -73,7 +73,7 @@ int main(int argc, char *argv[])
return 0; return 0;
} }
QString appVersion("1.2.0"); QString appVersion(QStringLiteral(APP_VERSION));
if (argc>1 && (!strcmp(argv[1],"-v") || !strcmp(argv[1],"--version"))) { if (argc>1 && (!strcmp(argv[1],"-v") || !strcmp(argv[1],"--version"))) {
QTextStream cout(stdout, QIODevice::WriteOnly); QTextStream cout(stdout, QIODevice::WriteOnly);
@@ -86,6 +86,7 @@ int main(int argc, char *argv[])
app.setApplicationName(QStringLiteral("cool-retro-term")); app.setApplicationName(QStringLiteral("cool-retro-term"));
app.setOrganizationName(QStringLiteral("cool-retro-term")); app.setOrganizationName(QStringLiteral("cool-retro-term"));
app.setOrganizationDomain(QStringLiteral("cool-retro-term")); app.setOrganizationDomain(QStringLiteral("cool-retro-term"));
app.setApplicationVersion(appVersion);
KDSingleApplication singleApp(QStringLiteral("cool-retro-term")); KDSingleApplication singleApp(QStringLiteral("cool-retro-term"));

View File

@@ -40,7 +40,6 @@ QtObject {
property bool isMacOS: Qt.platform.os === "osx" property bool isMacOS: Qt.platform.os === "osx"
// GENERAL SETTINGS /////////////////////////////////////////////////////// // GENERAL SETTINGS ///////////////////////////////////////////////////////
property bool fullscreen: false
property bool showMenubar: false property bool showMenubar: false
property bool showTerminalSize: true property bool showTerminalSize: true
@@ -86,7 +85,7 @@ QtObject {
property real horizontalSync: 0.08 property real horizontalSync: 0.08
property real flickering: 0.1 property real flickering: 0.1
property real rbgShift: 0.0 property real rgbShift: 0.0
property real _frameShininess: 0.2 property real _frameShininess: 0.2
property real frameShininess: _frameShininess * 0.5 property real frameShininess: _frameShininess * 0.5
@@ -188,7 +187,7 @@ QtObject {
"bloom": bloom, "bloom": bloom,
"rasterization": rasterization, "rasterization": rasterization,
"jitter": jitter, "jitter": jitter,
"rbgShift": rbgShift, "rgbShift": rgbShift,
"brightness": brightness, "brightness": brightness,
"contrast": contrast, "contrast": contrast,
"ambientLight": ambientLight, "ambientLight": ambientLight,
@@ -289,7 +288,7 @@ QtObject {
jitter = settings.jitter !== undefined ? settings.jitter : jitter jitter = settings.jitter !== undefined ? settings.jitter : jitter
rbgShift = settings.rbgShift !== undefined ? settings.rbgShift : rbgShift rgbShift = settings.rgbShift !== undefined ? settings.rgbShift : rgbShift
ambientLight = settings.ambientLight !== undefined ? settings.ambientLight : ambientLight ambientLight = settings.ambientLight !== undefined ? settings.ambientLight : ambientLight
contrast = settings.contrast !== undefined ? settings.contrast : contrast contrast = settings.contrast !== undefined ? settings.contrast : contrast
@@ -384,9 +383,9 @@ QtObject {
"horizontalSync": 0.1, "horizontalSync": 0.1,
"jitter": 0.2, "jitter": 0.2,
"rasterization": 0, "rasterization": 0,
"rbgShift": 0, "rgbShift": 0,
"saturationColor": 0.2, "saturationColor": 0.2,
"screenCurvature": 0.4, "screenCurvature": 0.2,
"screenRadius": 0.1, "screenRadius": 0.1,
"staticNoise": 0.1, "staticNoise": 0.1,
"windowOpacity": 1, "windowOpacity": 1,
@@ -410,7 +409,7 @@ QtObject {
"contrast": 0.8, "contrast": 0.8,
"flickering": 0.1, "flickering": 0.1,
"fontColor": "#0ccc68", "fontColor": "#0ccc68",
"fontName": "EXCELSIOR_SCALED", "fontName": "DEPARTURE_MONO_SCALED",
"fontSource": 0, "fontSource": 0,
"fontWidth": 1, "fontWidth": 1,
"lineSpacing": 0.1, "lineSpacing": 0.1,
@@ -418,9 +417,9 @@ QtObject {
"horizontalSync": 0.1, "horizontalSync": 0.1,
"jitter": 0.2, "jitter": 0.2,
"rasterization": 0, "rasterization": 0,
"rbgShift": 0, "rgbShift": 0,
"saturationColor": 0.0, "saturationColor": 0.0,
"screenCurvature": 0.7, "screenCurvature": 0.3,
"screenRadius": 0.2, "screenRadius": 0.2,
"staticNoise": 0.1, "staticNoise": 0.1,
"windowOpacity": 1, "windowOpacity": 1,
@@ -444,7 +443,7 @@ QtObject {
"contrast": 0.8, "contrast": 0.8,
"flickering": 0.1, "flickering": 0.1,
"fontColor": "#7fb4ff", "fontColor": "#7fb4ff",
"fontName": "COZETTE_SCALED", "fontName": "BIGBLUE_TERMINAL_SCALED",
"fontSource": 0, "fontSource": 0,
"fontWidth": 1, "fontWidth": 1,
"lineSpacing": 0.1, "lineSpacing": 0.1,
@@ -452,9 +451,9 @@ QtObject {
"horizontalSync": 0.1, "horizontalSync": 0.1,
"jitter": 0.2, "jitter": 0.2,
"rasterization": 0, "rasterization": 0,
"rbgShift": 0, "rgbShift": 0,
"saturationColor": 0.2, "saturationColor": 0.2,
"screenCurvature": 1.0, "screenCurvature": 0.4,
"screenRadius": 0.1, "screenRadius": 0.1,
"staticNoise": 0.1, "staticNoise": 0.1,
"windowOpacity": 1, "windowOpacity": 1,
@@ -486,7 +485,7 @@ QtObject {
"horizontalSync": 0.0, "horizontalSync": 0.0,
"jitter": 0.0, "jitter": 0.0,
"rasterization": 1, "rasterization": 1,
"rbgShift": 0, "rgbShift": 0,
"saturationColor": 0, "saturationColor": 0,
"screenCurvature": 0.5, "screenCurvature": 0.5,
"screenRadius": 0.1, "screenRadius": 0.1,
@@ -495,7 +494,7 @@ QtObject {
"margin": 0.3, "margin": 0.3,
"blinkingCursor": false, "blinkingCursor": false,
"frameSize": 0.5, "frameSize": 0.5,
"frameColor": "#444444", "frameColor": "#999999",
"frameShininess": 0.0 "frameShininess": 0.0
}' }'
builtin: true builtin: true
@@ -520,15 +519,15 @@ QtObject {
"horizontalSync": 0.2, "horizontalSync": 0.2,
"jitter": 0.15, "jitter": 0.15,
"rasterization": 1, "rasterization": 1,
"rbgShift": 0.1, "rgbShift": 0.0,
"saturationColor": 0, "saturationColor": 0,
"screenCurvature": 1.0, "screenCurvature": 0.7,
"screenRadius": 0.3, "screenRadius": 0.3,
"staticNoise": 0.2, "staticNoise": 0.2,
"windowOpacity": 1, "windowOpacity": 1,
"margin": 0.2, "margin": 0.2,
"blinkingCursor": false, "blinkingCursor": false,
"frameSize": 0.8, "frameSize": 0.5,
"frameColor": "#000000", "frameColor": "#000000",
"frameShininess": 0.6 "frameShininess": 0.6
}' }'
@@ -554,15 +553,15 @@ QtObject {
"horizontalSync": 0.2, "horizontalSync": 0.2,
"jitter": 0.2, "jitter": 0.2,
"rasterization": 1, "rasterization": 1,
"rbgShift": 0.1, "rgbShift": 0.0,
"saturationColor": 0, "saturationColor": 0,
"screenCurvature": 1.0, "screenCurvature": 0.5,
"screenRadius": 0.3, "screenRadius": 0.3,
"staticNoise": 0.2, "staticNoise": 0.2,
"windowOpacity": 1, "windowOpacity": 1,
"margin": 0.0, "margin": 0.0,
"blinkingCursor": false, "blinkingCursor": false,
"frameSize": 0.5, "frameSize": 0.2,
"frameColor": "#ffffff", "frameColor": "#ffffff",
"frameShininess": 0.8 "frameShininess": 0.8
}' }'
@@ -588,9 +587,9 @@ QtObject {
"horizontalSync": 0.0, "horizontalSync": 0.0,
"jitter": 0.0, "jitter": 0.0,
"rasterization": 1, "rasterization": 1,
"rbgShift": 0.0, "rgbShift": 0.0,
"saturationColor": 0, "saturationColor": 0,
"screenCurvature": 0.3, "screenCurvature": 0.4,
"screenRadius": 0.2, "screenRadius": 0.2,
"staticNoise": 0.1, "staticNoise": 0.1,
"windowOpacity": 1, "windowOpacity": 1,
@@ -622,7 +621,7 @@ QtObject {
"horizontalSync": 0.0, "horizontalSync": 0.0,
"jitter": 0.0, "jitter": 0.0,
"rasterization": 1, "rasterization": 1,
"rbgShift": 0.15, "rgbShift": 0.1,
"saturationColor": 0, "saturationColor": 0,
"screenCurvature": 0.3, "screenCurvature": 0.3,
"screenRadius": 0.1, "screenRadius": 0.1,
@@ -637,13 +636,13 @@ QtObject {
builtin: true builtin: true
} }
ListElement { ListElement {
text: "IBM 3278" text: "IBM 3278 Reborn"
obj_string: '{ obj_string: '{
"ambientLight": 0.2, "ambientLight": 0.2,
"backgroundColor": "#000000", "backgroundColor": "#000000",
"bloom": 0.2, "bloom": 0.2,
"brightness": 0.5, "brightness": 0.5,
"burnIn": 0.7, "burnIn": 0.5,
"chromaColor": 0, "chromaColor": 0,
"contrast": 0.8, "contrast": 0.8,
"flickering": 0, "flickering": 0,
@@ -656,7 +655,7 @@ QtObject {
"horizontalSync": 0, "horizontalSync": 0,
"jitter": 0, "jitter": 0,
"rasterization": 4, "rasterization": 4,
"rbgShift": 0, "rgbShift": 0,
"saturationColor": 0, "saturationColor": 0,
"screenCurvature": 0, "screenCurvature": 0,
"screenRadius": 0.0, "screenRadius": 0.0,
@@ -690,7 +689,7 @@ QtObject {
"horizontalSync": 0.0, "horizontalSync": 0.0,
"jitter": 0.1, "jitter": 0.1,
"rasterization": 4, "rasterization": 4,
"rbgShift": 0.0, "rgbShift": 0.0,
"saturationColor": 0.6, "saturationColor": 0.6,
"screenCurvature": 0, "screenCurvature": 0,
"screenRadius": 0.0, "screenRadius": 0.0,
@@ -724,7 +723,7 @@ QtObject {
"horizontalSync": 0.0, "horizontalSync": 0.0,
"jitter": 0.0, "jitter": 0.0,
"rasterization": 4, "rasterization": 4,
"rbgShift": 0.1, "rgbShift": 0.0,
"saturationColor": 0.0, "saturationColor": 0.0,
"screenCurvature": 0, "screenCurvature": 0,
"screenRadius": 0.0, "screenRadius": 0.0,
@@ -758,7 +757,7 @@ QtObject {
"horizontalSync": 0.0, "horizontalSync": 0.0,
"jitter": 0.1, "jitter": 0.1,
"rasterization": 4, "rasterization": 4,
"rbgShift": 0.1, "rgbShift": 0.1,
"saturationColor": 0.8, "saturationColor": 0.8,
"screenCurvature": 0, "screenCurvature": 0,
"screenRadius": 0.0, "screenRadius": 0.0,
@@ -792,7 +791,7 @@ QtObject {
"horizontalSync": 0, "horizontalSync": 0,
"jitter": 0.0, "jitter": 0.0,
"rasterization": 4, "rasterization": 4,
"rbgShift": 0, "rgbShift": 0,
"saturationColor": 0.0, "saturationColor": 0.0,
"screenCurvature": 0, "screenCurvature": 0,
"screenRadius": 0.0, "screenRadius": 0.0,
@@ -826,7 +825,7 @@ QtObject {
"horizontalSync": 0.0, "horizontalSync": 0.0,
"jitter": 0.0, "jitter": 0.0,
"rasterization": 4, "rasterization": 4,
"rbgShift": 0, "rgbShift": 0,
"saturationColor": 0, "saturationColor": 0,
"screenCurvature": 0, "screenCurvature": 0,
"screenRadius": 0.0, "screenRadius": 0.0,
@@ -864,17 +863,12 @@ QtObject {
var profileArgPosition = args.indexOf("--profile") var profileArgPosition = args.indexOf("--profile")
if (profileArgPosition !== -1) { if (profileArgPosition !== -1) {
var profileIndex = getProfileIndexByName( var profileIndex = getProfileIndexByName(args[profileArgPosition + 1])
args[profileArgPosition + 1]) if (profileIndex !== -1) {
if (profileIndex !== -1)
loadProfile(profileIndex) loadProfile(profileIndex)
else } else {
console.log("Warning: selected profile is not valid; ignoring it") console.log("Warning: selected profile is not valid; ignoring it")
} }
if (args.indexOf("--fullscreen") !== -1) {
fullscreen = true
showMenubar = false
} }
initializedSettings() initializedSettings()

View File

@@ -21,7 +21,7 @@
import QtQuick 2.2 import QtQuick 2.2
import QtQuick.Controls 2.0 import QtQuick.Controls 2.0
import QMLTermWidget 1.0 import QMLTermWidget 2.0
import "menus" import "menus"
import "utils.js" as Utils import "utils.js" as Utils
@@ -141,6 +141,7 @@ Item{
kterminal.antialiasText = !lowResolutionFont; kterminal.antialiasText = !lowResolutionFont;
kterminal.smooth = !lowResolutionFont; kterminal.smooth = !lowResolutionFont;
kterminal.enableBold = !lowResolutionFont; kterminal.enableBold = !lowResolutionFont;
kterminal.enableItalic = !lowResolutionFont;
kterminal.font = Qt.font({ kterminal.font = Qt.font({
family: fontFamily, family: fontFamily,
@@ -185,6 +186,9 @@ Item{
appSettings.fontManager.refresh() appSettings.fontManager.refresh()
startSession(); startSession();
} }
Component.onDestruction: {
appSettings.fontManager.terminalFontChanged.disconnect(handleFontChanged);
}
} }
Component { Component {
@@ -199,7 +203,7 @@ Item{
Loader { Loader {
id: menuLoader id: menuLoader
sourceComponent: (appSettings.isMacOS || appSettings.showMenubar ? shortContextMenu : fullContextMenu) sourceComponent: (appSettings.isMacOS || (appSettings.showMenubar && !terminalWindow.fullscreen) ? shortContextMenu : fullContextMenu)
} }
property alias contextmenu: menuLoader.item property alias contextmenu: menuLoader.item

View File

@@ -28,7 +28,7 @@ ColumnLayout {
GroupBox { GroupBox {
Layout.fillWidth: true Layout.fillWidth: true
Layout.fillHeight: true Layout.fillHeight: true
title: qsTr("Command") title: qsTr("Miscellaneous")
padding: appSettings.defaultMargin padding: appSettings.defaultMargin
ColumnLayout { ColumnLayout {
@@ -39,12 +39,6 @@ ColumnLayout {
checked: appSettings.useCustomCommand checked: appSettings.useCustomCommand
onCheckedChanged: appSettings.useCustomCommand = checked onCheckedChanged: appSettings.useCustomCommand = checked
} }
// Workaround for QTBUG-31627 for pre 5.3.0
Binding {
target: useCustomCommand
property: "checked"
value: appSettings.useCustomCommand
}
TextField { TextField {
id: customCommand id: customCommand
Layout.fillWidth: true Layout.fillWidth: true
@@ -59,26 +53,18 @@ ColumnLayout {
Component.onCompleted: settings_window.closing.connect( Component.onCompleted: settings_window.closing.connect(
saveSetting) saveSetting)
} }
}
}
GroupBox {
title: qsTr("Cursor")
Layout.fillWidth: true
Layout.fillHeight: true
padding: appSettings.defaultMargin
ColumnLayout {
anchors.fill: parent
CheckBox { CheckBox {
id: blinkingCursor id: blinkingCursor
text: qsTr("Blinking Cursor") text: qsTr("Blinking Cursor")
checked: appSettings.blinkingCursor checked: appSettings.blinkingCursor
onCheckedChanged: appSettings.blinkingCursor = checked onCheckedChanged: appSettings.blinkingCursor = checked
} }
Binding { CheckBox {
target: blinkingCursor id: showMenubar
property: "checked" text: qsTr("Show Menubar")
value: appSettings.blinkingCursor enabled: !appSettings.isMacOS
checked: appSettings.showMenubar
onCheckedChanged: appSettings.showMenubar = checked
} }
} }
} }

View File

@@ -83,8 +83,8 @@ ColumnLayout {
} }
CheckableSlider { CheckableSlider {
name: qsTr("RGB Shift") name: qsTr("RGB Shift")
onNewValue: function(newValue) { appSettings.rbgShift = newValue } onNewValue: function(newValue) { appSettings.rgbShift = newValue }
value: appSettings.rbgShift value: appSettings.rgbShift
} }
CheckableSlider { CheckableSlider {
name: qsTr("Frame Shininess") name: qsTr("Frame Shininess")

View File

@@ -36,7 +36,7 @@ Item {
} }
function staticFragmentPath() { function staticFragmentPath() {
var rgbShiftOn = appSettings.rbgShift > 0 ? 1 : 0; var rgbShiftOn = appSettings.rgbShift > 0 ? 1 : 0;
var bloomOn = appSettings.bloom > 0 ? 1 : 0; var bloomOn = appSettings.bloom > 0 ? 1 : 0;
var curvatureOn = (appSettings.screenCurvature > 0 || appSettings.frameSize > 0) ? 1 : 0; var curvatureOn = (appSettings.screenCurvature > 0 || appSettings.frameSize > 0) ? 1 : 0;
var shineOn = appSettings.frameShininess > 0 ? 1 : 0; var shineOn = appSettings.frameShininess > 0 ? 1 : 0;
@@ -176,7 +176,7 @@ Item {
property real chromaColor: appSettings.chromaColor; property real chromaColor: appSettings.chromaColor;
property real rbgShift: (appSettings.rbgShift / width) * appSettings.totalFontScaling property real rgbShift: appSettings.rgbShift * (4.0 / width) * appSettings.totalFontScaling
property real screen_brightness: Utils.lint(0.5, 1.5, appSettings.brightness) property real screen_brightness: Utils.lint(0.5, 1.5, appSettings.brightness)
property real frameShininess: appSettings.frameShininess property real frameShininess: appSettings.frameShininess

View File

@@ -21,15 +21,13 @@ import QtQuick 2.2
Rectangle { Rectangle {
property size terminalSize property size terminalSize
property real topOpacity: 0.6 property real topOpacity: 0.5
width: textSize.width * 2 width: textSize.width * 2
height: textSize.height * 2 height: textSize.height * 2
radius: 5 radius: 5
border.width: 2
border.color: "white"
color: "black" color: "black"
opacity: sizetimer.running ? 0.6 : 0.0 opacity: sizetimer.running ? 0.5 : 0.0
Behavior on opacity { Behavior on opacity {
NumberAnimation { NumberAnimation {

View File

@@ -20,16 +20,16 @@
import QtQuick import QtQuick
import QtQuick.Controls import QtQuick.Controls
import QtQuick.Layouts import QtQuick.Layouts
import QtQml.Models
Item { Item {
id: tabsRoot id: tabsRoot
readonly property int innerPadding: 6 readonly property int innerPadding: 6
readonly property string currentTitle: tabsModel.get(currentIndex).title ?? "cool-retro-term" readonly property string currentTitle: tabsModel.get(currentIndex).title ?? "cool-retro-term"
readonly property size terminalSize: stack.currentItem ? stack.currentItem.terminalSize : Qt.size(0, 0)
property alias currentIndex: tabBar.currentIndex property alias currentIndex: tabBar.currentIndex
readonly property int count: tabsModel.count readonly property int count: tabsModel.count
property var hostWindow property size terminalSize: Qt.size(0, 0)
function normalizeTitle(rawTitle) { function normalizeTitle(rawTitle) {
if (rawTitle === undefined || rawTitle === null) { if (rawTitle === undefined || rawTitle === null) {
@@ -45,7 +45,7 @@ Item {
function closeTab(index) { function closeTab(index) {
if (tabsModel.count <= 1) { if (tabsModel.count <= 1) {
hostWindow.close() terminalWindow.close()
return return
} }
@@ -140,6 +140,14 @@ Item {
Layout.fillWidth: true Layout.fillWidth: true
Layout.fillHeight: true Layout.fillHeight: true
onSessionFinished: tabsRoot.closeTab(index) onSessionFinished: tabsRoot.closeTab(index)
onTerminalSizeChanged: updateTerminalSize()
function updateTerminalSize() {
// Every tab will have the same size so we can simply take the first one.
if (index == 0) {
tabsRoot.terminalSize = terminalSize
}
}
} }
} }
} }

View File

@@ -39,22 +39,10 @@ ApplicationWindow {
visible: false visible: false
property bool fullscreen: appSettings.fullscreen property bool fullscreen: false
onFullscreenChanged: visibility = (fullscreen ? Window.FullScreen : Window.Windowed) onFullscreenChanged: visibility = (fullscreen ? Window.FullScreen : Window.Windowed)
menuBar: qtquickMenuLoader.item menuBar: WindowMenu { }
Loader {
id: qtquickMenuLoader
active: !appSettings.isMacOS && appSettings.showMenubar
sourceComponent: WindowMenu { }
}
Loader {
id: globalMenuLoader
active: appSettings.isMacOS
sourceComponent: OSXMenu { }
}
property real normalizedWindowScale: 1024 / ((0.5 * width + 0.5 * height)) property real normalizedWindowScale: 1024 / ((0.5 * width + 0.5 * height))
@@ -62,35 +50,26 @@ ApplicationWindow {
title: terminalTabs.currentTitle title: terminalTabs.currentTitle
Action {
id: showMenubarAction
text: qsTr("Show Menubar")
enabled: !appSettings.isMacOS
shortcut: "Ctrl+Shift+M"
checkable: true
checked: appSettings.showMenubar
onTriggered: appSettings.showMenubar = !appSettings.showMenubar
}
Action { Action {
id: fullscreenAction id: fullscreenAction
text: qsTr("Fullscreen") text: qsTr("Fullscreen")
enabled: !appSettings.isMacOS enabled: !appSettings.isMacOS
shortcut: "Alt+F11" shortcut: StandardKey.FullScreen
onTriggered: appSettings.fullscreen = !appSettings.fullscreen onTriggered: fullscreen = !fullscreen
checkable: true checkable: true
checked: appSettings.fullscreen checked: fullscreen
} }
Action { Action {
id: newWindowAction id: newWindowAction
text: qsTr("New Window") text: qsTr("New Window")
shortcut: "Ctrl+Shift+N" shortcut: appSettings.isMacOS ? "Meta+N" : "Ctrl+Shift+N"
onTriggered: appRoot.createWindow() onTriggered: appRoot.createWindow()
} }
Action { Action {
id: quitAction id: quitAction
text: qsTr("Quit") text: qsTr("Quit")
shortcut: "Ctrl+Shift+Q" shortcut: appSettings.isMacOS ? StandardKey.Close : "Ctrl+Shift+Q"
onTriggered: appSettings.close() onTriggered: terminalWindow.close()
} }
Action { Action {
id: showsettingsAction id: showsettingsAction
@@ -104,23 +83,23 @@ ApplicationWindow {
Action { Action {
id: copyAction id: copyAction
text: qsTr("Copy") text: qsTr("Copy")
shortcut: "Ctrl+Shift+C" shortcut: appSettings.isMacOS ? StandardKey.Copy : "Ctrl+Shift+C"
} }
Action { Action {
id: pasteAction id: pasteAction
text: qsTr("Paste") text: qsTr("Paste")
shortcut: "Ctrl+Shift+V" shortcut: appSettings.isMacOS ? StandardKey.Paste : "Ctrl+Shift+V"
} }
Action { Action {
id: zoomIn id: zoomIn
text: qsTr("Zoom In") text: qsTr("Zoom In")
shortcut: "Ctrl++" shortcut: StandardKey.ZoomIn
onTriggered: appSettings.incrementScaling() onTriggered: appSettings.incrementScaling()
} }
Action { Action {
id: zoomOut id: zoomOut
text: qsTr("Zoom Out") text: qsTr("Zoom Out")
shortcut: "Ctrl+-" shortcut: StandardKey.ZoomOut
onTriggered: appSettings.decrementScaling() onTriggered: appSettings.decrementScaling()
} }
Action { Action {
@@ -135,13 +114,13 @@ ApplicationWindow {
Action { Action {
id: newTabAction id: newTabAction
text: qsTr("New Tab") text: qsTr("New Tab")
shortcut: appSettings.isMacOS ? StandardKey.AddTab : "Ctrl+Shift+T"
onTriggered: terminalTabs.addTab() onTriggered: terminalTabs.addTab()
} }
TerminalTabs { TerminalTabs {
id: terminalTabs id: terminalTabs
width: parent.width width: parent.width
height: (parent.height + Math.abs(y)) height: (parent.height + Math.abs(y))
hostWindow: terminalWindow
} }
Loader { Loader {
anchors.centerIn: parent anchors.centerIn: parent

View File

@@ -19,6 +19,8 @@
*******************************************************************************/ *******************************************************************************/
import QtQuick 2.2 import QtQuick 2.2
import "menus"
QtObject { QtObject {
id: appRoot id: appRoot
@@ -34,7 +36,7 @@ QtObject {
visible: false visible: false
} }
property AboutDialog aboutWindow: AboutDialog { property AboutDialog aboutDialog: AboutDialog {
visible: false visible: false
} }
@@ -65,8 +67,6 @@ QtObject {
window.destroy() window.destroy()
if (windowsModel.count === 0) { if (windowsModel.count === 0) {
settingsWindow.close()
aboutWindow.close()
appSettings.close() appSettings.close()
} }
} }

View File

@@ -64,10 +64,6 @@ Menu {
action: fullscreenAction action: fullscreenAction
visible: fullscreenAction.enabled visible: fullscreenAction.enabled
} }
MenuItem {
action: showMenubarAction
visible: showMenubarAction.enabled
}
MenuItem { MenuItem {
action: zoomIn action: zoomIn
} }

View File

@@ -1,99 +0,0 @@
/*******************************************************************************
* Copyright (c) 2013-2021 "Filippo Scognamiglio"
* https://github.com/Swordfish90/cool-retro-term
*
* This file is part of cool-retro-term.
*
* cool-retro-term is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*******************************************************************************/
import QtQuick 2.3
import Qt.labs.platform 1.1
MenuBar {
id: defaultMenuBar
Menu {
title: qsTr("File")
MenuItem {
text: newWindowAction.text
shortcut: newWindowAction.shortcut
onTriggered: newWindowAction.trigger()
}
MenuItem {
text: newTabAction.text
shortcut: newTabAction.shortcut
onTriggered: newTabAction.trigger()
}
MenuSeparator {}
MenuItem {
text: quitAction.text
onTriggered: quitAction.trigger()
}
}
Menu {
title: qsTr("Edit")
MenuItem {
text: copyAction.text
shortcut: "Meta+C"
onTriggered: copyAction.trigger()
}
MenuItem {
text: pasteAction.text
shortcut: "Meta+V"
onTriggered: pasteAction.trigger()
}
MenuSeparator {}
MenuItem {
text: showsettingsAction.text
shortcut: showsettingsAction.shortcut
onTriggered: showsettingsAction.trigger()
}
}
Menu {
title: qsTr("View")
MenuItem {
text: zoomIn.text
shortcut: "Meta++"
onTriggered: zoomIn.trigger()
}
MenuItem {
text: zoomOut.text
shortcut: "Meta+-"
onTriggered: zoomOut.trigger()
}
}
Menu {
id: profilesMenu
title: qsTr("Profiles")
Instantiator {
model: appSettings.profilesList
delegate: MenuItem {
text: model.text
onTriggered: {
appSettings.loadProfileString(obj_string)
}
}
onObjectAdded: function(index, object) { profilesMenu.insertItem(index, object) }
onObjectRemoved: function(object) { profilesMenu.removeItem(object) }
}
}
Menu {
title: qsTr("Help")
MenuItem {
text: showAboutAction.text
onTriggered: showAboutAction.trigger()
}
}
}

View File

@@ -22,50 +22,33 @@ import QtQuick.Controls 2.3
MenuBar { MenuBar {
id: defaultMenuBar id: defaultMenuBar
visible: appSettings.showMenubar visible: appSettings.isMacOS || appSettings.showMenubar
Menu { Menu {
title: qsTr("File") title: qsTr("File")
MenuItem { MenuItem { action: newWindowAction }
action: newWindowAction MenuItem { action: newTabAction }
} MenuSeparator { }
MenuItem { MenuItem { action: quitAction }
action: newTabAction
}
MenuSeparator {}
MenuItem {
action: quitAction
}
} }
Menu { Menu {
title: qsTr("Edit") title: qsTr("Edit")
MenuItem { MenuItem { action: copyAction }
action: copyAction MenuItem { action: pasteAction }
}
MenuItem {
action: pasteAction
}
MenuSeparator {} MenuSeparator {}
MenuItem { MenuItem { action: showsettingsAction }
action: showsettingsAction
}
} }
Menu { Menu {
id: viewMenu
title: qsTr("View") title: qsTr("View")
MenuItem { Instantiator {
action: fullscreenAction model: !appSettings.isMacOS ? 1 : 0
visible: fullscreenAction.enabled delegate: MenuItem { action: fullscreenAction }
} onObjectAdded: (index, object) => viewMenu.insertItem(index, object)
MenuItem { onObjectRemoved: (index, object) => viewMenu.removeItem(object)
action: showMenubarAction
visible: showMenubarAction.enabled
}
MenuItem {
action: zoomIn
}
MenuItem {
action: zoomOut
} }
MenuItem { action: zoomIn }
MenuItem { action: zoomOut }
} }
Menu { Menu {
id: profilesMenu id: profilesMenu

View File

@@ -48,7 +48,6 @@
<file>menus/WindowMenu.qml</file> <file>menus/WindowMenu.qml</file>
<file>menus/FullContextMenu.qml</file> <file>menus/FullContextMenu.qml</file>
<file>menus/ShortContextMenu.qml</file> <file>menus/ShortContextMenu.qml</file>
<file>menus/OSXMenu.qml</file>
<file>../shaders/terminal_dynamic.vert.qsb</file> <file>../shaders/terminal_dynamic.vert.qsb</file>
<file>../shaders/terminal_static.vert.qsb</file> <file>../shaders/terminal_static.vert.qsb</file>
<file>../shaders/terminal_frame.vert.qsb</file> <file>../shaders/terminal_frame.vert.qsb</file>

View File

@@ -29,7 +29,7 @@ layout(std140, binding = 0) uniform ubuf {
vec2 scaleNoiseSize; vec2 scaleNoiseSize;
float screen_brightness; float screen_brightness;
float bloom; float bloom;
float rbgShift; float rgbShift;
float frameShadowCoeff; float frameShadowCoeff;
float frameShininess; float frameShininess;
vec4 frameColor; vec4 frameColor;

View File

@@ -20,7 +20,7 @@ layout(std140, binding = 0) uniform ubuf {
mat4 qt_Matrix; mat4 qt_Matrix;
float qt_Opacity; float qt_Opacity;
float screenCurvature; float screenCurvature;
float rbgShift; float rgbShift;
float frameShininess; float frameShininess;
float frameSize; float frameSize;
float screen_brightness; float screen_brightness;
@@ -59,7 +59,7 @@ void main() {
vec3 txt_color = texture(source, txt_coords).rgb; vec3 txt_color = texture(source, txt_coords).rgb;
#if CRT_RGB_SHIFT == 1 #if CRT_RGB_SHIFT == 1
vec2 displacement = vec2(12.0, 0.0) * rbgShift; vec2 displacement = vec2(rgbShift, 0.0);
vec3 rightColor = texture(source, txt_coords + displacement).rgb; vec3 rightColor = texture(source, txt_coords + displacement).rgb;
vec3 leftColor = texture(source, txt_coords - displacement).rgb; vec3 leftColor = texture(source, txt_coords - displacement).rgb;
txt_color.r = leftColor.r * 0.10 + rightColor.r * 0.30 + txt_color.r * 0.60; txt_color.r = leftColor.r * 0.10 + rightColor.r * 0.30 + txt_color.r * 0.60;

View File

@@ -7,7 +7,7 @@ layout(std140, binding = 0) uniform ubuf {
mat4 qt_Matrix; mat4 qt_Matrix;
float qt_Opacity; float qt_Opacity;
float screenCurvature; float screenCurvature;
float rbgShift; float rgbShift;
float frameShininess; float frameShininess;
float frameSize; float frameSize;
float screen_brightness; float screen_brightness;

Binary file not shown.

83
scripts/build-appimage.sh Executable file
View File

@@ -0,0 +1,83 @@
#!/usr/bin/env bash
set -euo pipefail
set -x
REPO_ROOT="$(readlink -f "$(dirname "$(dirname "$0")")")"
OLD_CWD="$(readlink -f .)"
BUILD_DIR="$REPO_ROOT/build/appimage"
TOOLS_DIR="$BUILD_DIR/tools"
VERSION="$(git -C "$REPO_ROOT" describe --tags --always --dirty=-dirty 2>/dev/null || true)"
if [ -z "$VERSION" ]; then
VERSION="unknown"
fi
if ! command -v qmake >/dev/null; then
echo "qmake not found in PATH." >&2
exit 1
fi
QTDIR="$(qmake -query QT_INSTALL_PREFIX)"
QT_INSTALL_QML="$(qmake -query QT_INSTALL_QML)"
APPDIR="$BUILD_DIR/AppDir"
mkdir -p "$BUILD_DIR"
rm -rf "$APPDIR"
pushd "$BUILD_DIR"
qmake "$REPO_ROOT/cool-retro-term.pro"
make -j"$(nproc)"
# Install targets from subprojects (the top-level install only installs the desktop file).
make -C app install INSTALL_ROOT="$APPDIR"
make -C qmltermwidget install INSTALL_ROOT="$APPDIR"
make install INSTALL_ROOT="$APPDIR"
popd
# Relocate QMLTermWidget into the standard AppDir QML import path.
QML_ROOT="$APPDIR$QT_INSTALL_QML"
if [ -d "$QML_ROOT" ]; then
mkdir -p "$APPDIR/usr/qml"
rsync -a "$QML_ROOT/" "$APPDIR/usr/qml/"
rm -rf "$QML_ROOT"
QML_PARENT="$(dirname "$QML_ROOT")"
while [ "$QML_PARENT" != "$APPDIR" ] && rmdir "$QML_PARENT" 2>/dev/null; do
QML_PARENT="$(dirname "$QML_PARENT")"
done
fi
# Build AppImage using linuxdeploy and linuxdeploy-plugin-qt.
mkdir -p "$TOOLS_DIR"
LINUXDEPLOY="$TOOLS_DIR/linuxdeploy-x86_64.AppImage"
LINUXDEPLOY_QT="$TOOLS_DIR/linuxdeploy-plugin-qt-x86_64.AppImage"
if [ ! -x "$LINUXDEPLOY" ]; then
wget -c -O "$LINUXDEPLOY" https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage
chmod +x "$LINUXDEPLOY"
fi
if [ ! -x "$LINUXDEPLOY_QT" ]; then
wget -c -O "$LINUXDEPLOY_QT" https://github.com/linuxdeploy/linuxdeploy-plugin-qt/releases/download/continuous/linuxdeploy-plugin-qt-x86_64.AppImage
chmod +x "$LINUXDEPLOY_QT"
fi
export QML_SOURCES_PATHS="$REPO_ROOT/app"
pushd "$BUILD_DIR"
export EXTRA_PLATFORM_PLUGINS="libqwayland.so;"
export EXTRA_QT_MODULES="sql;waylandcompositor;waylandclient"
export DEPLOY_PLATFORM_THEMES=true
export LINUXDEPLOY_EXCLUDED_LIBRARIES="libmysqlclient.so;libqsqlmimer.so;libqsqlmysql.so;libqsqlodbc.so;libqsqlpsql.so;libqsqloci.so;libqsqlibase.so"
"$LINUXDEPLOY" \
--appdir "$APPDIR" \
-e "$APPDIR/usr/bin/cool-retro-term" \
-i "$REPO_ROOT/app/icons/256x256/cool-retro-term.png" \
-d "$REPO_ROOT/cool-retro-term.desktop" \
--plugin qt \
--output appimage
APPIMAGE_PATH="$(ls -1 ./*.AppImage | head -n 1)"
APPIMAGE_OUT="cool-retro-term-${VERSION}.AppImage"
mv "$APPIMAGE_PATH" "$OLD_CWD/$APPIMAGE_OUT"
popd

47
scripts/build-dmg.sh Executable file
View File

@@ -0,0 +1,47 @@
#!/usr/bin/env bash
set -euo pipefail
set -x
REPO_ROOT="$(cd "$(dirname "$0")/.." && pwd -P)"
OLD_CWD="$(pwd -P)"
BUILD_DIR="$REPO_ROOT/build/dmg"
APP="cool-retro-term.app"
QML_DIR="$REPO_ROOT/app/qml"
JOBS="${JOBS:-$(sysctl -n hw.ncpu 2>/dev/null || echo 4)}"
VERSION="$(git -C "$REPO_ROOT" describe --tags --always --dirty=-dirty 2>/dev/null || true)"
if [ -z "$VERSION" ]; then
VERSION="unknown"
fi
if ! command -v qmake >/dev/null; then
echo "qmake not found in PATH." >&2
exit 1
fi
QT_DIR="${QT_DIR:-$(qmake -query QT_INSTALL_PREFIX)}"
QT_BIN="${QT_DIR%/}/bin"
mkdir -p "$BUILD_DIR"
rm -f "$BUILD_DIR/${APP%.app}.dmg"
pushd "$BUILD_DIR"
"$QT_BIN/qmake" CONFIG+=release "$REPO_ROOT/cool-retro-term.pro"
make -j"$JOBS"
PLUGIN_DST="$APP/Contents/PlugIns/qmltermwidget"
rm -rf "$PLUGIN_DST"
mkdir -p "$APP/Contents/PlugIns"
cp -R qmltermwidget/QMLTermWidget "$PLUGIN_DST"
export QML_IMPORT_PATH="$PWD/$APP/Contents/PlugIns"
"$QT_BIN/macdeployqt" "$APP" -qmldir="$QML_DIR"
rm -f "$APP/Contents/PlugIns/sqldrivers/"libqsql{odbc,psql,mimer}.dylib 2>/dev/null || true
# Remove stale signatures and ad-hoc sign so Gatekeeper doesn't report corruption.
codesign --remove-signature "$APP" 2>/dev/null || true
rm -rf "$APP/Contents/_CodeSignature"
codesign --force --deep --sign - "$APP"
DMG_OUT="${APP%.app}-${VERSION}.dmg"
hdiutil create -volname "${APP%.app}" -srcfolder "$APP" -ov -format UDZO "$DMG_OUT"
mv "$BUILD_DIR/$DMG_OUT" "$OLD_CWD/$DMG_OUT"
popd