diff options
author | Robert Tari <robert@tari.in> | 2023-11-04 14:26:52 +0100 |
---|---|---|
committer | Robert Tari <robert@tari.in> | 2023-11-04 14:26:52 +0100 |
commit | 2b3531fd37fd14d0ef9d0ecee03ad124092bdbc9 (patch) | |
tree | f5042fd34f54b646962d130c0371c7d1de99cbf0 | |
parent | 82e45814cb2bb883677c7f07500cf4a32013aa8a (diff) | |
download | ayatana-indicator-sound-2b3531fd37fd14d0ef9d0ecee03ad124092bdbc9.tar.gz ayatana-indicator-sound-2b3531fd37fd14d0ef9d0ecee03ad124092bdbc9.tar.bz2 ayatana-indicator-sound-2b3531fd37fd14d0ef9d0ecee03ad124092bdbc9.zip |
src/info-notification.vala: Display percentage in the greeter when Orca is enabled
-rw-r--r-- | src/info-notification.vala | 21 |
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) |