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.

135 lines
3.4 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 really
  4. needed only at build time. Json-glib does packet parsing. Libnotify is
  5. responsible for displaying shell popups.
  6. # Building
  7. Build dependencies (using package names as found in Fedora):
  8. - vala
  9. - glib2-devel
  10. - gobject-introspection-devel
  11. - libgee-devel
  12. - json-glib
  13. - gnutls-devel
  14. - libnotify-devel
  15. - gtk3-devel
  16. - at-spi2-core-devel (and at-spi2-atk)
  17. - meson
  18. - pkg-config
  19. or see `extra/travis-build` in the source tree for example installation
  20. commands. Once build deps are in place, run:
  21. mkdir build
  22. cd build
  23. meson ..
  24. ninja
  25. ninja install
  26. # to set a custom installation directory run:
  27. # DESTDIR=<somedir> ninja install
  28. # Configuration
  29. **NOTE**: manual configuration file is no longer needed
  30. A sample configuration file is provided in source tree, see
  31. `mconnect.conf`. It will get installed to `${datadir}/mconnect/`
  32. (usually corresponding to `/usr/share/mconnect/`) by default. Once
  33. `mconnect` starts it will pick the default file and make a copy of it
  34. in user's config directory, specifically `~/.config/mconnect/`.
  35. A device described in it's own group and listed in `main.devices`, has
  36. to match exactly with incoming identity packets. However, since
  37. `deviceId` is not known beforehand, neither shown in KDE Connect
  38. Android application, only `name` and `type` are used for matching.
  39. # Usage
  40. mconnect comes are 2 separate programs, the daemon - `mconnect` and a D-Bus
  41. client `mconnectctl`.
  42. ## The daemon
  43. Start it by running:
  44. ```
  45. $ mconnect -d
  46. ```
  47. The daemon starts listens on `0.0.0.0:1714` for incoming UDP packets. Once an
  48. identity packet (a sort of a handshake) is received, a connection to the
  49. sender's address will be made. Known devices are cached in
  50. `~/.cache/mconnect/devices`.
  51. File sharing to a device requires TCP ports 9970-9975 to be open. Files shared
  52. from the device are saved to `~/Downloads/mconnect/`.
  53. ## The client
  54. List discovered devices:
  55. ```
  56. $ mconnectctl list-devices
  57. Devices:
  58. /org/mconnect/device/0 673ac2db27d2a331 - Motorola Moto G Maciek
  59. ```
  60. Accept a device (previously done only through the configuration):
  61. ```
  62. $ mconnectctl allow-device /org/mconnect/device/0
  63. ```
  64. Show device details:
  65. ```
  66. $ mconnectctl show-device /org/mconnect/device/0
  67. Device
  68. Name: Motorola Moto G Maciek
  69. ID: 673ac2db27d2a331
  70. Address: 192.168.1.103:1716
  71. Type: phone
  72. Allowed: true
  73. Paired: true
  74. Active: true
  75. Connected: true
  76. ```
  77. Share a file/URL/text:
  78. ```
  79. $ mconnectctl share-file /org/mconnect/device/0 <path>
  80. $ mconnectctl share-url /org/mconnect/device/0 www.google.com
  81. $ mconnectctl share-text /org/mconnect/device/0 'battery horse staple'
  82. ```
  83. ## DBus API
  84. The API is not documented. Use D-Feet or busctl to introspect and invoke methods
  85. manually.
  86. ## Gnome Shell
  87. A Gnome Shell extension is available here:
  88. https://github.com/andyholmes/gnome-shell-extension-mconnect or via the GNOME
  89. extensions page: https://extensions.gnome.org/extension/1272/mconnect/
  90. # Firewalls
  91. It may be required to either temporarily disable the firewall or open up UDP
  92. port 1714.
  93. An example service definition for [firewalld](http://www.firewalld.org/) is
  94. provided in `extra/firewalld/mconnect.xml` directory. The file needs to be
  95. copied into `/etc/firewalld/services`.
  96. # Contributing
  97. Please open a Pull Request with your changes. Feel free to ping me (@bboozzoo)
  98. in description.