mconnect - KDE Connect protocol implementation in Vala/C
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

117 lines
3.0 KiB

10 years ago
  1. # mconnect
  2. mconnect - KDE Connect protocol implementation in Vala/C
  3. GLib and Gio should be available even on trimmed down systems. Vala is
  4. really needed only at build time. OpenSSL does the packet
  5. encryption/decryption at the protocol level, while Json-glib does
  6. packet parsing. Libnotify is responsible for displaying shell popups.
  7. # Building
  8. Build dependencies (using package names as found in Fedora):
  9. - vala
  10. - glib2-devel
  11. - gobject-introspection-devel
  12. - libgee-devel
  13. - json-glib
  14. - openssl-devel
  15. - libnotify-devel
  16. - gtk3-devel
  17. - at-spi2-core-devel (and at-spi2-atk)
  18. or see `extra/travis-build` in the source tree for example installation
  19. commands. Once build deps are in place, run:
  20. autoreconf -if
  21. ./configure --prefix=<your favorite prefix>
  22. make
  23. make install
  24. # or make DESTDIR=<somedir> install if you want to inspect what
  25. # gets installed
  26. # Configuration
  27. **NOTE**: manual configuration file is no longer needed
  28. A sample configuration file is provided in source tree, see
  29. `mconnect.conf`. It will get installed to `${datadir}/mconnect/`
  30. (usually corresponding to `/usr/share/mconnect/`) by default. Once
  31. `mconnect` starts it will pick the default file and make a copy of it
  32. in user's config directory, specifically `~/.config/mconnect/`.
  33. A device described in it's own group and listed in `main.devices`, has
  34. to match exactly with incoming identity packets. However, since
  35. `deviceId` is not known beforehand, neither shown in KDE Connect
  36. Android application, only `name` and `type` are used for matching.
  37. # Usage
  38. mconnect comes are 2 separate programs, the daemon - `mconnect` and a D-Bus
  39. client `mconnectctl`.
  40. ## The daemon
  41. Start it by running:
  42. ```
  43. $ mconnect -d
  44. ```
  45. The daemon starts listens on `0.0.0.0:1714` for incoming UDP packets. Once an
  46. identity packet (a sort of a handshake) is received, a connection to the
  47. sender's address will be made. Known devices are cached in
  48. `~/.cache/mconnect/devices`.
  49. ## The client
  50. List discovered devices:
  51. ```
  52. $ ./mconnectctl list-devices
  53. Devices:
  54. /org/mconnect/device/0 673ac2db27d2a331 - Motorola Moto G Maciek
  55. ```
  56. Accept a device (previously done only through the configuration):
  57. ```
  58. $ ./mconnectctl allow-device /org/mconnect/device/0
  59. ```
  60. Show device details:
  61. ```
  62. $ ./mconnectctl show-device /org/mconnect/device/0
  63. Device
  64. Name: Motorola Moto G Maciek
  65. ID: 673ac2db27d2a331
  66. Address: 192.168.1.103:1716
  67. Type: phone
  68. Allowed: true
  69. Paired: true
  70. Active: true
  71. Connected: true
  72. ```
  73. ## DBus API
  74. The API is not documented. Use D-Feet or busctl to introspect and invoke methods
  75. manually.
  76. ## Gnome Shell
  77. A Gnome Shell extension is available here:
  78. https://github.com/andyholmes/gnome-shell-extension-mconnect or via the GNOME
  79. extensions page: https://extensions.gnome.org/extension/1272/mconnect/
  80. # Firewalls
  81. It may be required to either temporarily disable the firewall or open up UDP
  82. port 1714.
  83. An example service definition for [firewalld](http://www.firewalld.org/) is
  84. provided in `extra/firewalld/mconnect.xml` directory. The file needs to be
  85. copied into `/etc/firewalld/services`.