Merge branch 'main' of https://github.com/stoatchat/for-desktop into feat/minimise-to-tray-startup
This commit is contained in:
commit
2679e78d68
|
|
@ -1,7 +1,8 @@
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- "**"
|
- main
|
||||||
|
pull_request:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
|
|
@ -15,16 +16,10 @@ jobs:
|
||||||
- name: Checkout assets
|
- name: Checkout assets
|
||||||
run: git -c submodule."assets".update=checkout submodule update --init assets
|
run: git -c submodule."assets".update=checkout submodule update --init assets
|
||||||
|
|
||||||
- name: Install pnpm
|
- name: Setup Mise
|
||||||
uses: pnpm/action-setup@v4
|
uses: immich-app/devtools/actions/use-mise@cd24790a7f5f6439ac32cc94f5523cb2de8bfa8c # use-mise-action-v1.1.0
|
||||||
with:
|
with:
|
||||||
run_install: false
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
- name: Install Node.js
|
|
||||||
uses: actions/setup-node@v4
|
|
||||||
with:
|
|
||||||
node-version: 22
|
|
||||||
cache: "pnpm"
|
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: pnpm install
|
run: pnpm install
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,19 @@
|
||||||
|
name: Git Town
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
git-town:
|
||||||
|
name: Display the branch stack
|
||||||
|
runs-on: ubuntu-slim
|
||||||
|
|
||||||
|
if: ${{ !startsWith(github.head_ref, 'release-please--') }}
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
pull-requests: write
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
|
||||||
|
- uses: stoatchat/action-git-town@4bc5c942e4603bffa0806b51d5fe5f0bc5deb0ac
|
||||||
|
|
@ -13,6 +13,14 @@ Application for Windows, macOS, and Linux.
|
||||||
</div>
|
</div>
|
||||||
<br/>
|
<br/>
|
||||||
|
|
||||||
|
## Installation
|
||||||
|
|
||||||
|
<a href="https://repology.org/project/stoat-desktop/versions">
|
||||||
|
<img src="https://repology.org/badge/vertical-allrepos/stoat-desktop.svg" alt="Packaging status" align="right">
|
||||||
|
</a>
|
||||||
|
|
||||||
|
- All downloads and instructions for Stoat can be found on our [Website](https://stoat.chat/download).
|
||||||
|
|
||||||
## Development Guide
|
## Development Guide
|
||||||
|
|
||||||
_Contribution guidelines for Desktop app TBA!_
|
_Contribution guidelines for Desktop app TBA!_
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,11 @@
|
||||||
|
[Desktop Entry]
|
||||||
|
Name=Stoat
|
||||||
|
Comment=Open source, user-first chat platform
|
||||||
|
Exec=stoat-desktop
|
||||||
|
Terminal=false
|
||||||
|
Type=Application
|
||||||
|
Icon=chat.stoat.StoatDesktop
|
||||||
|
Categories=Network;InstantMessaging
|
||||||
|
StartupWMClass=stoat-desktop
|
||||||
|
X-Desktop-File-Install-Version=0.26
|
||||||
|
X-Flatpak=chat.stoat.StoatDesktop
|
||||||
|
|
@ -0,0 +1,70 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<component type="desktop">
|
||||||
|
<id>chat.stoat.StoatDesktop</id>
|
||||||
|
<launchable type="desktop-id">chat.stoat.StoatDesktop.desktop</launchable>
|
||||||
|
<name>Stoat</name>
|
||||||
|
<developer id="chat.stoat">
|
||||||
|
<name>Revolt Platforms Ltd</name>
|
||||||
|
</developer>
|
||||||
|
<summary>Open source, user-first chat platform</summary>
|
||||||
|
<metadata_license>CC0-1.0</metadata_license>
|
||||||
|
<project_license>AGPL-3.0</project_license>
|
||||||
|
<icon type="remote" height="256" width="256">
|
||||||
|
https://raw.githubusercontent.com/stoatchat/assets/f106946659af67ad4f008588ac51570029b2fd47/desktop/icon.png</icon>
|
||||||
|
<description>
|
||||||
|
<p>Stoat is an open source, user-first chat platform. Send messages, share
|
||||||
|
images, mention users, and join voice channels — all from a native desktop
|
||||||
|
application.</p>
|
||||||
|
</description>
|
||||||
|
<screenshots>
|
||||||
|
<screenshot type="default">
|
||||||
|
<caption>Main window</caption>
|
||||||
|
<image>screenshot.png</image>
|
||||||
|
</screenshot>
|
||||||
|
</screenshots>
|
||||||
|
<releases>
|
||||||
|
<release date="2026-02-14" version="1.2.0">
|
||||||
|
<description>
|
||||||
|
<p>Features:</p>
|
||||||
|
<ul>
|
||||||
|
<li>New Branding</li>
|
||||||
|
<li>Persist and restore window size and position</li>
|
||||||
|
</ul>
|
||||||
|
<p>Bug Fixes:</p>
|
||||||
|
<ul>
|
||||||
|
<li>App Autostart</li>
|
||||||
|
</ul>
|
||||||
|
</description>
|
||||||
|
</release>
|
||||||
|
<release date="2025-12-29" version="1.1.12">
|
||||||
|
<description>
|
||||||
|
<p>Bug fixes:</p>
|
||||||
|
<ul>
|
||||||
|
<li>Add NixOS compatibility for electron startup</li>
|
||||||
|
<li>Correctly load badge count; expose to renderer</li>
|
||||||
|
<li>Fix event listener accumulation from rpc client</li>
|
||||||
|
<li>Fix macOS tray icon size</li>
|
||||||
|
<li>Fix RPC largeImageText</li>
|
||||||
|
<li>Use the correct argument for auto start</li>
|
||||||
|
</ul>
|
||||||
|
</description>
|
||||||
|
</release>
|
||||||
|
</releases>
|
||||||
|
<url type="bugtracker">https://github.com/stoatchat/for-desktop/issues</url>
|
||||||
|
<url type="homepage">https://stoat.chat</url>
|
||||||
|
<url type="vcs-browser">https://github.com/stoatchat/for-desktop</url>
|
||||||
|
<content_rating type="oars-1.1">
|
||||||
|
<content_attribute id="social-chat">intense</content_attribute>
|
||||||
|
<content_attribute id="social-info">intense</content_attribute>
|
||||||
|
<content_attribute id="social-audio">intense</content_attribute>
|
||||||
|
<content_attribute id="social-contacts">intense</content_attribute>
|
||||||
|
</content_rating>
|
||||||
|
<requires>
|
||||||
|
<display_length compare="ge">940</display_length>
|
||||||
|
<internet>always</internet>
|
||||||
|
</requires>
|
||||||
|
<supports>
|
||||||
|
<control>keyboard</control>
|
||||||
|
<control>pointing</control>
|
||||||
|
</supports>
|
||||||
|
</component>
|
||||||
25
default.nix
25
default.nix
|
|
@ -1,16 +1,13 @@
|
||||||
{
|
{ pkgs ? import (fetchTarball {
|
||||||
pkgs ? import <nixpkgs> { },
|
url = "https://github.com/NixOS/nixpkgs/archive/77ef7a29d276c6d8303aece3444d61118ef71ac2.tar.gz";
|
||||||
|
sha256 = "0pm4l48jq8plzrrrisimahxqlcpx7qqq9c99hylmf7p3zlc3phsy";
|
||||||
|
}) {},
|
||||||
}:
|
}:
|
||||||
|
|
||||||
pkgs.mkShell rec {
|
pkgs.mkShell rec {
|
||||||
buildInputs = [
|
buildInputs = with pkgs; [
|
||||||
# Tools
|
# Tools
|
||||||
pkgs.git
|
pkgs.mise
|
||||||
pkgs.gh
|
|
||||||
|
|
||||||
# Node
|
|
||||||
pkgs.nodejs
|
|
||||||
pkgs.nodejs.pkgs.pnpm
|
|
||||||
|
|
||||||
# Electron
|
# Electron
|
||||||
(pkgs.writeShellScriptBin "electron-nix" ''
|
(pkgs.writeShellScriptBin "electron-nix" ''
|
||||||
|
|
@ -29,5 +26,15 @@ pkgs.mkShell rec {
|
||||||
pkgs.flatpak-builder
|
pkgs.flatpak-builder
|
||||||
pkgs.elfutils
|
pkgs.elfutils
|
||||||
# flatpak remote-add --if-not-exists --user flathub https://dl.flathub.org/repo/flathub.flatpakrepo
|
# flatpak remote-add --if-not-exists --user flathub https://dl.flathub.org/repo/flathub.flatpakrepo
|
||||||
|
|
||||||
|
(writeShellScriptBin "fish" ''
|
||||||
|
exec ${pkgs.fish}/bin/fish -C 'mise activate fish | source' "$@"
|
||||||
|
'')
|
||||||
];
|
];
|
||||||
|
|
||||||
|
shellHook = ''
|
||||||
|
export ELECTRON_OVERRIDE_DIST_PATH="${pkgs.electron}/bin"
|
||||||
|
export MISE_NODE_COMPILE=false
|
||||||
|
eval "$(mise activate bash)"
|
||||||
|
'';
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -58,7 +58,7 @@ if (!process.env.PLATFORM) {
|
||||||
description: STRINGS.description,
|
description: STRINGS.description,
|
||||||
productName: STRINGS.name,
|
productName: STRINGS.name,
|
||||||
productDescription: STRINGS.description,
|
productDescription: STRINGS.description,
|
||||||
runtimeVersion: "21.08",
|
runtimeVersion: "25.08",
|
||||||
icon: `${ASSET_DIR}/icon.png`,
|
icon: `${ASSET_DIR}/icon.png`,
|
||||||
categories: ["Network"],
|
categories: ["Network"],
|
||||||
modules: [
|
modules: [
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,5 @@
|
||||||
|
[tools]
|
||||||
|
node = "25.4.0"
|
||||||
|
pnpm = "10.28.1"
|
||||||
|
gh = "2.25.0"
|
||||||
|
"github:git-town/git-town" = "22.4.0"
|
||||||
|
|
@ -1,7 +1,9 @@
|
||||||
nodeLinker: hoisted
|
nodeLinker: hoisted
|
||||||
|
|
||||||
onlyBuiltDependencies:
|
onlyBuiltDependencies:
|
||||||
|
- bufferutil
|
||||||
- electron
|
- electron
|
||||||
- electron-winstaller
|
- electron-winstaller
|
||||||
- esbuild
|
- esbuild
|
||||||
- register-scheme
|
- register-scheme
|
||||||
|
- utf-8-validate
|
||||||
|
|
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 702 KiB |
16
src/main.ts
16
src/main.ts
|
|
@ -1,6 +1,6 @@
|
||||||
import { updateElectronApp } from "update-electron-app";
|
import { IUpdateInfo, updateElectronApp } from "update-electron-app";
|
||||||
|
|
||||||
import { BrowserWindow, app, shell } from "electron";
|
import { BrowserWindow, app, shell, Notification } from "electron";
|
||||||
import started from "electron-squirrel-startup";
|
import started from "electron-squirrel-startup";
|
||||||
|
|
||||||
import { autoLaunch } from "./native/autoLaunch";
|
import { autoLaunch } from "./native/autoLaunch";
|
||||||
|
|
@ -24,9 +24,19 @@ if (!config.hardwareAcceleration) {
|
||||||
// ensure only one copy of the application can run
|
// ensure only one copy of the application can run
|
||||||
const acquiredLock = app.requestSingleInstanceLock();
|
const acquiredLock = app.requestSingleInstanceLock();
|
||||||
|
|
||||||
|
const onNotifyUser = (_info: IUpdateInfo) => {
|
||||||
|
const notification = new Notification({
|
||||||
|
title: 'Update Available',
|
||||||
|
body: 'Restart the app to install the update.',
|
||||||
|
silent: true
|
||||||
|
})
|
||||||
|
|
||||||
|
notification.show()
|
||||||
|
}
|
||||||
|
|
||||||
if (acquiredLock) {
|
if (acquiredLock) {
|
||||||
// start auto update logic
|
// start auto update logic
|
||||||
updateElectronApp();
|
updateElectronApp({onNotifyUser})
|
||||||
|
|
||||||
// create and configure the app when electron is ready
|
// create and configure the app when electron is ready
|
||||||
app.on("ready", () => {
|
app.on("ready", () => {
|
||||||
|
|
|
||||||
|
|
@ -28,8 +28,12 @@ export function initTray() {
|
||||||
tray.setToolTip("Stoat for Desktop");
|
tray.setToolTip("Stoat for Desktop");
|
||||||
tray.setImage(trayIcon);
|
tray.setImage(trayIcon);
|
||||||
tray.on("click", () => {
|
tray.on("click", () => {
|
||||||
mainWindow.show();
|
if (mainWindow.isVisible()) {
|
||||||
mainWindow.focus();
|
mainWindow.hide();
|
||||||
|
} else {
|
||||||
|
mainWindow.show();
|
||||||
|
mainWindow.focus();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -116,7 +116,7 @@ export function createMainWindow() {
|
||||||
|
|
||||||
// rebind zoom controls to be more sensible
|
// rebind zoom controls to be more sensible
|
||||||
mainWindow.webContents.on("before-input-event", (event, input) => {
|
mainWindow.webContents.on("before-input-event", (event, input) => {
|
||||||
if (input.control && input.key === "=") {
|
if (input.control && (input.key === "=" || input.key === "+")) {
|
||||||
// zoom in (+)
|
// zoom in (+)
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
mainWindow.webContents.setZoomLevel(
|
mainWindow.webContents.setZoomLevel(
|
||||||
|
|
@ -128,6 +128,16 @@ export function createMainWindow() {
|
||||||
mainWindow.webContents.setZoomLevel(
|
mainWindow.webContents.setZoomLevel(
|
||||||
mainWindow.webContents.getZoomLevel() - 1,
|
mainWindow.webContents.getZoomLevel() - 1,
|
||||||
);
|
);
|
||||||
|
} else if (input.control && input.key === "0") {
|
||||||
|
// reset zoom to default.
|
||||||
|
event.preventDefault();
|
||||||
|
mainWindow.webContents.setZoomLevel(0);
|
||||||
|
} else if (
|
||||||
|
input.key === "F5" ||
|
||||||
|
((input.control || input.meta) && input.key.toLowerCase() === "r")
|
||||||
|
) {
|
||||||
|
event.preventDefault();
|
||||||
|
mainWindow.webContents.reload();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue