From 49d3e5cd7d4558c18c76b48d3e5812eaf445e45d Mon Sep 17 00:00:00 2001 From: Jonatan Heyman Date: Thu, 21 Dec 2023 19:18:04 +0100 Subject: [PATCH] Add Linux support (#6) * Add linux AppImage build target * Add ubuntu to Github Actions build matrix * Show help text on how to open Menu, on Linux --- .github/workflows/build.yml | 4 ++-- electron-builder.json5 | 12 ++++++++++++ electron/initial-content.ts | 6 +++--- 3 files changed, 17 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 79ce2f1..d477a35 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -11,8 +11,8 @@ jobs: strategy: matrix: - #os: [macos-latest, ubuntu-latest, windows-latest] - os: [macos-latest, windows-latest] + os: [macos-latest, ubuntu-latest, windows-latest] + #os: [macos-latest, windows-latest] steps: - name: Check out Git repository diff --git a/electron-builder.json5 b/electron-builder.json5 index cf6dc6c..3c5da16 100644 --- a/electron-builder.json5 +++ b/electron-builder.json5 @@ -46,5 +46,17 @@ "perMachine": false, "allowToChangeInstallationDirectory": true, "deleteAppDataOnUninstall": false + }, + + linux: { + synopsis: "A dedicated scratchpad for developers", + category: "Utility", + }, + appImage: { + artifactName: "${productName}_${version}_${arch}.${ext}", + }, + snap: { + artifactName: "${productName}_${version}_${arch}.${ext}", + publish: ["github"], } } diff --git a/electron/initial-content.ts b/electron/initial-content.ts index 1aa0b78..3ee5585 100644 --- a/electron/initial-content.ts +++ b/electron/initial-content.ts @@ -1,8 +1,8 @@ -import { isMac, isWindows } from "./detect-platform.js" +import { isLinux, isMac, isWindows } from "./detect-platform.js" const modChar = isMac ? "⌘" : "Ctrl" const altChar = isMac ? "⌥" : "Alt " -const windowsShowMenu = isWindows ? `\n${altChar} Show menu` : "" +const showMenuHelp = (isWindows || isLinux) ? `\n${altChar} Show menu` : "" export const initialContent = ` ∞∞∞text @@ -15,7 +15,7 @@ ${modChar} + Down Goto next block ${modChar} + Up Goto previous block ${modChar} + A Select all text in a note block. Press again to select the whole buffer ${modChar} + ⌥ + Up/Down Add additional cursor above/below -${altChar} + Shift + F Format block content (works for JSON, JavaScript, HTML, CSS and Markdown)${windowsShowMenu} +${altChar} + Shift + F Format block content (works for JSON, JavaScript, HTML, CSS and Markdown)${showMenuHelp} ∞∞∞math This is a Math block. Here, rows are evaluated as math expressions.