Skip to content

Commit fd0baab

Browse files
committed
Play dialog-question sound upon dialog present
1 parent 3781c0b commit fd0baab

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

meson.build

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ executable(
2424
dependency('polkit-agent-1'),
2525
dependency('polkit-gobject-1'),
2626
dependency('pantheon-wayland-1'),
27+
dependency('libcanberra'),
2728
meson.get_compiler('vala').find_library('posix')
2829
],
2930
c_args: [

src/Agent.vala

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,15 @@ namespace Ag {
3535
dialog.done.connect (() => initiate_authentication.callback ());
3636

3737
dialog.present ();
38+
39+
Canberra.Context? ca_context = null;
40+
Canberra.Context.create (out ca_context);
41+
if (ca_context != null) {
42+
ca_context.change_props (Canberra.PROP_CANBERRA_XDG_THEME_NAME, "elementary");
43+
ca_context.open ();
44+
ca_context.play (0, Canberra.PROP_EVENT_ID, "dialog-question");
45+
}
46+
3847
yield;
3948

4049
dialog.destroy ();

0 commit comments

Comments
 (0)