Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 54 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,60 @@ flatplay
# This will attempt to build and run the project.
```

## Integrate into editors

### Zed

To integrate flatplay in Zed you can define custom tasks and key bindings.

Add the following tasks to your `tasks.json` file (you can open it with the `zed: open tasks` action):

```json
{
"label": "build & run flatpak",
"command": "flatplay build-and-run"
},
{
"label": "build flatpak",
"command": "flatplay build"
},
{
"label": "run flatpak",
"command": "flatplay run"
},
{
"label": "stop flatpak",
"command": "flatplay stop"
},
{
"label": "clean flatpak build",
"command": "flatplay clean"
},
{
"label": "update flatpak dependencies",
"command": "flatplay update-dependencies"
},
{
"label": "select flatpak manifest",
"command": "flatplay select-manifest"
}
```

Next, add new bindings to your `keymaps.json` file (you can open it with the `zed: open keypam` action):

```json
{
"context": "Workspace",
"bindings": {
"ctrl-alt-b": ["task::Spawn", { "task_name": "build & run flatpak" }],
"ctrl-alt-r": ["task::Spawn", { "task_name": "run flatpak" }],
"ctrl-alt-c": ["task::Spawn", { "task_name": "stop flatpak" }]
}
},
```

Then you can run any of the tasks by pressing `Alt-Shift-T`, or use `Ctrl-Alt-B`, `Ctrl-Alt-R` or `Ctrl-Alt-C` to build & run, run or stop flatpaks.

# Some notes

- A lot of the code is almost directly borrowed from [`flatpak-vscode`](https://github.com/bilelmoussaoui/flatpak-vscode).
Expand Down