After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 730202 - gnome-settings-daemon handles power sound effects, but does not alert on plugging or unplugging power
gnome-settings-daemon handles power sound effects, but does not alert on plug...
Status: RESOLVED FIXED
Product: gnome-settings-daemon
Classification: Core
Component: power
3.12.x
Other Linux
: Normal minor
: ---
Assigned To: gnome-settings-daemon-maint
gnome-settings-daemon-maint
Depends on:
Blocks:
 
 
Reported: 2014-05-15 15:34 UTC by Mike Auty
Modified: 2014-05-16 13:15 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
power: Add sound notification on power plug/unplug (1.47 KB, patch)
2014-05-15 15:43 UTC, Bastien Nocera
committed Details | Review

Description Mike Auty 2014-05-15 15:34:01 UTC
My AC connector does not stay seated well, and I recall in older versions of gnome that a sound would play when the power was plugged in or unplugged.

Trying to identify where this happens, it appears that a canberra sound event should be triggered with an event id of "power-plug" or "power-unplug".  Checking gnome-power-manager shows in the NEWS page an entry for 3.1.3 saying "remove the critical event sounds, they've all moved to g-s-d (Richard Hughes)".  There now seems to be no other use of libcanberra in gnome-power-manager.

Checking gnome-settings-daemon we can indeed see a number of calls to play sound events for "battery-low" and "battery-caution", however, there are none for "power-plug" or "power-unplug".

If these have been lost somewhere along the way, they should be readded, most likely to gnome-settings-daemon.  If not then I've got another problem and I'll have to go off and investigate some more...
Comment 1 Bastien Nocera 2014-05-15 15:43:57 UTC
Created attachment 276610 [details] [review]
power: Add sound notification on power plug/unplug
Comment 2 Rui Matos 2014-05-15 18:39:14 UTC
Review of attachment 276610 [details] [review]:

Looks good in any case

::: plugins/power/gsd-power-manager.c
@@ +1746,3 @@
+                                 CA_PROP_EVENT_ID, "power-unplug",
+                                 /* TRANSLATORS: this is the sound description */
+                                 CA_PROP_EVENT_DESCRIPTION, _("On battery power"), NULL);

Do these strings show up on the UI?
Comment 3 Bastien Nocera 2014-05-16 10:15:44 UTC
(In reply to comment #2)
> Review of attachment 276610 [details] [review]:
> 
> Looks good in any case
> 
> ::: plugins/power/gsd-power-manager.c
> @@ +1746,3 @@
> +                                 CA_PROP_EVENT_ID, "power-unplug",
> +                                 /* TRANSLATORS: this is the sound description
> */
> +                                 CA_PROP_EVENT_DESCRIPTION, _("On battery
> power"), NULL);
> 
> Do these strings show up on the UI?

No, but they're passed to pulseaudio for a11y purposes. We can probably remove the translation markers to push to 3.12 though.
Comment 4 Bastien Nocera 2014-05-16 13:15:03 UTC
Attachment 276610 [details] pushed as 16c7f3d - power: Add sound notification on power plug/unplug