2022-05-04 22:33:33 +02:00
![Build ](https://github.com/vector-im/element-desktop/actions/workflows/build.yaml/badge.svg )
![Static Analysis ](https://github.com/vector-im/element-desktop/actions/workflows/static_analysis.yaml/badge.svg )
2023-09-05 18:09:47 +02:00
[![Localazy ](https://img.shields.io/endpoint?url=https%3A%2F%2Fconnect.localazy.com%2Fstatus%2Felement-web%2Fdata%3Fcontent%3Dall%26title%3Dlocalazy%26logo%3Dtrue )](https://localazy.com/p/element-web)
2022-05-04 22:33:33 +02:00
[![Quality Gate Status ](https://sonarcloud.io/api/project_badges/measure?project=element-desktop&metric=alert_status )](https://sonarcloud.io/summary/new_code?id=element-desktop)
[![Vulnerabilities ](https://sonarcloud.io/api/project_badges/measure?project=element-desktop&metric=vulnerabilities )](https://sonarcloud.io/summary/new_code?id=element-desktop)
[![Bugs ](https://sonarcloud.io/api/project_badges/measure?project=element-desktop&metric=bugs )](https://sonarcloud.io/summary/new_code?id=element-desktop)
2022-12-15 12:00:58 +01:00
# Element Desktop
2019-12-06 19:20:31 +01:00
2020-07-01 18:42:24 +02:00
Element Desktop is a Matrix client for desktop platforms with Element Web at its core.
2019-12-12 20:33:29 +01:00
2022-12-15 12:00:58 +01:00
# First Steps
2020-07-15 13:53:50 +02:00
Before you do anything else, fetch the dependencies:
```
yarn install
```
2022-12-15 12:00:58 +01:00
# Fetching Element
2020-07-01 18:42:39 +02:00
Since this package is just the Electron wrapper for Element Web, it doesn't contain any of the Element Web code,
2020-07-01 18:42:50 +02:00
so the first step is to get a working copy of Element Web. There are a few ways of doing this:
2019-12-12 20:33:29 +01:00
```
2020-08-03 17:05:04 +02:00
# Fetch the prebuilt release Element package from the element-web GitHub releases page. The version
2020-07-01 16:30:53 +02:00
# fetched will be the same as the local element-desktop package.
# We're explicitly asking for no config, so the packaged Element will have no config.json.
2021-07-07 16:48:58 +02:00
yarn run fetch --noverify --cfgdir ""
2019-12-12 20:33:29 +01:00
```
...or if you'd like to use GPG to verify the downloaded package:
2022-12-15 12:00:58 +01:00
2019-12-12 20:33:29 +01:00
```
2020-07-01 18:44:40 +02:00
# Fetch the Element public key from the element.io web server over a secure connection and import
2019-12-12 20:33:29 +01:00
# it into your local GPG keychain (you'll need GPG installed). You only need to to do this
# once.
yarn run fetch --importkey
# Fetch the package and verify the signature
2021-07-07 16:48:58 +02:00
yarn run fetch --cfgdir ""
2019-12-12 20:33:29 +01:00
```
2020-07-01 16:30:53 +02:00
...or either of the above, but fetching a specific version of Element:
2022-12-15 12:00:58 +01:00
2019-12-12 20:33:29 +01:00
```
2020-08-03 17:05:04 +02:00
# Fetch the prebuilt release Element package from the element-web GitHub releases page. The version
2020-07-01 16:30:53 +02:00
# fetched will be the same as the local element-desktop package.
2021-07-07 16:48:58 +02:00
yarn run fetch --noverify --cfgdir "" v1.5.6
2019-12-12 20:33:29 +01:00
```
If you only want to run the app locally and don't need to build packages, you can
provide the `webapp` directory directly:
2022-12-15 12:00:58 +01:00
2019-12-12 20:33:29 +01:00
```
2020-08-03 17:05:04 +02:00
# Assuming you've checked out and built a copy of element-web in ../element-web
ln -s ../element-web/webapp ./
2019-12-12 20:33:29 +01:00
```
[TODO: add support for fetching develop builds, arbitrary URLs and arbitrary paths]
2022-12-15 12:00:58 +01:00
# Building
2021-07-07 00:52:19 +02:00
2022-02-16 12:25:14 +01:00
## Native Build
2021-07-07 00:52:19 +02:00
2022-02-16 12:25:14 +01:00
TODO: List native pre-requisites
2020-07-31 22:04:54 +02:00
2022-12-15 12:00:58 +01:00
Optionally, [build the native modules ](https://github.com/vector-im/element-desktop/blob/develop/docs/native-node-modules.md ),
which include support for searching in encrypted rooms and secure storage. Skipping this step is fine, you just won't have those features.
2020-07-31 22:04:54 +02:00
2022-02-16 12:25:14 +01:00
Then, run
2022-12-15 12:00:58 +01:00
2019-12-12 20:33:29 +01:00
```
yarn run build
```
2022-12-15 12:00:58 +01:00
2019-12-12 20:33:29 +01:00
This will do a couple of things:
2022-12-15 12:00:58 +01:00
2024-12-11 11:21:33 +01:00
- Run the `setversion` script to set the local package version to match whatever
version of Element you installed above.
- Run electron-builder to build a package. The package built will match the operating system
you're running the build process on.
2019-12-12 20:33:29 +01:00
2022-02-16 12:25:14 +01:00
## Docker
2020-02-19 15:21:33 +01:00
2022-02-16 12:25:14 +01:00
Alternatively, you can also build using docker, which will always produce the linux package:
2022-12-15 12:00:58 +01:00
2019-12-12 20:33:29 +01:00
```
2020-02-17 21:10:58 +01:00
# Run this once to make the docker image
yarn run docker:setup
2019-12-13 13:18:32 +01:00
yarn run docker:install
2020-02-17 21:25:10 +01:00
# if you want to build the native modules (this will take a while)
2021-03-25 16:40:47 +01:00
yarn run docker:build:native
2019-12-13 13:18:32 +01:00
yarn run docker:build
2019-12-12 20:33:29 +01:00
```
After running, the packages should be in `dist/` .
2022-12-15 12:00:58 +01:00
# Starting
2019-12-12 20:33:29 +01:00
If you'd just like to run the electron app locally for development:
2022-12-15 12:00:58 +01:00
2019-12-12 20:33:29 +01:00
```
yarn start
```
2019-12-13 12:13:44 +01:00
2022-12-15 12:00:58 +01:00
# Config
2020-07-01 16:30:53 +02:00
If you'd like the packaged Element to have a configuration file, you can create a
2019-12-13 12:13:44 +01:00
config directory and place `config.json` in there, then specify this directory
with the `--cfgdir` option to `yarn run fetch` , eg:
2022-12-15 12:00:58 +01:00
2019-12-13 12:13:44 +01:00
```
mkdir myconfig
cp /path/to/my/config.json myconfig/
yarn run fetch --cfgdir myconfig
```
2022-12-15 12:00:58 +01:00
2020-08-03 17:05:04 +02:00
The config dir for the official Element app is in `element.io` . If you use this,
2020-07-01 16:30:53 +02:00
your app will auto-update itself using builds from element.io.
2020-05-06 12:19:08 +02:00
2022-12-15 12:00:58 +01:00
# Profiles
2020-05-06 12:19:08 +02:00
To run multiple instances of the desktop app for different accounts, you can
launch the executable with the `--profile` argument followed by a unique
2020-07-01 16:30:53 +02:00
identifier, e.g `element-desktop --profile Work` for it to run a separate profile and
2020-05-06 12:19:08 +02:00
not interfere with the default one.
Alternatively, a custom location for the profile data can be specified using the
`--profile-dir` flag followed by the desired path.
2022-12-15 12:00:58 +01:00
# User-specified config.json
2020-05-06 12:19:08 +02:00
2024-12-11 11:21:33 +01:00
- `%APPDATA%\$NAME\config.json` on Windows
- `$XDG_CONFIG_HOME/$NAME/config.json` or `~/.config/$NAME/config.json` on Linux
- `~/Library/Application Support/$NAME/config.json` on macOS
2020-05-06 12:19:08 +02:00
2020-07-01 16:30:53 +02:00
In the paths above, `$NAME` is typically `Element` , unless you use `--profile
$PROFILE` in which case it becomes `Element-$PROFILE` , or it is using one of
the above created by a pre-1.7 install, in which case it will be `Riot` or
`Riot-$PROFILE` .
2020-07-15 18:25:02 +02:00
2024-10-17 14:26:35 +02:00
You may also specify a different path entirely for the `config.json` file by
providing the `--config $YOUR_CONFIG_JSON_FILE` to the process, or via the
`ELEMENT_DESKTOP_CONFIG_JSON` environment variable.
2022-12-15 12:00:58 +01:00
# Translations
2021-04-26 15:19:48 +02:00
To add a new translation, head to the [translating doc ](https://github.com/vector-im/element-web/blob/develop/docs/translating.md ).
For a developer guide, see the [translating dev doc ](https://github.com/vector-im/element-web/blob/develop/docs/translating-dev.md ).
2022-12-15 12:00:58 +01:00
# Report bugs & give feedback
2020-07-15 18:25:02 +02:00
If you run into any bugs or have feedback you'd like to share, please let us know on GitHub.
2022-12-15 12:00:58 +01:00
To help avoid duplicate issues, please [view existing issues ](https://github.com/vector-im/element-web/issues?q=is%3Aopen+is%3Aissue+sort%3Areactions-%2B1-desc ) first (and add a +1) or [create a new issue ](https://github.com/vector-im/element-web/issues/new/choose ) if you can't find it. Please note that this issue tracker is associated with the [element-web ](https://github.com/vector-im/element-web ) repo, but is also applied to the code in this repo as well.