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.

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