diff options
author | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2023-02-06 10:19:28 +0100 |
---|---|---|
committer | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2023-02-06 12:08:33 +0100 |
commit | 3d288d37411db11a4826d6a70a26d842241af3e0 (patch) | |
tree | eadbd56a7a08b8e730b24cb4a81d15cdaf58966b | |
parent | 395b2cadbf259ea93096676a271392278340c21e (diff) | |
download | arctica-greeter-3d288d37411db11a4826d6a70a26d842241af3e0.tar.gz arctica-greeter-3d288d37411db11a4826d6a70a26d842241af3e0.tar.bz2 arctica-greeter-3d288d37411db11a4826d6a70a26d842241af3e0.zip |
a11y: Make the onboard layout configurable.
Original patch by Clement Lefebvre (Slick Greeter).
https://github.com/linuxmint/slick-greeter/commit/ae090039efff87ad8b9b856f3fe451f9f41d21be
Modified by Mike Gabriel (change: don't store the complete layout path
in gsettings).
-rw-r--r-- | data/org.ArcticaProject.arctica-greeter.gschema.xml | 4 | ||||
-rw-r--r-- | src/menubar.vala | 12 | ||||
-rw-r--r-- | src/settings.vala | 1 |
3 files changed, 15 insertions, 2 deletions
diff --git a/data/org.ArcticaProject.arctica-greeter.gschema.xml b/data/org.ArcticaProject.arctica-greeter.gschema.xml index 419e267..9f7fc6e 100644 --- a/data/org.ArcticaProject.arctica-greeter.gschema.xml +++ b/data/org.ArcticaProject.arctica-greeter.gschema.xml @@ -147,5 +147,9 @@ <default>'auto'</default> <summary>Monitor on which to show the Login GUI</summary> </key> + <key name="onscreen-keyboard-layout" type="s"> + <default>'Small'</default> + <summary>Name of the onscreen keyboard layout (see /usr/share/onboard/layouts/ for available layout names).</summary> + </key> </schema> </schemalist> diff --git a/src/menubar.vala b/src/menubar.vala index a417a03..87e0bf7 100644 --- a/src/menubar.vala +++ b/src/menubar.vala @@ -536,9 +536,17 @@ public class MenuBar : Gtk.MenuBar try { string[] argv; + string cmd; int onboard_stdout_fd; - - Shell.parse_argv ("onboard --xid", out argv); + var layout = AGSettings.get_string (AGSettings.KEY_ONSCREEN_KEYBOARD_LAYOUT); + var file = File.new_for_path ("/usr/share/onboard/layouts/%s.onboard".printf (layout)); + if (file.query_exists ()) { + cmd = "onboard --xid --layout='/usr/share/onboard/layouts/%s.onboard'".printf (layout); + } + else { + cmd = "onboard --xid"; + } + Shell.parse_argv (cmd, out argv); Process.spawn_async_with_pipes (null, argv, null, diff --git a/src/settings.vala b/src/settings.vala index 05f54fe..9eef320 100644 --- a/src/settings.vala +++ b/src/settings.vala @@ -41,6 +41,7 @@ public class AGSettings : Object public const string KEY_XFT_HINTSTYLE = "xft-hintstyle"; public const string KEY_XFT_RGBA = "xft-rgba"; public const string KEY_ONSCREEN_KEYBOARD = "onscreen-keyboard"; + public const string KEY_ONSCREEN_KEYBOARD_LAYOUT = "onscreen-keyboard-layout"; public const string KEY_HIGH_CONTRAST = "high-contrast"; public const string KEY_BIG_FONT = "big-font"; public const string KEY_SCREEN_READER = "screen-reader"; |