10 | )
11 | }
12 |
--------------------------------------------------------------------------------
/docs/api-reference/clipboard.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: "Clipboard"
3 | sidebar_position: 8
4 | sidebar_label: "Clipboard"
5 | ---
6 |
7 | import ClipboardCode from '@site/src/generated/code_example/ui_clipboard/clipboard';
8 |
9 | ## Overview
10 |
11 | Clipboard API provides a way to read from, write to and clear OS clipboard
12 |
13 | ## Examples
14 |
15 |
16 |
17 | [//]: # (## API Reference)
18 |
19 | [//]: # (TODO per each method in Clipboard)
20 |
--------------------------------------------------------------------------------
/docs/introduction.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: "Introduction"
3 | sidebar_position: 1
4 | sidebar_label: "Introduction"
5 | slug: "/"
6 | ---
7 |
8 | import UiScreenshot from '@site/src/components/UiScreenshot';
9 |
10 | Gauntlet is an open source cross-platform plugin-first application launcher.
11 | In this documentation you'll find guides and examples that will help you with everything Gauntlet related, including installation, theming and plugin development
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/docs/api-reference/navigation.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: "Navigation"
3 | sidebar_position: 3
4 | sidebar_label: "Navigation"
5 | ---
6 |
7 | import NavigationCode from '@site/src/generated/code_example/ui_navigation/navigation';
8 |
9 | ## Overview
10 |
11 | Views support simple stack-based navigation.
12 | Push new view onto stack by using `useNavigation` React Hook's `push` function, go back by using `pop` function or pressing Escape
13 |
14 | ## `useNavigation`
15 |
16 | ### Example
17 |
18 |
19 |
20 | [//]: # (### Api Reference)
21 |
22 | [//]: # (TODO type)
23 |
--------------------------------------------------------------------------------
/src/components/CodeExample/styles.module.css:
--------------------------------------------------------------------------------
1 | .codeBlockOverlayContainer {
2 | position: relative;
3 | }
4 |
5 | .codeBlockOverlayGithubIcon {
6 | position: absolute;
7 | right: calc(var(--ifm-pre-padding) / 2);
8 | bottom: calc(var(--ifm-pre-padding) / 2);
9 |
10 | width: 2.125rem;
11 | height: 2.125rem;
12 |
13 | display: flex;
14 | align-items: center;
15 | justify-content: center;
16 | background: var(--prism-background-color);
17 | color: var(--prism-color);
18 | border: 1px solid var(--ifm-color-emphasis-300);
19 | border-radius: var(--ifm-global-radius);
20 | }
21 |
--------------------------------------------------------------------------------
/docs/information/versioning.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: "Versioning"
3 | sidebar_position: 3
4 | sidebar_label: "Versioning"
5 | ---
6 |
7 | ## Application
8 |
9 | Application uses simple incremental integers starting from `1`.
10 | It doesn't follow the SemVer versioning.
11 | Given application's reliance on plugins, once it is stable,
12 | introducing breaking changes will be done carefully (if at all) and will be given a reasonable grace period to migrate.
13 | Before application is declared stable, breaking changes could be done without a grace period.
14 |
15 | ## Tools
16 |
17 | [`@project-gauntlet/tools`](https://www.npmjs.com/package/@project-gauntlet/tools) uses SemVer.
18 |
19 | ## Plugins
20 |
21 | Plugins only have the latest published "version" described by release date
--------------------------------------------------------------------------------
/docs/information/terminology.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: "Terminology"
3 | sidebar_position: 1
4 | sidebar_label: "Terminology"
5 | ---
6 |
7 | An explanation of various terms used in this documentation
8 |
9 | ## Action
10 |
11 | Action is a piece of functionality created by plugin that is executed on some kind of user action, be it mouse click or shortcut press.
12 |
13 | See [Action](../api-reference/actions.mdx) documentation
14 |
15 | ## Entrypoint
16 |
17 | Entrypoint is a collective term for Views and Commands created by plugins. All available entrypoints can be searched in main window search
18 |
19 | ## View
20 |
21 | Type of Entrypoint that has a UI and uses React to create it
22 |
23 | ## Command
24 |
25 | Type of Entrypoint that doesn't have a UI and instead just executes piece of code
26 |
27 |
--------------------------------------------------------------------------------
/docs/api-reference/icons-and-images.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: "Icons and Images"
3 | sidebar_position: 2
4 | sidebar_label: "Icons and Images"
5 | ---
6 |
7 | import IconCode from '@site/src/generated/code_example/ui_icons_and_images/icon';
8 | import UrlCode from '@site/src/generated/code_example/ui_icons_and_images/url';
9 | import AssetCode from '@site/src/generated/code_example/ui_icons_and_images/asset';
10 |
11 | ## Overview
12 |
13 | There are a lot of places in views where images or icons can be displayed
14 |
15 | ## Icons
16 |
17 | Icons can be used in all places where regular images are accepted
18 |
19 |
20 |
21 | ## Image from URL
22 |
23 |
24 |
25 | ## Image from Assets
26 |
27 |
28 |
29 | [//]: # (## API Reference)
30 |
31 | [//]: # (TODO list of icons)
32 |
--------------------------------------------------------------------------------
/docs/plugin-installation.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: "Plugin Installation"
3 | sidebar_position: 4
4 | sidebar_label: "Plugin Installation"
5 | ---
6 |
7 | 1. Find git repository of the plugin you want to install. Gauntlet Plugin repository will always have `gauntlet.toml` file in root directory
8 | 2. Copy url of the git repository, same one that will usually be used for cloning
9 | 3. In Gauntlet main window search for "Gauntlet Settings" and open it
10 | 4. In Settings, in Plugins tab click bit '+' button
11 | 5. Paste the git url into newly appeared text field under '+' button and press Enter
12 | 6. UI will show check mark on top right if plugin is successfully installed
13 |
14 | :::warning
15 |
16 | Currently, Gauntlet doesn't support installation of plugins if git repository requires authentication to download
17 |
18 | :::
--------------------------------------------------------------------------------
/docs/feature-support.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: "Feature Support"
3 | sidebar_position: 8
4 | sidebar_label: "Feature Support"
5 | ---
6 |
7 | Only features that are not supported on all operating systems are listed here
8 |
9 | ## Features
10 | - Window tracking: whether Gauntlet is able to track which windows are open and which application created them
11 |
12 | ## Matrix
13 | - ✅ - supported
14 | - ❌ - not currently supported/possible/explored
15 |
16 | | | macOS | Linux X11 | Linux Wayland | Windows |
17 | |------------------|-------|-----------|---------------|---------|
18 | | Window Tracking | ❌ | ✅ | ✅ [1] | ❌ |
19 | | Global Shortcuts | ✅ | ✅ | ❌ [2] | ✅ |
20 |
21 | ## Notes
22 | 1. Window Tracking on Wayland is currently only supported on wlroots-based window managers and Cosmic
23 | 2. Some Wayland window managers like KDE or Cosmic support legacy X11 API for registering global shortcuts
24 | - See [`wayland.global_shortcuts_api`](application-config.md#waylandglobal_shortcuts_api) for more information
25 |
--------------------------------------------------------------------------------
/docs/api-reference/storage-and-cache.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: "Storage and Cache"
3 | sidebar_position: 7
4 | sidebar_label: "Storage and Cache"
5 | ---
6 |
7 | import StorageCode from '@site/src/generated/code_example/ui_storage/storage';
8 |
9 | ## Overview
10 |
11 | In Gauntlet there are 3 tiers of hooks to manage your React view state: `useState`, `useCache` and `useStorage`
12 |
13 | - `useState`
14 | - Provided by React
15 | - State is not saved between view re-openings
16 | - `useCache`
17 | - Provided by Gauntlet
18 | - Ephemeral, state saved between view re-openings, but not between plugin restarts
19 | - Internally uses `sessionStorage`
20 | - Max size of session storage is 10MB per plugin
21 | - `useStorage`
22 | - Provided by Gauntlet
23 | - Persistent, state saved between view re-openings and between plugin restarts
24 | - Internally uses `localStorage`
25 | - Max size of local storage is 10MB per plugin
26 |
27 | ## Example
28 |
29 |
30 |
31 | [//]: # (## Api Reference)
32 |
33 | [//]: # (TODO type)
34 |
35 |
36 |
--------------------------------------------------------------------------------
/docs/theming.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: "Theming"
3 | sidebar_position: 7
4 | sidebar_label: "Theming"
5 | ---
6 |
7 | Currently, in Gauntlet with themes it is possible to change:
8 | - Colors of text and background
9 | - Window border color, width and radius
10 | - Border radius of components in content
11 |
12 | Theming is only affects main window and doesn't affect Settings UI
13 |
14 | Theme config file is in [TOML](https://toml.io) format
15 |
16 | Theme config file locations:
17 | - Windows: `C:\Users\Username\AppData\Roaming\Gauntlet\config\theme.toml`
18 | - Linux: `$HOME/.config/gauntlet/theme.toml` or `$XDG_CONFIG_HOME/gauntlet/theme.toml`
19 | - macOS: `$HOME/Library/Application Support/dev.project-gauntlet.gauntlet/theme.toml`
20 |
21 | On theme may look slightly different on each system because of OS-provided window decorations
22 |
23 | Currently, changes to theme config are only applied after application restart
24 |
25 | Any errors in theme config file will be shown in application logs
26 |
27 | See bundled themes for examples [here](https://github.com/project-gauntlet/gauntlet/tree/main/bundled_themes)
28 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Website
2 |
3 | This website is built using [Docusaurus](https://docusaurus.io/), a modern static website generator.
4 |
5 | ### Preparation
6 |
7 | In main repo
8 | ```bash
9 | npm run run-component-model-gen
10 | npm run run-scenarios
11 | ```
12 |
13 | In this repo
14 | ```bash
15 | yarn
16 | yarn run run-generator ../gauntlet # path to main gauntlet repo
17 | ```
18 |
19 | ### Local Development
20 |
21 | ```bash
22 | yarn start
23 | ```
24 |
25 | This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server.
26 |
27 | ### Build
28 |
29 | ```bash
30 | yarn build
31 | ```
32 |
33 | This command generates static content into the `build` directory and can be served using any static contents hosting service.
34 |
35 | ### Deployment
36 |
37 | Using SSH:
38 |
39 | ```bash
40 | USE_SSH=true yarn deploy
41 | ```
42 |
43 | Not using SSH:
44 |
45 | ```bash
46 | GIT_USER= yarn deploy
47 | ```
48 |
49 | If you are using GitHub pages for hosting, this command is a convenient way to build the website and push to the `gh-pages` branch.
50 |
--------------------------------------------------------------------------------
/docs/api-reference/assets.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: "Assets"
3 | sidebar_position: 6
4 | sidebar_label: "Assets"
5 | ---
6 |
7 | import AssetImageCode from '@site/src/generated/code_example/ui_icons_and_images/asset';
8 | import AssetsByteArrayCode from '@site/src/generated/code_example/command/assets';
9 |
10 | ## Overview
11 |
12 | Assets are all files located in `assets` directory in root of plugin repository, be it image, text file or anything else.
13 | Asset files can be referenced in various predefined places in plugin manifest or code, or be imported as a byte array in your code
14 |
15 |
16 | ## Icon of entrypoint
17 |
18 | Every entrypoint can have an icon. For non-generated entrypoints this icon is defined in Plugin Manifest.
19 | See [Plugin Manifest](../plugin-development/manifest#entrypointicon) page for specific property
20 |
21 | ## Image in component
22 |
23 | Images in React views can also be fetched directly from assets
24 |
25 |
26 |
27 | ## Byte array
28 |
29 | Assets can also be fetched on demand as `ArrayBuffer`
30 |
31 |
32 |
33 | [//]: # (## API Reference)
34 |
35 | [//]: # (TODO)
36 |
--------------------------------------------------------------------------------
/src/components/PropsTable/index.tsx:
--------------------------------------------------------------------------------
1 | import { ReactNode } from "react";
2 | import { Property, renderPropertyType } from "@site/src/components/types";
3 |
4 | interface Data {
5 | internalName: string
6 | props: Property[]
7 | }
8 |
9 | export default function Default({ data }: { data: Data }): ReactNode {
10 | return (
11 |
35 | )
36 | }
37 |
--------------------------------------------------------------------------------
/src/pages/index.tsx:
--------------------------------------------------------------------------------
1 | import Link from '@docusaurus/Link';
2 | import Layout from '@theme/Layout';
3 |
4 | import styles from './index.module.css';
5 | import { ReactElement } from "react";
6 |
7 | export default function Home(): ReactElement {
8 | return (
9 |
14 |
15 |
16 |
17 | Work In Progress
18 |
19 |
20 |
21 | Work In Progress
22 |
23 |
24 |
25 |
28 | Go To Documentation
29 |
30 |
33 | Discord Server
34 |
35 |
36 | );
37 | }
38 |
--------------------------------------------------------------------------------
/docs/troubleshooting.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: "Troubleshooting"
3 | sidebar_position: 9
4 | sidebar_label: "Troubleshooting"
5 | ---
6 |
7 |
8 | ## Crash logs
9 |
10 | If application panics, the crash logs are saved at following locations:
11 |
12 | - Windows: `{FOLDERID_LocalAppData}\Gauntlet\data\logs\crash.txt`
13 | - macOS: `$HOME/Library/Application Support/dev.project-gauntlet.gauntlet/logs/crash.txt`
14 | - Linux: `$HOME/.local/state/gauntlet/logs/crash.txt` or `$XDG_STATE_HOME/gauntlet/logs/crash.txt`
15 |
16 | In Gauntlet each plugin is run in separate plugin runtime process,
17 | if that process panics the logs will also be saved at that location but with following name: `crash-{plugin-internal-uuid}.txt`
18 |
19 | ## macOS
20 |
21 | ### Gauntlet Logs
22 | To see the Gauntlet application logs on macOS do the following:
23 | - Stop any running instance of Gauntlet
24 | - In terminal run: `open -n /Applications/Gauntlet.app --stdout ./gauntlet.log --stderr ./gauntlet.log`
25 | - `gauntlet.log` file in current directory will contain the logs
26 |
27 | ### Console.app
28 | macOS does a some additional validation on the binary before it is even started,
29 | any errors that occur at this stage should be visible in Console.app
30 |
31 | ## Linux
32 |
33 | ### Gauntlet Logs
34 | On Linux on Systemd-based systems Gauntlet is usually started as user service.
35 | To get logs Gauntlet Application logs in this setup run: `journalctl --user -u gauntlet`
36 |
37 |
--------------------------------------------------------------------------------
/src/components/PerTypeMembersTable/index.tsx:
--------------------------------------------------------------------------------
1 | import { ComponentRef, renderArity } from "@site/src/components/types";
2 |
3 | interface Data {
4 | tableKey: string
5 | members: Record,
6 | }
7 |
8 | export default function Default({ data }: { data: Data }): JSX.Element {
9 | return (
10 | <>
11 |
12 | Available non-order-sensitive React children components. The position in children doesn't matter for
13 | these elements
14 |
15 |
16 |
17 |
18 |
Name
19 |
React Component Type
20 |
Amount
21 |
22 |
23 |
24 | {Object.entries(data.members).map(([name, componentRef]) => {
25 | return ( // TODO Link to section
26 |
27 |
{name}
28 |
29 | <{componentRef.componentName}/>
30 |
31 |
{renderArity(componentRef.arity)}
32 |
33 | );
34 | })}
35 |
36 |
37 | >
38 | )
39 | }
40 |
--------------------------------------------------------------------------------
/docs/api-reference/entrypoint-types/command.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: "Command"
3 | sidebar_position: 3
4 | sidebar_label: "Command"
5 | ---
6 |
7 | import CommandSimpleCode from '@site/src/generated/code_example/command/simple';
8 | import CommandPreferencesCode from '@site/src/generated/code_example/command/preferences';
9 |
10 | ## Overview
11 |
12 | Command is used to run straightforward, fire and forget piece of code.
13 |
14 | ### Plugin Manifest
15 |
16 | To use commands, entrypoint with type `"command"` is required
17 |
18 | #### Example
19 | ```toml
20 | [[entrypoint]]
21 | id = 'main'
22 | name = 'Main'
23 | path = 'src/main.tsx'
24 | type = 'command'
25 | description = 'Description of a command'
26 | ```
27 |
28 | ## Note on usage of `async`
29 |
30 | JavaScript is a single-threaded language, at any time only one chunk of code is being executed.
31 |
32 | This has implications on Gauntlet plugins.
33 |
34 | Let's say in the same plugin you have 2 entrypoints: view and command, let's also say that your command entrypoint needs to scan some directories.
35 | If you are using synchronous versions of functions to access file system, user will not be able to open any views
36 | because JS runtime is being busy with scanning directories. For this reason prefer using async versions of APIs where possible,
37 | or if your code is computationally intensive, offload the computation to a worker
38 |
39 | ## Examples
40 |
41 | ### Simple
42 |
43 |
44 |
45 | ### Preferences
46 |
47 |
48 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "gauntlet-docs",
3 | "version": "0.0.0",
4 | "private": true,
5 | "scripts": {
6 | "docusaurus": "docusaurus",
7 | "start": "docusaurus start",
8 | "build": "docusaurus build",
9 | "swizzle": "docusaurus swizzle",
10 | "deploy": "docusaurus deploy",
11 | "clear": "docusaurus clear",
12 | "serve": "docusaurus serve",
13 | "write-translations": "docusaurus write-translations",
14 | "write-heading-ids": "docusaurus write-heading-ids",
15 | "typecheck": "tsc",
16 | "run-generator": "npm run run-generator --workspace component-generator"
17 | },
18 | "workspaces": [
19 | "component-generator"
20 | ],
21 | "dependencies": {
22 | "@docusaurus/core": "3.6.1",
23 | "@docusaurus/preset-classic": "3.6.1",
24 | "@iconify/react": "^5.0.2",
25 | "@mdx-js/react": "^3.0.0",
26 | "clsx": "^2.0.0",
27 | "prism-react-renderer": "^2.3.0",
28 | "react": "^18.0.0",
29 | "react-dom": "^18.0.0"
30 | },
31 | "devDependencies": {
32 | "@docusaurus/module-type-aliases": "3.6.1",
33 | "@docusaurus/tsconfig": "3.6.1",
34 | "@docusaurus/types": "3.6.1",
35 | "buffer": "~6.0.3",
36 | "typescript": "~5.6.3"
37 | },
38 | "browserslist": {
39 | "production": [
40 | ">0.5%",
41 | "not dead",
42 | "not op_mini all"
43 | ],
44 | "development": [
45 | "last 3 chrome version",
46 | "last 3 firefox version",
47 | "last 5 safari version"
48 | ]
49 | },
50 | "engines": {
51 | "node": ">=18.0"
52 | }
53 | }
54 |
--------------------------------------------------------------------------------
/docs/api-reference/environment.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: "Gauntlet Environment"
3 | sidebar_position: 9
4 | sidebar_label: "Environment"
5 | ---
6 |
7 | import EnvironmentCode from '@site/src/generated/code_example/command_environment/environment';
8 |
9 | ## Overview
10 |
11 | Environment API provides information about the environment in which the plugin is running and additional information about runtime
12 |
13 | ## Example
14 |
15 |
16 |
17 | ## `Environment.gauntletVersion`
18 | Type: `number`
19 |
20 | Returns currently Gauntlet version
21 |
22 | ## `Environment.isDevelopment`
23 | Type: `boolean`
24 |
25 | Returns true if the plugin was installed using `npm run dev` command from dev tools as opposed to Settings UI
26 |
27 | ## `Environment.pluginDataDir`
28 | Type: `string`
29 |
30 | Returns absolute path to directory that is assigned to current plugin only and is meant for storing general data.
31 | If writing or reading to/from this directory Plugin must declare it in permissions using `{common:plugin-data}` [path variable](../plugin-development/manifest#path-variables).
32 | The directory will be created automatically during plugin startup
33 |
34 | ## `Environment.pluginCacheDir`
35 | Type: `string`
36 |
37 | Returns absolute path to directory that is assigned to current plugin only and is meant for storing cache.
38 | If writing or reading to/from this directory Plugin must declare it in permissions using `{common:plugin-cache}` [path variable](../plugin-development/manifest#path-variables).
39 | The directory will be created automatically during plugin startup
40 |
--------------------------------------------------------------------------------
/src/pages/index.module.css:
--------------------------------------------------------------------------------
1 | .layoutWrapper {
2 | overflow: hidden;
3 | display: flex;
4 | justify-content: center;
5 | align-items: center;
6 | position: relative;
7 | }
8 |
9 | .hazardTapeContainer {
10 | z-index: -1;
11 | transform: rotate(30deg);
12 | position: absolute;
13 | }
14 |
15 | @media (max-width: 500px) {
16 | .hazardTapeContainer {
17 | transform: rotate(60deg);
18 | }
19 | }
20 |
21 | .hazardTapeContainer::before,
22 | .hazardTapeContainer::after {
23 | content: "";
24 | position: absolute;
25 | inset: 0;
26 | z-index: -1;
27 | background: linear-gradient(
28 | 0deg,
29 | transparent,
30 | #FBB517,
31 | transparent
32 | );
33 | }
34 |
35 | .hazardTapeContainer::after {
36 | filter: blur(3.5rem);
37 | }
38 |
39 | .hazardTape {
40 | width: 2000px;
41 | height: 100px;
42 |
43 | display: flex;
44 | justify-content: center;
45 | align-items: center;
46 |
47 | background: repeating-linear-gradient(
48 | 45deg,
49 | black,
50 | black 10px,
51 | #FBB517 10px,
52 | #FBB517 20px
53 | );
54 | }
55 |
56 |
57 | .hazardTapeSpacer {
58 | width: 350px;
59 | }
60 |
61 | @media (max-width: 500px) {
62 | .hazardTapeSpacer {
63 | width: 150px;
64 | }
65 | }
66 |
67 | .hazardTapeText {
68 | padding: 0 10px 3px 10px;
69 | font-size: x-large;
70 | font-weight: bold;
71 | color: black;
72 | background-color: #FBB517;
73 | border-radius: 5px;
74 | }
75 |
76 | .docsLink {
77 | margin: 30px;
78 | }
79 |
--------------------------------------------------------------------------------
/docs/api-reference/preferences.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: "Preferences"
3 | sidebar_position: 5
4 | sidebar_label: "Preferences"
5 | ---
6 |
7 | import ViewPreferenceCode from '@site/src/generated/code_example/ui_preferences/preferences';
8 |
9 | ## Overview
10 |
11 | Preferences are a way for plugins to be configured. Value of preference can be changed in Settings UI.
12 |
13 | There are 2 types of preferences: plugin (scoped to whole plugin) and entrypoint (specific to given entrypoint).
14 |
15 | Preferences are defined in manifest.
16 | Preference can be defined with default value, if default value is not provided preference is considered to be required
17 | and user will be prompted before running the command or opening view to set preference value.
18 |
19 | Currently supported types of values:
20 | - number
21 | - string
22 | - bool
23 | - enum (string, but only predefined list of values is allowed)
24 | - list of strings
25 | - list of numbers
26 | - list of enums
27 |
28 | :::note
29 |
30 | Currently, lists do not support specifying default value, and it will always be an empty list
31 |
32 | :::
33 |
34 | ## Preferences In View
35 |
36 | ### Example
37 |
38 |
39 |
40 | [//]: # (### Api Reference)
41 |
42 | [//]: # (TODO types)
43 |
44 | ## Preferences In Command
45 |
46 | ### Example
47 |
48 | See [Preference Section](../api-reference/entrypoint-types/entrypoint-generator.mdx#preferences) on Command page for example
49 |
50 | ## Preferences In Entrypoint Generator
51 |
52 | ### Example
53 |
54 | See [Preference Section](../api-reference/entrypoint-types/entrypoint-generator.mdx#preferences) on Entrypoint Generator page for example
55 |
--------------------------------------------------------------------------------
/docs/plugin-development/file-structure.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: "Plugin File Structure"
3 | sidebar_position: 2
4 | sidebar_label: "File Structure"
5 | ---
6 |
7 | ## Overview
8 |
9 | Here file structure of a plugin is described
10 |
11 | Notable directories and files of a plugin are following:
12 | ```
13 | plugin
14 | ├── assets
15 | │ └── icon.png
16 | ├── src
17 | │ └── entrypoint.tsx
18 | ├── dist
19 | ├── node_modules
20 | ├── gauntlet.toml
21 | ├── package-lock.json
22 | ├── package.json
23 | └── tsconfig.json
24 | ```
25 |
26 | ## Plugin manifest
27 |
28 | `gauntlet.toml` is a plugin manifest.
29 | It is used to describe the plugin, what entrypoints does it have, what preferences, what permissions it requires
30 |
31 | See [Plugin Manifest](manifest.md)
32 |
33 | ## Source Code
34 |
35 | All source files go into `src` directory. Currently, only TypeScript language is officially supported, which uses `.ts` or `.tsx` file extensions.
36 | `.tsx` is used everywhere where some kind of UI is being created
37 |
38 | ## Assets
39 |
40 | `assets` directory contains files which will be downloaded together with the plugin itself.
41 | It is optional and is only required if plugin has at least one asset
42 |
43 | See [Assets](../api-reference/assets.mdx)
44 |
45 | ## `dist` directory
46 |
47 | `dist` directory contains compiled plugin. It is created when starting dev server or when publishing the plugin
48 |
49 | ## Dependency management
50 |
51 | `node_modules`, `package-lock.json` and `package.json` all belong to Node.js and npm.
52 | Even though Gauntlet uses Deno to run plugins, Node.js is used to run tooling: gather dependencies, run dev server, publish, etc.
53 |
54 | ## Other
55 |
56 | `tsconfig.json` is a configuration file for TypeScript language compiler
57 |
--------------------------------------------------------------------------------
/src/components/OrderedMembersTable/index.tsx:
--------------------------------------------------------------------------------
1 | import { ComponentRef, renderArity, renderPropertyType } from "@site/src/components/types";
2 |
3 | interface Data {
4 | tableKey: string
5 | members: Record,
6 | withString: boolean
7 | }
8 |
9 | export default function Default({ data }: { data: Data }): JSX.Element {
10 | return (
11 | <>
12 |
13 | Available order-sensitive React children components. The order in which these elements
14 | are be placed in code will
15 | be reflected in UI
16 |
17 |
18 |
19 |
20 |
Name
21 |
React Component Type
22 |
Amount
23 |
24 |
25 |
26 | {data.withString && (
27 |
28 |
29 |
string
30 |
{renderArity({ type: "zero_or_more" })}
31 |
32 | )}
33 | {Object.entries(data.members).map(([name, componentRef]) => {
34 | return ( // TODO Link to section
35 |
36 |
{name}
37 |
38 | <{componentRef.componentName}/>
39 |
40 |
{renderArity(componentRef.arity)}
41 |
42 | );
43 | })}
44 |
45 |
46 | >
47 | )
48 | }
49 |
--------------------------------------------------------------------------------
/docs/cli.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: "Gauntlet CLI"
3 | sidebar_position: 5
4 | sidebar_label: "CLI"
5 | ---
6 |
7 | Gauntlet has a simple command line interface
8 |
9 | ## Commands
10 |
11 | ### `gauntlet`
12 |
13 | Without any arguments calling Gauntlet binary will start the Gauntlet application.
14 | If application is already opened, the window of already opened application will be shown
15 |
16 | ### `gauntlet --minimized`
17 |
18 | By default, starting the application will open the main window.
19 | `--minimized` flag will start the application without opening the window.
20 | Useful when starting the application automatically on OS startup
21 |
22 | ### `gauntlet open`
23 |
24 | Opens main application window, if application is already running. Can be used instead of global shortcut
25 |
26 | ### `gauntlet settings`
27 |
28 | Opens Gauntlet settings
29 |
30 | ### `gauntlet run `
31 |
32 | Runs commands, opens views, runs specific actions, can be used as a replacement for entrypoint-specific global shortcuts,
33 | e.g. if global shortcuts are not supported on your system
34 |
35 | - ``
36 | - Plugin ID, same value as the one used during installation
37 | - Also shown in Settings UI
38 | - ``
39 | - Entrypoint ID
40 | - Value can be found in [Plugin Manifest](http://localhost:3000/docs/plugin-development/manifest#entrypointid)
41 | - For [generated entrypoints](http://localhost:3000/docs/api-reference/entrypoint-types/entrypoint-generator), value is specified in plugin code
42 | - ``
43 | - Action ID
44 | - Value can be found in [Plugin Manifest](http://localhost:3000/docs/plugin-development/manifest#entrypointactionsid)
45 | - Also accepts special values
46 | - `:primary`: runs [primary action](https://gauntlet.sh/docs/api-reference/actions#overview) of the entrypoint
47 | - `:secondary`: runs [secondary action](https://gauntlet.sh/docs/api-reference/actions#overview) of the entrypoint
48 |
49 | ### `gauntlet --version`
50 |
51 | Shows Gauntlet version
52 |
--------------------------------------------------------------------------------
/docs/information/architecture.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: "Architecture"
3 | sidebar_position: 2
4 | sidebar_label: "Architecture"
5 | ---
6 |
7 | ## Overview
8 |
9 | The application consists of 4 modules: server, frontend, plugin runtime and settings.
10 |
11 | ### Plugin Runtime
12 | Gauntlet plugins are written in TypeScript.
13 | As JavaScript runtime [Deno](https://deno.com) is used.
14 | Each plugin runtime runs in a separate Deno Worker in a separate OS process and communicates with server using inter-process communication.
15 | Deno Workers are sandboxed using [Deno's permission model](https://docs.deno.com/runtime/fundamentals/security).
16 | Each plugin must define permissions in [Plugin Manifest](../plugin-development/manifest#permissions) what external resources it needs:
17 | filesystem, network, environment variables or subprocess execution, some Gauntlet-specific permissions, etc.
18 |
19 | Plugins can use [React](https://github.com/facebook/react) to create UI that will be rendered by frontend.
20 | This is implemented using custom React Reconciler (similar to React Native).
21 |
22 | The Deno runtime is kept alive by the always running event loop that handles incoming events from frontend/server
23 |
24 | Plugins are distributed inside the same Git repository which contains the plugin code.
25 | There is no central distribution system currently.
26 | Plugins are installed using the Git repository URL
27 |
28 |
29 | :::warning
30 |
31 | Due to limited resources, security measures for Gauntlet application are implemented on a best-effort basis and are not guaranteed
32 |
33 | :::
34 |
35 | ### Frontend
36 |
37 | As GUI framework [iced-rs](https://github.com/iced-rs/iced) is used.
38 | Frontend runs inside the same OS process as server.
39 |
40 | ### Server
41 |
42 | The server is fairly straightforward [Tokio](https://tokio.rs/) runtime.
43 | All requests or events from frontend to plugin runtime and vice versa go through the server.
44 | Server state is stored inside SQLite database
45 |
46 | ### Settings
47 |
48 | Settings UI also uses [iced-rs](https://github.com/iced-rs/iced) as a GUI framework.
49 | It is run in separate OS process which communicates with server using inter-process communication
50 |
--------------------------------------------------------------------------------
/docs/api-reference/actions.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: "Actions"
3 | sidebar_position: 4
4 | sidebar_label: "Actions"
5 | ---
6 |
7 | import ActionPanelProps from '@site/src/generated/tables/action_panel/props';
8 | import ActionPanelOrderedMembers from '@site/src/generated/tables/action_panel/ordered-members';
9 |
10 | import ActionDescription from '@site/src/generated/tables/action/description';
11 | import ActionCode from '@site/src/generated/code_example/ui_action_panel/action';
12 | import ActionProps from '@site/src/generated/tables/action/props';
13 |
14 | import SectionDescription from '@site/src/generated/tables/action_panel_section/description';
15 | import SectionProps from '@site/src/generated/tables/action_panel_section/props';
16 | import SectionOrderedMembers from '@site/src/generated/tables/action_panel_section/ordered-members';
17 |
18 | import SectionActionCode from '@site/src/generated/code_example/ui_action_panel/section';
19 |
20 | ## Overview
21 |
22 | Action is a piece of code executed on some kind of user action, be it mouse click or shortcut press.
23 |
24 | In UI list of actions is displayed in the Action Panel.
25 |
26 | Actions can be executed using shortcuts, custom and predefined ones.
27 | First and second actions in Action Panel become primary and secondary actions respectively.
28 | Primary action gets automatically assigned Enter shortcut and secondary - Shift + Enter.
29 | Even though it is still possible to assign custom shortcuts to primary and secondary actions, they will not be visible in action panel in UI
30 |
31 | Actions can be defined for entrypoints or views.
32 |
33 | ## Actions in Generated Entrypoints
34 |
35 | See [Entrypoint Generator](entrypoint-types/entrypoint-generator.mdx)
36 |
37 | ## Actions in View and Command Entrypoints
38 |
39 | For `"view"` and `"command"` entrypoints, currently, it is not possible to define additional actions.
40 | The file referenced in manifest becomes primary action
41 |
42 | ## Actions inside Views
43 |
44 | Actions in views are often context-aware, e.g. based on the selected list item.
45 | Actions in Action Panel can be grouped into semantic sections and have keyboard shortcuts assigned.
46 |
47 | ## View Api Reference
48 |
49 | ### ActionPanel
50 |
51 | #### Props
52 |
53 |
54 | #### Children components (order-sensitive)
55 |
56 |
57 |
58 |
59 | ### ActionPanel.Action
60 |
61 |
62 | #### Example
63 |
64 |
65 | #### Props
66 |
67 |
68 |
69 |
70 | ### ActionPanel.Section
71 |
72 |
73 | #### Props
74 |
75 |
76 | #### Children components (order-sensitive)
77 |
78 |
79 |
80 |
81 | ### ActionPanel.Section.Action
82 |
83 | #### Example
84 |
85 |
--------------------------------------------------------------------------------
/docs/application-config.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: "Application Config"
3 | sidebar_position: 6
4 | sidebar_label: "Config"
5 | ---
6 |
7 | ## Overview
8 |
9 | Application Config uses [TOML](https://toml.io) file format
10 |
11 | Location:
12 | - Windows: `C:\Users\Username\AppData\Roaming\Gauntlet\config\config.toml`
13 | - Linux: `$HOME/.config/gauntlet/config.toml` or `$XDG_CONFIG_HOME/gauntlet/config.toml`
14 | - macOS: `$HOME/Library/Application Support/dev.project-gauntlet.gauntlet/config.toml`
15 |
16 | ### `main_window.close_on_unfocus`
17 |
18 | Whether main window is closed when it receives unfocus event. Useful for tiling window managers
19 |
20 | **Type**: `bool`
21 | **Default**: `true`
22 |
23 | ### `wayland.main_window_surface`
24 |
25 | Allows to specify which API will be used to display, position and order main window. Doesn't have effect on non-Wayland environments
26 |
27 | **Type**: `enum`
28 | **Default**: `"prefer_wlr_layer_shell"`
29 |
30 | | Value | Description |
31 | |----------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
32 | | `"wlr_layer_shell"` | Use [layer shell protocol](https://wayland.app/protocols/wlr-layer-shell-unstable-v1) |
33 | | `"xdg_shell"` | Use regular window, useful for cases where layer shell protocol is not supported. May result in incorrect window sizing, positioning and/or ordering of the window depending on window manager/desktop environment used |
34 | | `"prefer_wlr_layer_shell"` | Use `wlr_layer_shell`, but fall back to `xdg_shell` if layer shell protocol is not supported |
35 |
36 |
37 | ### `wayland.global_shortcuts_api`
38 |
39 | Allows to specify which API (if any) will be used to register global shortcuts. Doesn't have effect on non-Wayland environments
40 |
41 | **Type**: `enum`
42 | **Default**: `"none"`
43 |
44 | | Value | Description |
45 | |--------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------|
46 | | `"none"` | Disable global shortcut functionality. User should instead use [CLI commands](./cli.md) instead and register them in windows manager/desktop environment specific way |
47 | | `"legacy_x11_api"` | Should be used if your windows manager/desktop environment supports legacy X11 api for global shortcuts. Notably KDE's "Legacy X11 App Support" settings option |
48 |
--------------------------------------------------------------------------------
/docs/plugin-development/getting-started.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: "Getting Started"
3 | sidebar_position: 1
4 | sidebar_label: "Getting Started"
5 | ---
6 |
7 | This page describes what you need to get started with creating your first Gauntlet plugin
8 |
9 | ## Prerequisites
10 |
11 | - You have Gauntlet [installed and running](../installation.md)
12 | - You have [Node.js](https://nodejs.org/en) installed
13 | - You have [npm](https://www.npmjs.com/) installed
14 |
15 | :::note
16 |
17 | Gauntlet documentation will assume some basic knowledge of React and TypeScript.
18 | If you need some help with that, check out TypeScript's [Handbook](https://www.typescriptlang.org/docs/handbook/intro.html) and React's [Getting Started](https://react.dev/learn) guide
19 |
20 | :::
21 |
22 | :::note
23 |
24 | Gauntlet documentation also assumes that you have Plugin API TypeScript Declarations files of `@project-gauntlet/api` package open in your favourite IDE alongside this documentation
25 |
26 | :::
27 |
28 | :::note
29 |
30 | This page assumes that you will be using GitHub and GitHub Actions to host plugin repository and publish it.
31 | It is possible to use any other hosting solution with some minor changes to the plugin template, but it is outside the scope of this documentation
32 |
33 | :::
34 |
35 | ## Getting development environment ready
36 |
37 | 1. Using https://github.com/project-gauntlet/plugin-template template, create your own repository from it
38 | 2. Clone newly created repository to your machine
39 | 3. Run `npm install` to install dependencies
40 |
41 | ## Running dev server
42 |
43 | To run the dev server, run `npm run dev` command
44 |
45 | 1. Make sure that Gauntlet is running on your system
46 | 2. Dev server will compile the plugin, do the type checking and validate the manifest
47 | 3. Dev server will then connect to Gauntlet and install dev plugin so it is usable like a regular plugin
48 | 4. Any changes made to plugin's source code and manifest will be automatically reflected in Gauntlet UI when file is saved while the dev server is running
49 |
50 | :::note
51 |
52 | Plugins installed via `npm run dev` are using React Dev mode to have better error messages for development.
53 | This comes with a tradeoff of having worse performance when rendering the view
54 |
55 | :::
56 |
57 | ## Building
58 |
59 | Dev server will automatically build plugin, but sometimes it is useful to build the plugin without running the dev server.
60 | For this `npm run build` command is available
61 |
62 | ## Publishing
63 |
64 | Publishing a plugin may be a different in Gauntlet than use are used to. It is distributed, and doesn't have any central system
65 |
66 | Plugins are distributed as a part of the same git repository which contains the code (similar to GitHub Pages).
67 | To publish the plugin you need to run `npm run publish`. But because during publishing process changes are being made to the git repository,
68 | it is **strongly** encouraged to use CI/CD to do it, template repository has predefined workflow already available
69 |
70 | Compiled plugin is stored on `gauntlet/release` branch and when installing plugin using git repository url (same as the one used for `git clone`),
71 | Gauntlet will download that branch and install plugin from there.
72 |
--------------------------------------------------------------------------------
/src/components/CodeExample/index.tsx:
--------------------------------------------------------------------------------
1 | import Tabs from '@theme/Tabs';
2 | import TabItem from '@theme/TabItem';
3 | import React from 'react';
4 | import CodeBlock from "@theme/CodeBlock";
5 | import UiScreenshot from "../UiScreenshot";
6 | import styles from './styles.module.css';
7 | import { Icon } from '@iconify/react'
8 | import Link from "@docusaurus/Link";
9 |
10 | interface GauntletGithubCodeEntrypointData {
11 | codeFilePathRootRelative: string
12 | codeFilePathPluginRelative: string
13 | codeSegments: {
14 | id: string,
15 | value: string,
16 | lines?: [number, number],
17 | screenshotFilePath: string,
18 | }[]
19 | manifestFilePathRootRelative: string
20 | manifestFilePathPluginRelative: string
21 | manifestSegment: {
22 | value: string
23 | manifestFileLines: [number, number]
24 | }
25 | }
26 |
27 | export default function Default({ data, screenshot }: { data: GauntletGithubCodeEntrypointData, screenshot?: boolean }): JSX.Element {
28 | function githubLink(rootRelativePath: string, lines?: [number, number]): string {
29 | if (lines) {
30 | const [startLine, endLine] = lines
31 | return `https://github.com/project-gauntlet/gauntlet/blob/main/${rootRelativePath}#L${startLine}-L${endLine}`;
32 | } else {
33 | return `https://github.com/project-gauntlet/gauntlet/blob/main/${rootRelativePath}`;
34 | }
35 | }
36 |
37 | let elements = data.codeSegments
38 | .map(value => {
39 | const label = value.id === "default" ? data.codeFilePathPluginRelative : `${data.codeFilePathPluginRelative} - ${value.id}`
40 |
41 | return (
42 |
43 |