From d861b730efce1ff274a7bab61a5ec36219d29e71 Mon Sep 17 00:00:00 2001 From: Exidex <16986685+exidex@users.noreply.github.com> Date: Sun, 19 Jan 2025 12:09:58 +0100 Subject: [PATCH] Update CHANGELOG.md, README.md and THEME.md --- CHANGELOG.md | 11 ++++++++--- README.md | 43 ++++++++++++++----------------------------- docs/THEME.md | 45 +++++++++++---------------------------------- 3 files changed, 33 insertions(+), 66 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e0f49913..6b917c1a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,7 +12,8 @@ For changes in `@project-gauntlet/tools` see [separate CHANGELOG.md](https://git ### General - Window Tracking - Gauntlet now tracks opened windows and assigns them to specific application entry in results - - If application has window open, primary action now instead focuses the window, or if there are multiple opens view which contains list of windows that can be focused + - If application has window open, primary action now instead focuses the window + - If there are multiple windows open, primary action opens view which contains list of windows that can be focused - If application has window open, it is still possible to open new application instance by using separate new action - It is experimental, and it is possible to disable window tracking by unchecking checkbox in Application entrypoint preferences in Settings UI - Currently supported on @@ -36,6 +37,7 @@ For changes in `@project-gauntlet/tools` see [separate CHANGELOG.md](https://git - `Active Monitor` - Windows opens on monitor which has currently focused window - Currently supported only on macOS +- Improve config and theme config error parsing logs ### Theming - Themes have been reworked @@ -66,8 +68,10 @@ For changes in `@project-gauntlet/tools` see [separate CHANGELOG.md](https://git - Added `get: (id: string) => GeneratedEntrypoint | undefined` function to `GeneratorContext` to get added entrypoint - Added `getAll: () => GeneratedEntrypoint[]` function to `GeneratorContext` to get all added entrypoints - Generated Entrypoints can now have accessories similar to `` component -- Removed `pluginPreferences` and `entrypointPreferences` -- Add `usePluginPreferences` and `useEntrypointPreferences` React Hooks +- Removed `pluginPreferences` and `entrypointPreferences` helper functions +- Added `usePluginPreferences` and `useEntrypointPreferences` React Hooks +- Command function now receives `CommandContext` as first argument + - Object contains `pluginPreferences` and `entrypointPreferences` properties to access preferences from Command - Unified primary and secondary action execution in `` and `` - **BREAKING CHANGE**: Removed `onClick` property on `` and `` components - **BREAKING CHANGE**: `` and `` now has how `id: string` required property @@ -97,6 +101,7 @@ For changes in `@project-gauntlet/tools` see [separate CHANGELOG.md](https://git - Fixed `` not displaying the image - Fixed image in `` being too big so labels are not shown - Fixed action not being run if `` or `` view has focused `` +- Fixed `npm run dev` failing because of missing log files when run for the first time ## [12] - 2024-12-22 diff --git a/README.md b/README.md index d349ee1d..c3129293 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ -Web-first cross-platform application launcher with React-based plugins. +Web-first cross-platform application launcher with React-based plugins > [!NOTE] > Launcher is in active development, expect bugs, missing features, incomplete ux, etc. @@ -71,7 +71,6 @@ https://github.com/user-attachments/assets/19964ed6-9cd9-48d4-9835-6be04de14b66 - Application plugin depends on `gtk-launch` - macOS - Windows - - Bundled "Applications" plugin is not yet implemented. See [#9](https://github.com/project-gauntlet/gauntlet/issues/9) ##### Planned features @@ -216,7 +215,7 @@ Main window can be opened using global shortcut or CLI command: name = 'Plugin Name' description = """ Plugin description -""" # required +""" [[preferences]] # plugin preference name = 'testBool' @@ -229,8 +228,9 @@ enum_values = [{ label = 'Item', value = 'item'}] # defines list of available en id = 'ui-view' # id for entrypoint name = 'UI view' # name of entrypoint path = 'src/ui-view.tsx' # path to file, default export is expected to be function React Function Component +icon = 'icon.png' # optional, path to file inside assets dir type = 'view' -description = 'Some entrypoint description' # required +description = 'Some entrypoint description' [[entrypoint.preferences]] # entrypoint preference name = 'boolPreference' @@ -248,21 +248,21 @@ id = 'command-a' name = 'Command A' path = 'src/command-a.ts' # path to file, the whole file is a js script type = 'command' -description = 'Some entrypoint description' # required +description = 'Some entrypoint description' [[entrypoint]] id = 'command-generator' name = 'Command generator' path = 'src/command-generator.ts' type = 'command-generator' -description = 'Some entrypoint description' # required +description = 'Some entrypoint description' [[entrypoint]] id = 'inline-view' name = 'Inline view' path = 'src/inline-view.tsx' type = 'inline-view' -description = 'Some entrypoint description' # required +description = 'Some entrypoint description' [permissions] network = ["github.com", "example.com:8833"] @@ -311,8 +311,6 @@ The Application has a simple command line interface - `gauntlet --minimized` - starts server without opening main window - `gauntlet open` - opens application window, can be used instead of global shortcut - `gauntlet settings` - settings, plugin installation and removal, preferences, etc -- `gauntlet generate-sample-simple-theme` - generate sample of simple theme. See: [THEME.md](./docs/THEME.md) -- `gauntlet generate-sample-complex-theme` - generate sample of complex theme. See: [THEME.md](./docs/THEME.md) ### Dev Tools @@ -336,10 +334,8 @@ See [THEME.md](./docs/THEME.md) ## Architecture -The Application consists of three parts: server, frontend and settings. -Server is an application that exposes gRPC server. -All plugins run on server. -Each plugin in its own sandboxed Deno Worker. +The Application consists of 4 parts: server, frontend, plugin runtime and settings. +Each plugin runs in separate plugin runtime in separate OS process. Each plugin is its own sandboxed Deno Worker. In plugin manifest it is possible to configure permissions which will allow plugin to have access to filesystem, network, environment variables or subprocess execution. Server saves plugins themselves and state of plugins into SQLite database. @@ -347,23 +343,20 @@ Server saves plugins themselves and state of plugins into SQLite database. Frontend is GUI module that uses [iced-rs](https://github.com/iced-rs/iced) as a GUI framework. It is run in the same process as a server. Plugins can create UI using [React](https://github.com/facebook/react). -Server implements custom React Reconciler (similar to React Native) which renders GUI components to frontend. -Server listens on signals from frontend, so when user opens view defined by plugin, frontend sends an open-view request. -Server then receives it, runs React render and React Reconciler -makes requests to the frontend containing information what actually should be rendered. +Plugin Runtime implements custom React Reconciler (similar to React Native) which renders GUI components to frontend. +Plugin Runtime listens on signals from frontend, so when user opens view defined by plugin, frontend sends an open-view request. +Plugin Runtime then receives it, runs React render and React Reconciler makes requests to the frontend containing information what actually should be rendered. When a user interacts with the UI by clicking button or entering text into form, frontend sends events to server to see whether any re-renders are needed. -Settings is a GUI application runs in separate process that communicates with server via gRPC using a simple request-response approach. +Settings is a GUI application runs in separate process that communicates with server using a simple request-response approach. -Simplified gRPC communication: +Simplified communication: ![](docs/architecture.png) Components: ![](docs/architecture-blocks.png) -Each component runs in a separate thread. Main thread is the thread that renders GUI. Each component has its own tokio runtime instance. - Plugins (or rather its compiled state: manifest, js code and assets) are distributed via Git repository in `gauntlet/release` branch (similar to GitHub Pages). Which means there is no one central place required for plugin distribution. And to install plugin all you need is Git repository url. @@ -402,13 +395,6 @@ Relevant CLI commands: - contains log files created by plugin development - `.desktop` files at locations defined by [Desktop Entry Specification](https://specifications.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html) -Application and Dev Tools use temporary directories: - -- Rust: [tempfile crate](https://crates.io/crates/tempfile) -- JS: [NodeJS mkdtemp](https://nodejs.org/api/fs.html#fspromisesmkdtempprefix-options) - -X11 API is used to add global shortcut - Client and Setting applications have GUI and therefore use all the usual graphics-related stuff from X11. Wayland support requires LayerShell protocol `zwlr_layer_shell_v1`. @@ -442,7 +428,6 @@ But the new version release needs to be done via GitHub Actions If you'd like to help build Gauntlet you can do it in more ways than just contributing code: - Reporting a bug or UI/UX problem - Creating a plugin -- Creating and contributing a theme - see [#16](https://github.com/project-gauntlet/gauntlet/issues/16) If you are looking for things to do see pinned [issues](https://github.com/project-gauntlet/gauntlet/issues). diff --git a/docs/THEME.md b/docs/THEME.md index b911de6d..98af1b05 100644 --- a/docs/THEME.md +++ b/docs/THEME.md @@ -1,44 +1,21 @@ # Gauntlet Theming -Gauntlet has extensive theming possibilities +Currently, in Gauntlet with themes it is possible to change (list is likely be extended with future updates): +- Colors of text and background +- Window border color, width and radius +- Border radius of components in content -There are 2 types of themes: -- Simple Theme - - Global colors - - Global border width and radius -- Complex Theme - - Colors on per widget type bases - - Paddings and spacing on per widget type bases - - Borders colors, width and radius on per widget type bases +Theming is only affects main window and doesn't affect settings -Unfortunately due to the internally invasive nature of themes, it is perpetually unstable feature. -Themes are versioned and only one version is supported by application at the same time. -Meaning if there were some changes made in the release and theme version was incremented, -theme will stop working until it is updated. -This may change in the future +Theme config file is in TOML format -Current version: -- Simple Theme: `4` -- Complex Theme: `4` - -Theming is only applied to main window and doesn't affect settings - -### Creating a custom theme - -Gauntlet provides 2 CLI commands to generate sample: `generate-sample-simple-theme` and `generate-sample-complex-theme`. Sample is just a default theme that has been saved to file. - -Running the command will create sample file, print location of that sample file -and will print location to which theme file will need to be saved to be detected by application +Theme config file locations: +- Windows: `C:\Users\Username\AppData\Roaming\Gauntlet\config\theme.toml` +- Linux: `$XDG_CONFIG_HOME/gauntlet/theme.toml` +- macOS: `$HOME/Library/Application Support/dev.project-gauntlet.gauntlet/theme.toml` Currently, theme change is only applied after application restart Any errors in theme parsing will be shown in application logs -#### Linux -- `gauntlet generate-sample-simple-theme` -- `gauntlet generate-sample-complex-theme` - -#### macOS -Note: the binary is not on the PATH -- `/Applications/Gauntlet.app/Contents/MacOS/Gauntlet generate-sample-simple-theme` -- `/Applications/Gauntlet.app/Contents/MacOS/Gauntlet generate-sample-complex-theme` +See bundled themes for examples [here](./../bundled_themes)