all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [PATCH] gnu: services: Add bluetooth-service.
@ 2016-06-15 15:23 宋文武
  2016-06-16  3:49 ` Alex Griffin
  2016-06-17 15:02 ` Ludovic Courtès
  0 siblings, 2 replies; 4+ messages in thread
From: 宋文武 @ 2016-06-15 15:23 UTC (permalink / raw)
  To: guix-devel; +Cc: 宋文武

* gnu/services/desktop.scm (bluetooth-shepherd-service)
(bluetooth-service): New Prodecures.
(bluetooth-service-type): New variable.
* doc/guix.text (Desktop Services): Document it.
---
 doc/guix.texi            |  7 +++++++
 gnu/services/desktop.scm | 34 ++++++++++++++++++++++++++++++++++
 2 files changed, 41 insertions(+)

diff --git a/doc/guix.texi b/doc/guix.texi
index e163f36..a6fd89a 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -7982,6 +7982,13 @@ location databases.  See
 web site} for more information.
 @end deffn
 
+@deffn {Scheme Procedure} bluetooth-service [#:bluez @var{bluez}]
+Return a service that runs the @command{bluetoothd} daemon, which manages
+all the Bluetooth devices and provides a number of D-Bus interfaces.
+
+Users need to be in the @code{lp} group to access the D-Bus service.
+@end deffn
+
 @node Database Services
 @subsubsection Database Services
 
diff --git a/gnu/services/desktop.scm b/gnu/services/desktop.scm
index f427d35..80ac0ac 100644
--- a/gnu/services/desktop.scm
+++ b/gnu/services/desktop.scm
@@ -2,6 +2,7 @@
 ;;; Copyright © 2014, 2015, 2016 Ludovic Courtès <ludo@gnu.org>
 ;;; Copyright © 2015 Andy Wingo <wingo@igalia.com>
 ;;; Copyright © 2015 Mark H Weaver <mhw@netris.org>
+;;; Copyright © 2016 Sou Bunnbu <iyzsong@gmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -37,6 +38,7 @@
   #:use-module (gnu packages polkit)
   #:use-module (gnu packages xdisorg)
   #:use-module (gnu packages suckless)
+  #:use-module (gnu packages linux)
   #:use-module (guix records)
   #:use-module (guix packages)
   #:use-module (guix store)
@@ -49,6 +51,7 @@
             geoclue-application
             %standard-geoclue-applications
             geoclue-service
+            bluetooth-service
             polkit-service
             elogind-configuration
             elogind-service
@@ -346,6 +349,37 @@ site} for more information."
 
 \f
 ;;;
+;;; Bluetooth.
+;;;
+
+(define (bluetooth-shepherd-service bluez)
+  "Return a shepherd service for @command{bluetoothd}."
+  (shepherd-service
+   (provision '(bluetooth))
+   (requirement '(dbus-system udev))
+   (documentation "Run the bluetoothd daemon.")
+   (start #~(make-forkexec-constructor
+             (string-append #$bluez "/libexec/bluetooth/bluetoothd")))
+   (stop #~(make-kill-destructor))))
+
+(define bluetooth-service-type
+  (service-type
+   (name 'bluetooth)
+   (extensions
+    (list (service-extension dbus-root-service-type list)
+          (service-extension shepherd-root-service-type
+                             (compose list bluetooth-shepherd-service))))))
+
+(define* (bluetooth-service #:key (bluez bluez))
+  "Return a service that runs the @command{bluetoothd} daemon, which manages
+all the Bluetooth devices and provides a number of D-Bus interfaces.
+
+Users need to be in the @code{lp} group to access the D-Bus service.
+"
+  (service bluetooth-service-type bluez))
+
+\f
+;;;
 ;;; Polkit privilege management service.
 ;;;
 
-- 
2.6.3

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] gnu: services: Add bluetooth-service.
  2016-06-15 15:23 [PATCH] gnu: services: Add bluetooth-service 宋文武
@ 2016-06-16  3:49 ` Alex Griffin
  2016-06-16 12:11   ` 宋文武
  2016-06-17 15:02 ` Ludovic Courtès
  1 sibling, 1 reply; 4+ messages in thread
From: Alex Griffin @ 2016-06-16  3:49 UTC (permalink / raw)
  To: guix-devel

Thanks for writing this, I've been wanting bluetooth support for a
while!

I added this to my system services and added my user to the "lp" group,
but I still ran into a few issues. GNOME still didn't recognize my
bluetooth adaptor, so I tried using bluetoothctl from the command line.
Several actions completed successfully but I still couldn't use my
bluetooth mouse. Here's what I tried (I omitted all output except the
error):

$ bluetoothctl
[bluetooth]# scan on
[bluetooth]# pair <addr>
[bluetooth]# trust <addr>
[bluetooth]# connect <addr>
Failed to connect: org.bluez.Error.Failed

I also couldn't find any bluez files in /var. Is it possible that it's
failing because it can't save its state?

I can look into it more this weekend if you can't reproduce any issues.
-- 
Alex Griffin

On Wed, Jun 15, 2016, at 10:23 AM, 宋文武 wrote:
> * gnu/services/desktop.scm (bluetooth-shepherd-service)
> (bluetooth-service): New Prodecures.
> (bluetooth-service-type): New variable.
> * doc/guix.text (Desktop Services): Document it.
> ---
>  doc/guix.texi            |  7 +++++++
>  gnu/services/desktop.scm | 34 ++++++++++++++++++++++++++++++++++
>  2 files changed, 41 insertions(+)
> 
> diff --git a/doc/guix.texi b/doc/guix.texi
> index e163f36..a6fd89a 100644
> --- a/doc/guix.texi
> +++ b/doc/guix.texi
> @@ -7982,6 +7982,13 @@ location databases.  See
>  web site} for more information.
>  @end deffn
>  
> +@deffn {Scheme Procedure} bluetooth-service [#:bluez @var{bluez}]
> +Return a service that runs the @command{bluetoothd} daemon, which
> manages
> +all the Bluetooth devices and provides a number of D-Bus interfaces.
> +
> +Users need to be in the @code{lp} group to access the D-Bus service.
> +@end deffn
> +
>  @node Database Services
>  @subsubsection Database Services
>  
> diff --git a/gnu/services/desktop.scm b/gnu/services/desktop.scm
> index f427d35..80ac0ac 100644
> --- a/gnu/services/desktop.scm
> +++ b/gnu/services/desktop.scm
> @@ -2,6 +2,7 @@
>  ;;; Copyright © 2014, 2015, 2016 Ludovic Courtès <ludo@gnu.org>
>  ;;; Copyright © 2015 Andy Wingo <wingo@igalia.com>
>  ;;; Copyright © 2015 Mark H Weaver <mhw@netris.org>
> +;;; Copyright © 2016 Sou Bunnbu <iyzsong@gmail.com>
>  ;;;
>  ;;; This file is part of GNU Guix.
>  ;;;
> @@ -37,6 +38,7 @@
>    #:use-module (gnu packages polkit)
>    #:use-module (gnu packages xdisorg)
>    #:use-module (gnu packages suckless)
> +  #:use-module (gnu packages linux)
>    #:use-module (guix records)
>    #:use-module (guix packages)
>    #:use-module (guix store)
> @@ -49,6 +51,7 @@
>              geoclue-application
>              %standard-geoclue-applications
>              geoclue-service
> +            bluetooth-service
>              polkit-service
>              elogind-configuration
>              elogind-service
> @@ -346,6 +349,37 @@ site} for more information."
>  
>  \f
>  ;;;
> +;;; Bluetooth.
> +;;;
> +
> +(define (bluetooth-shepherd-service bluez)
> +  "Return a shepherd service for @command{bluetoothd}."
> +  (shepherd-service
> +   (provision '(bluetooth))
> +   (requirement '(dbus-system udev))
> +   (documentation "Run the bluetoothd daemon.")
> +   (start #~(make-forkexec-constructor
> +             (string-append #$bluez "/libexec/bluetooth/bluetoothd")))
> +   (stop #~(make-kill-destructor))))
> +
> +(define bluetooth-service-type
> +  (service-type
> +   (name 'bluetooth)
> +   (extensions
> +    (list (service-extension dbus-root-service-type list)
> +          (service-extension shepherd-root-service-type
> +                             (compose list
> bluetooth-shepherd-service))))))
> +
> +(define* (bluetooth-service #:key (bluez bluez))
> +  "Return a service that runs the @command{bluetoothd} daemon, which
> manages
> +all the Bluetooth devices and provides a number of D-Bus interfaces.
> +
> +Users need to be in the @code{lp} group to access the D-Bus service.
> +"
> +  (service bluetooth-service-type bluez))
> +
> +\f
> +;;;
>  ;;; Polkit privilege management service.
>  ;;;
>  
> -- 
> 2.6.3
> 
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] gnu: services: Add bluetooth-service.
  2016-06-16  3:49 ` Alex Griffin
@ 2016-06-16 12:11   ` 宋文武
  0 siblings, 0 replies; 4+ messages in thread
From: 宋文武 @ 2016-06-16 12:11 UTC (permalink / raw)
  To: Alex Griffin; +Cc: guix-devel

Alex Griffin <a@ajgrf.com> writes:

> Thanks for writing this, I've been wanting bluetooth support for a
> while!
>
> I added this to my system services and added my user to the "lp" group,
> but I still ran into a few issues. GNOME still didn't recognize my
> bluetooth adaptor, so I tried using bluetoothctl from the command line.
> Several actions completed successfully but I still couldn't use my
> bluetooth mouse. Here's what I tried (I omitted all output except the
> error):
I haven't try it in GNOME yet.

>
> $ bluetoothctl
> [bluetooth]# scan on
> [bluetooth]# pair <addr>
> [bluetooth]# trust <addr>
> [bluetooth]# connect <addr>
> Failed to connect: org.bluez.Error.Failed
Yep, I got this too for my headset + usb controller.
But now with bluez-enabled pulseaudio, it working :-)

>
> I also couldn't find any bluez files in /var. Is it possible that it's
> failing because it can't save its state?
Maybe, is there interesting things from /var/log/message?

>
> I can look into it more this weekend if you can't reproduce any issues.
Thanks for the feedback!

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] gnu: services: Add bluetooth-service.
  2016-06-15 15:23 [PATCH] gnu: services: Add bluetooth-service 宋文武
  2016-06-16  3:49 ` Alex Griffin
@ 2016-06-17 15:02 ` Ludovic Courtès
  1 sibling, 0 replies; 4+ messages in thread
From: Ludovic Courtès @ 2016-06-17 15:02 UTC (permalink / raw)
  To: 宋文武; +Cc: guix-devel

宋文武 <iyzsong@gmail.com> skribis:

> * gnu/services/desktop.scm (bluetooth-shepherd-service)
> (bluetooth-service): New Prodecures.
> (bluetooth-service-type): New variable.
> * doc/guix.text (Desktop Services): Document it.
                ^
Typo.

> +(define* (bluetooth-service #:key (bluez bluez))
> +  "Return a service that runs the @command{bluetoothd} daemon, which manages
> +all the Bluetooth devices and provides a number of D-Bus interfaces.
> +
> +Users need to be in the @code{lp} group to access the D-Bus service.

I guess it’s not “your fault” ;-), but why is it called “lp”?  That
makes me think of a printer.

Otherwise, if the issues Alex mentioned are fixed or under control, that
LGTM!

Thank you!

Ludo’.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-06-17 15:02 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-06-15 15:23 [PATCH] gnu: services: Add bluetooth-service 宋文武
2016-06-16  3:49 ` Alex Griffin
2016-06-16 12:11   ` 宋文武
2016-06-17 15:02 ` Ludovic Courtès

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.