aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/arctica-greeter.vala16
-rw-r--r--src/settings.vala1
2 files changed, 17 insertions, 0 deletions
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";