Add shell syntax highlighting and remove unnecessary spaces

Benjamin Loison 2026-01-23 20:38:16 +01:00
parent df2173e58d
commit ab039d6278

@ -3,21 +3,29 @@ Signal allows to link additional devices to your primary device. A "primary" pro
* Connect to another device
signal-cli link -n "optional device name"
```shell
signal-cli link -n "optional device name"
```
This shows a `sgnl://linkdevice…` link; if you want to connect to another signal-cli instance, you can just use this link (see below for details). If you want to link to an mobile device, create a QR code with the link (e.g. with [qrencode](https://fukuchi.org/works/qrencode/)) and scan that in the Signal app.
To request a link and display the resulting QR code image in a single command on linux:
signal-cli link -n "optional device name" | tee >(xargs -L 1 qrencode -t utf8)
```shell
signal-cli link -n "optional device name" | tee >(xargs -L 1 qrencode -t utf8)
```
alternatively, you can try:
signal-cli link -n "optional device name" | xargs -L 1 qrencode -o /tmp/qrcode.png & while [ ! -f /tmp/qrcode.png ]; do sleep 1; done; xdg-open /tmp/qrcode.png
```shell
signal-cli link -n "optional device name" | xargs -L 1 qrencode -o /tmp/qrcode.png & while [ ! -f /tmp/qrcode.png ]; do sleep 1; done; xdg-open /tmp/qrcode.png
```
or for newer versions on android:
signal-cli link -n "optional device name" | xargs -L 1 qrencode -o /tmp/qrcode.png --level=H -v 10 & while [ ! -f /tmp/qrcode.png ]; do sleep 1; done; xdg-open /tmp/qrcode.png
```shell
signal-cli link -n "optional device name" | xargs -L 1 qrencode -o /tmp/qrcode.png --level=H -v 10 & while [ ! -f /tmp/qrcode.png ]; do sleep 1; done; xdg-open /tmp/qrcode.png
```
Do not kill the `signal-cli link …` process until linking is finished; the process will exit when it's done.
@ -27,7 +35,9 @@ Signal allows to link additional devices to your primary device. A "primary" pro
* Add another device
signal-cli -u USERNAME addDevice --uri "sgnl://linkdevice?…"
```shell
signal-cli -u USERNAME addDevice --uri "sgnl://linkdevice?…"
```
The `sgnl://linkdevice?…` link is the one shown by the new signal-cli instance or contained in the QR code shown in Signal-Desktop or similar apps.
@ -43,11 +53,15 @@ Signal allows to link additional devices to your primary device. A "primary" pro
You cannot run two instances on the same machine, so use either a virtual machine or another physical machine for your secondary device. On the secondary machine, issue the command
signal-cli link -n "optional device name"
```shell
signal-cli link -n "optional device name"
```
This will display the `sgnl://linkdevice?…` link. Then go back to the primary machine and issue the command
signal-cli -u USERNAME addDevice --uri "sgnl://linkdevice?…"
```shell
signal-cli -u USERNAME addDevice --uri "sgnl://linkdevice?…"
```
This links the two instances. Now, on your secondary machine, you can run