Compare commits
39 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 2a48059186 | |||
| b57faa2c59 | |||
| c1e4d4ee91 | |||
| ffe17ec2c5 | |||
| 63b9ea818a | |||
| 58ccb63d23 | |||
| 8284117e76 | |||
| 897d706983 | |||
| 7d2f296ca7 | |||
| 17d6d174ae | |||
| 742a95f3cb | |||
| 2b962c5d06 | |||
| def29f9b3c | |||
| e2dc20b755 | |||
| 2e99b19353 | |||
| 1243f88b21 | |||
| 7d3d80ae6e | |||
| b765e84151 | |||
| 8910dcba92 | |||
| 127d1430a9 | |||
| 3bf697d1a9 | |||
| a162219668 | |||
| dad885aa1d | |||
| 7b9918f43b | |||
| 6ca1143c22 | |||
| e431f205c2 | |||
| eac8195f68 | |||
| ea7c57962b | |||
| 96fa8cc647 | |||
| 6817b554e5 | |||
| cb373b6dc6 | |||
| 532af4a680 | |||
| 3eb9b8e84b | |||
| 6907a33dc7 | |||
| 1aa5f7e1c3 | |||
| e11c0490fc | |||
| 61ffe199ee | |||
| 5eecab5943 | |||
| b1715f4323 |
@@ -1,7 +1,8 @@
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- "**"
|
||||
- main
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
build:
|
||||
@@ -15,16 +16,10 @@ jobs:
|
||||
- name: Checkout assets
|
||||
run: git -c submodule."assets".update=checkout submodule update --init assets
|
||||
|
||||
- name: Install pnpm
|
||||
uses: pnpm/action-setup@v4
|
||||
- name: Setup Mise
|
||||
uses: immich-app/devtools/actions/use-mise@cd24790a7f5f6439ac32cc94f5523cb2de8bfa8c # use-mise-action-v1.1.0
|
||||
with:
|
||||
run_install: false
|
||||
|
||||
- name: Install Node.js
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 22
|
||||
cache: "pnpm"
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Install dependencies
|
||||
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
|
||||
@@ -1,49 +0,0 @@
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- v*
|
||||
|
||||
jobs:
|
||||
release:
|
||||
name: Publish App
|
||||
runs-on: ${{ matrix.os }}
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ubuntu-latest, windows-latest, macos-latest]
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Checkout assets
|
||||
run: git -c submodule."assets".update=checkout submodule update --init assets
|
||||
|
||||
- name: Install pnpm
|
||||
uses: pnpm/action-setup@v4
|
||||
with:
|
||||
run_install: false
|
||||
|
||||
- name: Install Node.js
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 22
|
||||
cache: "pnpm"
|
||||
|
||||
- name: Install dependencies
|
||||
run: pnpm install
|
||||
|
||||
- name: Publish
|
||||
run: |
|
||||
pnpm run publish
|
||||
if [ "${{ matrix.os }}" = "macos-latest" ]; then
|
||||
pnpm run publish --arch=x64
|
||||
elif [ "${{ matrix.os }}" = "ubuntu-latest" ]; then
|
||||
pnpm run publish --arch=arm64
|
||||
fi
|
||||
env:
|
||||
PLATFORM: ${{ matrix.os }}
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
@@ -0,0 +1,88 @@
|
||||
name: Release Please
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main] # updates/opens the release PR when commits land on main
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
pull-requests: write
|
||||
id-token: write
|
||||
|
||||
concurrency:
|
||||
group: release-please
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
release-please:
|
||||
name: Release Please
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
release_created: ${{ steps.rp.outputs.release_created }}
|
||||
steps:
|
||||
- id: app-token
|
||||
uses: actions/create-github-app-token@v2
|
||||
with:
|
||||
app-id: ${{ secrets.GH_STOAT_RELEASE_APP_ID }}
|
||||
private-key: ${{ secrets.GH_STOAT_RELEASE_APP_PRIVATE_KEY }}
|
||||
- id: rp
|
||||
uses: googleapis/release-please-action@v4
|
||||
with:
|
||||
token: ${{ steps.app-token.outputs.token }}
|
||||
config-file: release-please-config.json
|
||||
|
||||
publish-release:
|
||||
name: Publish App
|
||||
needs: release-please
|
||||
if: needs.release-please.outputs.release_created == 'true'
|
||||
runs-on: ${{ matrix.os }}
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ubuntu-latest, windows-latest, macos-latest]
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Checkout assets
|
||||
run: git -c submodule."assets".update=checkout submodule update --init assets
|
||||
|
||||
- name: Install pnpm
|
||||
uses: pnpm/action-setup@v4
|
||||
with:
|
||||
run_install: false
|
||||
|
||||
- name: Install Node.js
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 22
|
||||
cache: "pnpm"
|
||||
|
||||
- name: Install dependencies
|
||||
run: pnpm install
|
||||
|
||||
- name: Publish
|
||||
run: |
|
||||
pnpm run publish
|
||||
env:
|
||||
PLATFORM: ${{ matrix.os }}
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Publish macOS x64
|
||||
if: matrix.os == 'macos-latest'
|
||||
run: pnpm run publish --arch=x64
|
||||
env:
|
||||
PLATFORM: ${{ matrix.os }}
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Publish Linux arm64
|
||||
if: matrix.os == 'ubuntu-latest'
|
||||
run: pnpm run publish --arch=arm64
|
||||
env:
|
||||
PLATFORM: ${{ matrix.os }}
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
@@ -0,0 +1,23 @@
|
||||
name: Release Webhook
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
release:
|
||||
types: [published]
|
||||
|
||||
jobs:
|
||||
release-webhook:
|
||||
name: Send Release Webhook
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Send release notification webhook
|
||||
env:
|
||||
TAG_NAME: ${{ github.event.release.tag_name }}
|
||||
REPOSITORY: ${{ github.repository }}
|
||||
WEBHOOK_URL: ${{ secrets.STOAT_WEBHOOK_UPDATES_URL }}
|
||||
run: |
|
||||
RELEASE_URL="https://github.com/${REPOSITORY}/releases/tag/${TAG_NAME}"
|
||||
curl -X POST "$WEBHOOK_URL" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d "{\"content\": \"$RELEASE_URL\"}"
|
||||
@@ -0,0 +1,20 @@
|
||||
name: "Lint PR"
|
||||
|
||||
on:
|
||||
pull_request_target:
|
||||
types:
|
||||
- opened
|
||||
- reopened
|
||||
- edited
|
||||
- synchronize
|
||||
|
||||
jobs:
|
||||
main:
|
||||
name: Validate PR title
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
pull-requests: read
|
||||
steps:
|
||||
- uses: amannn/action-semantic-pull-request@v6
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
@@ -0,0 +1,3 @@
|
||||
{
|
||||
".": "1.3.0"
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
# Changelog
|
||||
|
||||
## [1.3.0](https://github.com/stoatchat/for-desktop/compare/v1.2.0...v1.3.0) (2026-02-18)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* minimise-to-tray-on-startup ([#126](https://github.com/stoatchat/for-desktop/issues/126)) ([8284117](https://github.com/stoatchat/for-desktop/commit/8284117e76c0fcff4091de3ef623014e4594a593))
|
||||
* Reload/Refresh shortcut ([#119](https://github.com/stoatchat/for-desktop/issues/119)) ([2e99b19](https://github.com/stoatchat/for-desktop/commit/2e99b19353fbd45d9fdf1d148bae3a8a19c788ed))
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Add common zoom-reset shortcut. ([#112](https://github.com/stoatchat/for-desktop/issues/112)) ([def29f9](https://github.com/stoatchat/for-desktop/commit/def29f9b3c1205944aab58beb8000815d41633b5))
|
||||
* allow CTRL+"+" to also zoom in. ([#108](https://github.com/stoatchat/for-desktop/issues/108)) ([2b962c5](https://github.com/stoatchat/for-desktop/commit/2b962c5d066787601223368ee7dcc1e46a345b8a))
|
||||
* App-maximized-2nd-monitor ([897d706](https://github.com/stoatchat/for-desktop/commit/897d706983a347938a2fb42ba8e58e40794bba13))
|
||||
* don't re-enable abutostart ([63b9ea8](https://github.com/stoatchat/for-desktop/commit/63b9ea818a9f32ca8535948e18752726c0f50a12))
|
||||
* firstLaunch = false after initial setup ([#131](https://github.com/stoatchat/for-desktop/issues/131)) ([63b9ea8](https://github.com/stoatchat/for-desktop/commit/63b9ea818a9f32ca8535948e18752726c0f50a12))
|
||||
* flatpak icons not building correctly and wayland support ([#132](https://github.com/stoatchat/for-desktop/issues/132)) ([ffe17ec](https://github.com/stoatchat/for-desktop/commit/ffe17ec2c54fca6967435b8a4ada7fa8d4da7b33))
|
||||
* replace default dialog with notification ([#98](https://github.com/stoatchat/for-desktop/issues/98)) ([7d2f296](https://github.com/stoatchat/for-desktop/commit/7d2f296ca72bbd7ad694c66a917d47067f883fc5))
|
||||
* toggle window visibility on tray click instead of always showing ([#103](https://github.com/stoatchat/for-desktop/issues/103)) ([742a95f](https://github.com/stoatchat/for-desktop/commit/742a95f3cb820c5b5398c815b7b45017b6b06053))
|
||||
* try to restore maximised windows to correct display ([#92](https://github.com/stoatchat/for-desktop/issues/92)) ([897d706](https://github.com/stoatchat/for-desktop/commit/897d706983a347938a2fb42ba8e58e40794bba13))
|
||||
* use template icon for macOS tray, use higher res icons for other platforms ([#130](https://github.com/stoatchat/for-desktop/issues/130)) ([58ccb63](https://github.com/stoatchat/for-desktop/commit/58ccb63d23541a03e05a48a37a98f883a2ba0d3f))
|
||||
|
||||
## [1.2.0](https://github.com/stoatchat/for-desktop/compare/v1.1.12...v1.2.0) (2026-02-14)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* new branding ([#87](https://github.com/stoatchat/for-desktop/issues/87)) ([8910dcb](https://github.com/stoatchat/for-desktop/commit/8910dcba923b55df789c0541b59a6a6321a28768))
|
||||
* persist and restore window size and position ([#74](https://github.com/stoatchat/for-desktop/issues/74)) ([3bf697d](https://github.com/stoatchat/for-desktop/commit/3bf697d1a9aba739b6954c8469223f51093497cc))
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* App Autostart ([#68](https://github.com/stoatchat/for-desktop/issues/68)) ([127d143](https://github.com/stoatchat/for-desktop/commit/127d1430a9c630e0429c9cc50d57ee316a63ebe5))
|
||||
|
||||
## [1.1.12](https://github.com/stoatchat/for-desktop/compare/v1.1.11...v1.1.12) (2025-12-29)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* add NixOS compatibility for electron startup ([#23](https://github.com/stoatchat/for-desktop/issues/23)) ([3eb9b8e](https://github.com/stoatchat/for-desktop/commit/3eb9b8e84bf05debf9843b80c468911fd095f4a0))
|
||||
* correctly load badge count; expose to renderer ([#25](https://github.com/stoatchat/for-desktop/issues/25)) ([6817b55](https://github.com/stoatchat/for-desktop/commit/6817b554e57c5a65b7b4aca7d1cc4e05cd6f01b7))
|
||||
* event listener accumulation from rpc client ([#26](https://github.com/stoatchat/for-desktop/issues/26)) ([96fa8cc](https://github.com/stoatchat/for-desktop/commit/96fa8cc647029cb53e5d619b94debc6cdfdf32f6))
|
||||
* **macos:** tray icon size ([5eecab5](https://github.com/stoatchat/for-desktop/commit/5eecab59431cb4966eaa1fc907a8e5c16c813230))
|
||||
* rpc should define largeImageText ([#21](https://github.com/stoatchat/for-desktop/issues/21)) ([cb373b6](https://github.com/stoatchat/for-desktop/commit/cb373b6dc62630147151039c3711aef74c8c2d88))
|
||||
* use the correct argument for auto start ([#22](https://github.com/stoatchat/for-desktop/issues/22)) ([532af4a](https://github.com/stoatchat/for-desktop/commit/532af4a680069f72734148b0ccdacec6c435e640)), closes [#20](https://github.com/stoatchat/for-desktop/issues/20)
|
||||
@@ -13,6 +13,14 @@ Application for Windows, macOS, and Linux.
|
||||
</div>
|
||||
<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
|
||||
|
||||
_Contribution guidelines for Desktop app TBA!_
|
||||
@@ -74,11 +82,3 @@ git -c submodule."assets".update=checkout submodule update --init assets
|
||||
```
|
||||
|
||||
Currently, this is required to build, any forks are expected to provide their own assets.
|
||||
|
||||
## Publishing Guide
|
||||
|
||||
To publish a new version, simply tag a new release by:
|
||||
|
||||
1. Edit `package.json` with the new version
|
||||
2. Create a new tag from latest commit by `git tag v1.0.0`
|
||||
3. Push the tag and commit by `git push --atomic origin main v1.0.0`
|
||||
|
||||
+1
-1
Submodule assets updated: 628eb2f825...bd432f2298
@@ -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>
|
||||
+16
-9
@@ -1,16 +1,13 @@
|
||||
{
|
||||
pkgs ? import <nixpkgs> { },
|
||||
{ pkgs ? import (fetchTarball {
|
||||
url = "https://github.com/NixOS/nixpkgs/archive/77ef7a29d276c6d8303aece3444d61118ef71ac2.tar.gz";
|
||||
sha256 = "0pm4l48jq8plzrrrisimahxqlcpx7qqq9c99hylmf7p3zlc3phsy";
|
||||
}) {},
|
||||
}:
|
||||
|
||||
pkgs.mkShell rec {
|
||||
buildInputs = [
|
||||
buildInputs = with pkgs; [
|
||||
# Tools
|
||||
pkgs.git
|
||||
pkgs.gh
|
||||
|
||||
# Node
|
||||
pkgs.nodejs
|
||||
pkgs.nodejs.pkgs.pnpm
|
||||
pkgs.mise
|
||||
|
||||
# Electron
|
||||
(pkgs.writeShellScriptBin "electron-nix" ''
|
||||
@@ -29,5 +26,15 @@ pkgs.mkShell rec {
|
||||
pkgs.flatpak-builder
|
||||
pkgs.elfutils
|
||||
# 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)"
|
||||
'';
|
||||
}
|
||||
|
||||
+10
-3
@@ -58,8 +58,15 @@ if (!process.env.PLATFORM) {
|
||||
description: STRINGS.description,
|
||||
productName: STRINGS.name,
|
||||
productDescription: STRINGS.description,
|
||||
runtimeVersion: "21.08",
|
||||
icon: `${ASSET_DIR}/icon.png`,
|
||||
runtimeVersion: "25.08",
|
||||
icon: {
|
||||
"16x16": `${ASSET_DIR}/hicolor/16x16.png`,
|
||||
"32x32": `${ASSET_DIR}/hicolor/32x32.png`,
|
||||
"64x64": `${ASSET_DIR}/hicolor/64x64.png`,
|
||||
"128x128": `${ASSET_DIR}/hicolor/128x128.png`,
|
||||
"256x256": `${ASSET_DIR}/hicolor/256x256.png`,
|
||||
"512x512": `${ASSET_DIR}/hicolor/512x512.png`,
|
||||
} as unknown,
|
||||
categories: ["Network"],
|
||||
modules: [
|
||||
// use the latest zypak -- Electron sandboxing for Flatpak
|
||||
@@ -77,7 +84,7 @@ if (!process.env.PLATFORM) {
|
||||
finishArgs: [
|
||||
// default arguments found by running
|
||||
// DEBUG=electron-installer-flatpak* pnpm make
|
||||
"--socket=x11",
|
||||
"--socket=fallback-x11",
|
||||
"--share=ipc",
|
||||
"--device=dri",
|
||||
"--socket=pulseaudio",
|
||||
|
||||
@@ -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
-1
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "stoat-desktop",
|
||||
"productName": "stoat-desktop",
|
||||
"version": "1.1.10",
|
||||
"version": "1.3.0",
|
||||
"main": ".vite/build/main.js",
|
||||
"repository": "stoatchat/desktop",
|
||||
"scripts": {
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
nodeLinker: hoisted
|
||||
|
||||
onlyBuiltDependencies:
|
||||
- bufferutil
|
||||
- electron
|
||||
- electron-winstaller
|
||||
- esbuild
|
||||
- register-scheme
|
||||
- utf-8-validate
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"packages": {
|
||||
".": {
|
||||
"changelog-path": "CHANGELOG.md",
|
||||
"release-type": "node",
|
||||
"bump-minor-pre-major": false,
|
||||
"bump-patch-for-minor-pre-major": false,
|
||||
"draft": false,
|
||||
"prerelease": false,
|
||||
"include-component-in-tag": false
|
||||
}
|
||||
},
|
||||
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json"
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 702 KiB |
Vendored
+4
@@ -6,6 +6,10 @@ declare type DesktopConfig = {
|
||||
hardwareAcceleration: boolean;
|
||||
discordRpc: boolean;
|
||||
windowState: {
|
||||
x: number;
|
||||
y: number;
|
||||
width: number;
|
||||
height: number;
|
||||
isMaximised: boolean;
|
||||
};
|
||||
};
|
||||
|
||||
+17
-5
@@ -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, Notification, app, shell } from "electron";
|
||||
import started from "electron-squirrel-startup";
|
||||
|
||||
import { autoLaunch } from "./native/autoLaunch";
|
||||
@@ -24,21 +24,33 @@ if (!config.hardwareAcceleration) {
|
||||
// ensure only one copy of the application can run
|
||||
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) {
|
||||
// start auto update logic
|
||||
updateElectronApp();
|
||||
updateElectronApp({ onNotifyUser });
|
||||
|
||||
// create and configure the app when electron is ready
|
||||
app.on("ready", () => {
|
||||
// create window and application contexts
|
||||
createMainWindow();
|
||||
|
||||
// enable auto start on Windows and MacOS
|
||||
if (config.firstLaunch) {
|
||||
if (process.platform === "win32" || process.platform === "darwin") {
|
||||
autoLaunch.enable();
|
||||
}
|
||||
config.firstLaunch = false;
|
||||
}
|
||||
|
||||
// create window and application contexts
|
||||
createMainWindow();
|
||||
initTray();
|
||||
initDiscordRpc();
|
||||
|
||||
|
||||
@@ -5,15 +5,23 @@ import { ipcMain } from "electron";
|
||||
import { mainWindow } from "./window";
|
||||
|
||||
export const autoLaunch = new AutoLaunch({
|
||||
name: "Revolt",
|
||||
name: "Stoat",
|
||||
});
|
||||
|
||||
ipcMain.on("isAutostart?", () =>
|
||||
autoLaunch
|
||||
.isEnabled()
|
||||
.then((enabled) => mainWindow.webContents.send("isAutostart", enabled)),
|
||||
);
|
||||
ipcMain.handle("getAutostart", async () => {
|
||||
const enabled = await autoLaunch.isEnabled();
|
||||
return enabled;
|
||||
});
|
||||
|
||||
ipcMain.on("setAutostart", (state) =>
|
||||
state ? autoLaunch.enable() : autoLaunch.disable(),
|
||||
);
|
||||
ipcMain.handle("setAutostart", async (_event, state: boolean) => {
|
||||
if (state) {
|
||||
await autoLaunch.enable();
|
||||
console.log("Received new configuration autoStart: true");
|
||||
} else {
|
||||
await autoLaunch.disable();
|
||||
console.log("Received new configuration autoStart: false");
|
||||
}
|
||||
|
||||
const enabled = await autoLaunch.isEnabled();
|
||||
return enabled;
|
||||
});
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import dbus from "@homebridge/dbus-native";
|
||||
|
||||
import { NativeImage, app, nativeImage } from "electron";
|
||||
import { NativeImage, app, ipcMain, nativeImage } from "electron";
|
||||
|
||||
import { mainWindow } from "./window";
|
||||
|
||||
@@ -21,7 +21,7 @@ export async function setBadgeCount(count: number) {
|
||||
nativeIcons[count] = nativeImage.createFromDataURL(
|
||||
await import(
|
||||
`../../assets/desktop/badges/${Math.min(count, 10)}.ico?asset`
|
||||
),
|
||||
).then((asset) => asset.default),
|
||||
);
|
||||
|
||||
mainWindow.setOverlayIcon(
|
||||
@@ -65,3 +65,5 @@ export async function setBadgeCount(count: number) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
ipcMain.on("setBadgeCount", (_event, count: number) => setBadgeCount(count));
|
||||
|
||||
+36
-12
@@ -16,6 +16,9 @@ const schema = {
|
||||
minimiseToTray: {
|
||||
type: "boolean",
|
||||
} as JSONSchema.Boolean,
|
||||
startMinimisedToTray: {
|
||||
type: "boolean",
|
||||
} as JSONSchema.Boolean,
|
||||
spellchecker: {
|
||||
type: "boolean",
|
||||
} as JSONSchema.Boolean,
|
||||
@@ -28,18 +31,18 @@ const schema = {
|
||||
windowState: {
|
||||
type: "object",
|
||||
properties: {
|
||||
// x: {
|
||||
// type: 'number'
|
||||
// } as JSONSchema.Number,
|
||||
// y: {
|
||||
// type: 'number'
|
||||
// } as JSONSchema.Number,
|
||||
// width: {
|
||||
// type: 'number'
|
||||
// } as JSONSchema.Number,
|
||||
// height: {
|
||||
// type: 'number'
|
||||
// } as JSONSchema.Number,
|
||||
x: {
|
||||
type: "number",
|
||||
} as JSONSchema.Number,
|
||||
y: {
|
||||
type: "number",
|
||||
} as JSONSchema.Number,
|
||||
width: {
|
||||
type: "number",
|
||||
} as JSONSchema.Number,
|
||||
height: {
|
||||
type: "number",
|
||||
} as JSONSchema.Number,
|
||||
isMaximised: {
|
||||
type: "boolean",
|
||||
} as JSONSchema.Boolean,
|
||||
@@ -53,10 +56,15 @@ const store = new Store({
|
||||
firstLaunch: true,
|
||||
customFrame: true,
|
||||
minimiseToTray: true,
|
||||
startMinimisedToTray: false,
|
||||
spellchecker: true,
|
||||
hardwareAcceleration: true,
|
||||
discordRpc: true,
|
||||
windowState: {
|
||||
x: 0,
|
||||
y: 0,
|
||||
width: 0,
|
||||
height: 0,
|
||||
isMaximised: false,
|
||||
},
|
||||
} as DesktopConfig,
|
||||
@@ -71,6 +79,7 @@ class Config {
|
||||
firstLaunch: this.firstLaunch,
|
||||
customFrame: this.customFrame,
|
||||
minimiseToTray: this.minimiseToTray,
|
||||
startMinimisedToTray: this.startMinimisedToTray,
|
||||
spellchecker: this.spellchecker,
|
||||
hardwareAcceleration: this.hardwareAcceleration,
|
||||
discordRpc: this.discordRpc,
|
||||
@@ -119,6 +128,21 @@ class Config {
|
||||
this.sync();
|
||||
}
|
||||
|
||||
get startMinimisedToTray() {
|
||||
return (store as never as { get(k: string): boolean }).get(
|
||||
"startMinimisedToTray",
|
||||
);
|
||||
}
|
||||
|
||||
set startMinimisedToTray(value: boolean) {
|
||||
(store as never as { set(k: string, value: boolean): void }).set(
|
||||
"startMinimisedToTray",
|
||||
value,
|
||||
);
|
||||
|
||||
this.sync();
|
||||
}
|
||||
|
||||
get spellchecker() {
|
||||
return (store as never as { get(k: string): boolean }).get("spellchecker");
|
||||
}
|
||||
|
||||
@@ -8,6 +8,9 @@ let rpc: Client;
|
||||
export async function initDiscordRpc() {
|
||||
if (!config.discordRpc) return;
|
||||
|
||||
// clean up existing client if one exists
|
||||
rpc?.removeAllListeners();
|
||||
|
||||
try {
|
||||
rpc = new Client({ transport: "ipc" });
|
||||
|
||||
@@ -16,8 +19,7 @@ export async function initDiscordRpc() {
|
||||
state: "stoat.chat",
|
||||
details: "Chatting with others",
|
||||
largeImageKey: "qr",
|
||||
// largeImageText: "Communication is critical – use Revolt.",
|
||||
largeImageText: "",
|
||||
largeImageText: "Join Stoat!",
|
||||
buttons: [
|
||||
{
|
||||
label: "Join Stoat",
|
||||
|
||||
+17
-4
@@ -1,6 +1,7 @@
|
||||
import { Menu, Tray, nativeImage } from "electron";
|
||||
|
||||
import trayIconAsset from "../../assets/desktop/icon.png?asset";
|
||||
import macOsTrayIconAsset from "../../assets/desktop/iconTemplate.png?asset";
|
||||
import { version } from "../../package.json";
|
||||
|
||||
import { mainWindow, quitApp } from "./window";
|
||||
@@ -8,19 +9,31 @@ import { mainWindow, quitApp } from "./window";
|
||||
// internal tray state
|
||||
let tray: Tray = null;
|
||||
|
||||
// load the tray icon
|
||||
const trayIcon = nativeImage.createFromDataURL(trayIconAsset);
|
||||
|
||||
// trayIcon.setTemplateImage(true);
|
||||
// Create and resize tray icon for macOS
|
||||
function createTrayIcon() {
|
||||
if (process.platform === "darwin") {
|
||||
const image = nativeImage.createFromDataURL(macOsTrayIconAsset);
|
||||
const resized = image.resize({ width: 20, height: 20 });
|
||||
resized.setTemplateImage(true);
|
||||
return resized;
|
||||
} else {
|
||||
return nativeImage.createFromDataURL(trayIconAsset);
|
||||
}
|
||||
}
|
||||
|
||||
export function initTray() {
|
||||
const trayIcon = createTrayIcon();
|
||||
tray = new Tray(trayIcon);
|
||||
updateTrayMenu();
|
||||
tray.setToolTip("Stoat for Desktop");
|
||||
tray.setImage(trayIcon);
|
||||
tray.on("click", () => {
|
||||
if (mainWindow.isVisible()) {
|
||||
mainWindow.hide();
|
||||
} else {
|
||||
mainWindow.show();
|
||||
mainWindow.focus();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
+39
-2
@@ -36,6 +36,10 @@ const windowIcon = nativeImage.createFromDataURL(windowIconAsset);
|
||||
* Create the main application window
|
||||
*/
|
||||
export function createMainWindow() {
|
||||
// (CLI arg --hidden or config)
|
||||
const startHidden =
|
||||
app.commandLine.hasSwitch("hidden") || config.startMinimisedToTray;
|
||||
|
||||
// create the window
|
||||
mainWindow = new BrowserWindow({
|
||||
minWidth: 300,
|
||||
@@ -45,6 +49,7 @@ export function createMainWindow() {
|
||||
backgroundColor: "#191919",
|
||||
frame: !config.customFrame,
|
||||
icon: windowIcon,
|
||||
show: !startHidden,
|
||||
webPreferences: {
|
||||
// relative to `.vite/build`
|
||||
preload: join(__dirname, "preload.js"),
|
||||
@@ -57,8 +62,24 @@ export function createMainWindow() {
|
||||
// hide the options
|
||||
mainWindow.setMenu(null);
|
||||
|
||||
// restore last position if it was moved previously
|
||||
if (config.windowState.x > 0 || config.windowState.y > 0) {
|
||||
mainWindow.setPosition(
|
||||
config.windowState.x ?? 0,
|
||||
config.windowState.y ?? 0,
|
||||
);
|
||||
}
|
||||
|
||||
// restore last size if it was resized previously
|
||||
if (config.windowState.width > 0 && config.windowState.height > 0) {
|
||||
mainWindow.setSize(
|
||||
config.windowState.width ?? 1280,
|
||||
config.windowState.height ?? 720,
|
||||
);
|
||||
}
|
||||
|
||||
// maximise the window if it was maximised before
|
||||
if (config.windowState.isMaximised) {
|
||||
if (config.windowState.isMaximised && !startHidden) {
|
||||
mainWindow.maximize();
|
||||
}
|
||||
|
||||
@@ -80,16 +101,22 @@ export function createMainWindow() {
|
||||
// keep track of window state
|
||||
function generateState() {
|
||||
config.windowState = {
|
||||
x: mainWindow.getPosition()[0],
|
||||
y: mainWindow.getPosition()[1],
|
||||
width: mainWindow.getSize()[0],
|
||||
height: mainWindow.getSize()[1],
|
||||
isMaximised: mainWindow.isMaximized(),
|
||||
};
|
||||
}
|
||||
|
||||
mainWindow.on("maximize", generateState);
|
||||
mainWindow.on("unmaximize", generateState);
|
||||
mainWindow.on("moved", generateState);
|
||||
mainWindow.on("resized", generateState);
|
||||
|
||||
// rebind zoom controls to be more sensible
|
||||
mainWindow.webContents.on("before-input-event", (event, input) => {
|
||||
if (input.control && input.key === "=") {
|
||||
if (input.control && (input.key === "=" || input.key === "+")) {
|
||||
// zoom in (+)
|
||||
event.preventDefault();
|
||||
mainWindow.webContents.setZoomLevel(
|
||||
@@ -101,6 +128,16 @@ export function createMainWindow() {
|
||||
mainWindow.webContents.setZoomLevel(
|
||||
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();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
+2
-3
@@ -8,10 +8,9 @@ contextBridge.exposeInMainWorld("desktopConfig", {
|
||||
get: () => config,
|
||||
set: (config: DesktopConfig) => ipcRenderer.send("config", config),
|
||||
getAutostart() {
|
||||
ipcRenderer.send("isAutostart?");
|
||||
return new Promise((resolve) => ipcRenderer.once("isAutostart", resolve));
|
||||
return ipcRenderer.invoke("getAutostart") as Promise<boolean>;
|
||||
},
|
||||
setAutostart(value: boolean) {
|
||||
ipcRenderer.send("setAutostart", value);
|
||||
return ipcRenderer.invoke("setAutostart", value) as Promise<boolean>;
|
||||
},
|
||||
});
|
||||
|
||||
@@ -13,4 +13,6 @@ contextBridge.exposeInMainWorld("native", {
|
||||
minimise: () => ipcRenderer.send("minimise"),
|
||||
maximise: () => ipcRenderer.send("maximise"),
|
||||
close: () => ipcRenderer.send("close"),
|
||||
|
||||
setBadgeCount: (count: number) => ipcRenderer.send("setBadgeCount", count),
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user