aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Gabriel <mike.gabriel@das-netzwerkteam.de>2023-11-04 15:11:12 +0100
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2023-11-04 15:11:12 +0100
commit1fb937272d73f75ba13727680bdaea68c7fd3c7b (patch)
treef5042fd34f54b646962d130c0371c7d1de99cbf0
parent82e45814cb2bb883677c7f07500cf4a32013aa8a (diff)
parent2b3531fd37fd14d0ef9d0ecee03ad124092bdbc9 (diff)
downloadayatana-indicator-sound-1fb937272d73f75ba13727680bdaea68c7fd3c7b.tar.gz
ayatana-indicator-sound-1fb937272d73f75ba13727680bdaea68c7fd3c7b.tar.bz2
ayatana-indicator-sound-1fb937272d73f75ba13727680bdaea68c7fd3c7b.zip
Merge branch 'tari01-pr/notification-orca-greeter'
Attributes GH PR #96: https://github.com/AyatanaIndicators/ayatana-indicator-sound/pull/96
-rw-r--r--src/info-notification.vala21
1 files changed, 17 insertions, 4 deletions
diff --git a/src/info-notification.vala b/src/info-notification.vala
index 4e246b2..5e67be1 100644
--- a/src/info-notification.vala
+++ b/src/info-notification.vala
@@ -23,7 +23,19 @@ using Notify;
public class IndicatorSound.InfoNotification: Notification
{
- protected override Notify.Notification create_notification () {
+ private string sReaderSchema = "org.gnome.desktop.a11y.applications";
+ private string sReaderKey = "screen-reader-enabled";
+
+ protected override Notify.Notification create_notification ()
+ {
+ string sUser = GLib.Environment.get_user_name ();
+
+ if (sUser == "lightdm")
+ {
+ this.sReaderSchema = "org.ArcticaProject.arctica-greeter";
+ this.sReaderKey = "screen-reader";
+ }
+
return new Notify.Notification (_("Volume"), "", "audio-volume-muted");
}
@@ -40,15 +52,16 @@ public class IndicatorSound.InfoNotification: Notification
/* Reset the notification */
var n = _notification;
volume_label += "\n";
+
int32 nValue = ((int32)((volume * 100.0) + 0.5)).clamp(0, 100);
SettingsSchemaSource pSource = SettingsSchemaSource.get_default ();
- SettingsSchema pSchema = pSource.lookup ("org.gnome.desktop.a11y.applications", false);
+ SettingsSchema pSchema = pSource.lookup (this.sReaderSchema, false);
bool bOrcaActive = false;
if (pSchema != null)
{
- Settings pSettings = new Settings ("org.gnome.desktop.a11y.applications");
- bOrcaActive = pSettings.get_boolean ("screen-reader-enabled");
+ Settings pSettings = new Settings (this.sReaderSchema);
+ bOrcaActive = pSettings.get_boolean (this.sReaderKey);
}
if (bOrcaActive)