diff options
author | Clement Lefebvre <clement.lefebvre@linuxmint.com> | 2017-10-26 14:17:27 +0200 |
---|---|---|
committer | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2017-10-26 14:17:45 +0200 |
commit | f192e262ea6d9905d29cf9ad8b0e76f463f9f475 (patch) | |
tree | f9795b47ffbb4bbc9ce8821e37a3fe1c1766234a | |
parent | 0f7e41f9f567cbfb76085c4f5581a19d786a167b (diff) | |
download | arctica-greeter-f192e262ea6d9905d29cf9ad8b0e76f463f9f475.tar.gz arctica-greeter-f192e262ea6d9905d29cf9ad8b0e76f463f9f475.tar.bz2 arctica-greeter-f192e262ea6d9905d29cf9ad8b0e76f463f9f475.zip |
Add support for numlockx.
Ported from slick-greeter:
From 82d912b8fe98e01c80a59e3c010b1bbb18c859b0 Mon Sep 17 00:00:00 2001
From: Clement Lefebvre <clement.lefebvre@linuxmint.com>
Date: Tue, 11 Jul 2017 16:57:23 +0200
Subject: [PATCH 1/1] Add support for numlockx
-rw-r--r-- | data/org.ArcticaProject.arctica-greeter.gschema.xml | 4 | ||||
-rw-r--r-- | debian/control | 1 | ||||
-rw-r--r-- | src/arctica-greeter.vala | 16 | ||||
-rw-r--r-- | src/settings.vala | 1 |
4 files changed, 22 insertions, 0 deletions
diff --git a/data/org.ArcticaProject.arctica-greeter.gschema.xml b/data/org.ArcticaProject.arctica-greeter.gschema.xml index e870a38..7e8adc8 100644 --- a/data/org.ArcticaProject.arctica-greeter.gschema.xml +++ b/data/org.ArcticaProject.arctica-greeter.gschema.xml @@ -110,5 +110,9 @@ <default>'service.arctica-project.org'</default> <summary>Default FQDN for host offering Remote Logon Service</summary> </key> + <key name="activate-numlock" type="b"> + <default>false</default> + <summary>Whether to activate numlock. This features requires the installation of numlockx.</summary> + </key> </schema> </schemalist> diff --git a/debian/control b/debian/control index 1cf0afe..7f0327c 100644 --- a/debian/control +++ b/debian/control @@ -48,6 +48,7 @@ Recommends: ayatana-indicator-application, ayatana-indicator-sound, network-manager-gnome, xinput, + numlockx, Provides: lightdm-greeter Breaks: edubuntu-artwork (<< 12.01.1~), diff --git a/src/arctica-greeter.vala b/src/arctica-greeter.vala index 0355534..94a1eb0 100644 --- a/src/arctica-greeter.vala +++ b/src/arctica-greeter.vala @@ -580,6 +580,16 @@ public class ArcticaGreeter greeter_ready (); } + private static void activate_numlock () + { + try { + Process.spawn_command_line_sync("/usr/bin/numlockx on", null, null, null); + } + catch (Error e){ + warning ("Error while activating numlock: %s", e.message); + } + } + public static int main (string[] args) { /* Protect memory from being paged to disk, as we deal with passwords */ @@ -641,6 +651,12 @@ public class ArcticaGreeter if (do_test_mode) debug ("Running in test mode"); + /* Set the numlock state */ + if (AGSettings.get_boolean (AGSettings.KEY_ACTIVATE_NUMLOCK)) { + debug ("Activating numlock"); + activate_numlock (); + } + Pid atspi_pid = 0; if (!do_test_mode) { diff --git a/src/settings.vala b/src/settings.vala index a888a96..e55b0c2 100644 --- a/src/settings.vala +++ b/src/settings.vala @@ -43,6 +43,7 @@ public class AGSettings public const string KEY_HIDDEN_USERS = "hidden-users"; public const string KEY_GROUP_FILTER = "group-filter"; public const string KEY_IDLE_TIMEOUT = "idle-timeout"; + public const string KEY_ACTIVATE_NUMLOCK = "activate-numlock"; public const string KEY_REMOTE_SERVICE_FQDN = "remote-service-fqdn"; public const string KEY_TOGGLEBOX_FONT_FGCOLOR = "togglebox-font-fgcolor"; public const string KEY_TOGGLEBOX_BUTTON_BGCOLOR = "togglebox-button-bgcolor"; |