Commit 148d8e75 authored by Daiki Ueno's avatar Daiki Ueno
Browse files

Revive eekboard -k option to specify keyboard from command line.

parent aca9a4dc
...@@ -41,6 +41,8 @@ static gchar *opt_address = NULL; ...@@ -41,6 +41,8 @@ static gchar *opt_address = NULL;
static gboolean opt_focus = FALSE; static gboolean opt_focus = FALSE;
static gboolean opt_keystroke = FALSE; static gboolean opt_keystroke = FALSE;
static gchar *opt_keyboards = NULL;
static gboolean opt_fullscreen = FALSE; static gboolean opt_fullscreen = FALSE;
static const GOptionEntry options[] = { static const GOptionEntry options[] = {
...@@ -58,6 +60,8 @@ static const GOptionEntry options[] = { ...@@ -58,6 +60,8 @@ static const GOptionEntry options[] = {
{"listen-keystroke", 's', 0, G_OPTION_ARG_NONE, &opt_keystroke, {"listen-keystroke", 's', 0, G_OPTION_ARG_NONE, &opt_keystroke,
N_("Listen keystroke events with AT-SPI")}, N_("Listen keystroke events with AT-SPI")},
#endif /* HAVE_ATSPI */ #endif /* HAVE_ATSPI */
{"keyboards", 'k', 0, G_OPTION_ARG_STRING, &opt_keyboards,
N_("Specify keyboards (comma separated)")},
{"fullscreen", 'F', 0, G_OPTION_ARG_NONE, &opt_fullscreen, {"fullscreen", 'F', 0, G_OPTION_ARG_NONE, &opt_fullscreen,
N_("Create window in fullscreen mode")}, N_("Create window in fullscreen mode")},
{NULL} {NULL}
...@@ -313,8 +317,11 @@ main (int argc, char **argv) ...@@ -313,8 +317,11 @@ main (int argc, char **argv)
g_signal_connect (eekboard, "destroyed", g_signal_connect (eekboard, "destroyed",
G_CALLBACK(on_destroyed), loop); G_CALLBACK(on_destroyed), loop);
g_object_unref (eekboard); g_object_unref (eekboard);
keyboards = g_settings_get_strv (settings, "keyboards"); if (opt_keyboards != NULL)
keyboards = g_strsplit (opt_keyboards, ",", -1);
else
keyboards = g_settings_get_strv (settings, "keyboards");
if (!set_keyboards (client, (const gchar * const *)keyboards)) { if (!set_keyboards (client, (const gchar * const *)keyboards)) {
g_strfreev (keyboards); g_strfreev (keyboards);
retval = 1; retval = 1;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment