aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Gabriel <mike.gabriel@das-netzwerkteam.de>2023-03-02 12:30:24 +0100
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2023-03-02 12:49:45 +0100
commitc68179729de67ad4879613141699dcba35073a26 (patch)
treef96da5f86e60a973d87853eaf817c027ec94277e
parentf2eeb8a1bb87b3d055b602d7ee201785ba4f8db4 (diff)
downloadarctica-greeter-c68179729de67ad4879613141699dcba35073a26.tar.gz
arctica-greeter-c68179729de67ad4879613141699dcba35073a26.tar.bz2
arctica-greeter-c68179729de67ad4879613141699dcba35073a26.zip
OSK: Add OSK theme gsetting to individually configure the OSK theme used via ArcticaGreeter's settings.
-rw-r--r--data/org.ArcticaProject.arctica-greeter.gschema.xml4
-rw-r--r--src/menubar.vala19
-rw-r--r--src/settings.vala1
3 files changed, 18 insertions, 6 deletions
diff --git a/data/org.ArcticaProject.arctica-greeter.gschema.xml b/data/org.ArcticaProject.arctica-greeter.gschema.xml
index 5406035..c8bf28b 100644
--- a/data/org.ArcticaProject.arctica-greeter.gschema.xml
+++ b/data/org.ArcticaProject.arctica-greeter.gschema.xml
@@ -187,5 +187,9 @@
<default>'Small'</default>
<summary>Name of the onscreen keyboard layout (see /usr/share/onboard/layouts/*.onboard for available layout names).</summary>
</key>
+ <key name="onscreen-keyboard-theme" type="s">
+ <default>'Nightshade'</default>
+ <summary>Name of the onscreen keyboard theme (see /usr/share/onboard/themes/*.theme for available theme names).</summary>
+ </key>
</schema>
</schemalist>
diff --git a/src/menubar.vala b/src/menubar.vala
index 87e0bf7..d9dab66 100644
--- a/src/menubar.vala
+++ b/src/menubar.vala
@@ -538,14 +538,21 @@ public class MenuBar : Gtk.MenuBar
string[] argv;
string cmd;
int onboard_stdout_fd;
- 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);
+ var arg_layout = "";
+ var arg_theme = "";
+ var layout = AGSettings.get_string (AGSettings.KEY_ONSCREEN_KEYBOARD_LAYOUT);
+ var theme = AGSettings.get_string (AGSettings.KEY_ONSCREEN_KEYBOARD_THEME);
+ var fname_layout = "/usr/share/onboard/layouts/%s.onboard".printf (layout);
+ var fname_theme = "/usr/share/onboard/themes/%s.theme".printf (theme);
+ var file_layout = File.new_for_path (fname_layout);
+ var file_theme = File.new_for_path (fname_theme);
+ if (file_layout.query_exists ()) {
+ arg_layout = "--layout='%s'".printf (fname_layout);
}
- else {
- cmd = "onboard --xid";
+ if (file_theme.query_exists ()) {
+ arg_theme = "--theme='%s'".printf (fname_theme);
}
+ cmd = "onboard --xid %s %s".printf (arg_layout, arg_theme);
Shell.parse_argv (cmd, out argv);
Process.spawn_async_with_pipes (null,
argv,
diff --git a/src/settings.vala b/src/settings.vala
index a2dabd0..ecc01c4 100644
--- a/src/settings.vala
+++ b/src/settings.vala
@@ -42,6 +42,7 @@ public class AGSettings : Object
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_ONSCREEN_KEYBOARD_THEME = "onscreen-keyboard-theme";
public const string KEY_HIGH_CONTRAST = "high-contrast";
public const string KEY_BIG_FONT = "big-font";
public const string KEY_SCREEN_READER = "screen-reader";