aboutsummaryrefslogtreecommitdiff
path: root/src/arctica-greeter.vala
diff options
context:
space:
mode:
authorClement Lefebvre <clement.lefebvre@linuxmint.com>2017-10-26 14:17:27 +0200
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2017-10-26 14:17:45 +0200
commitf192e262ea6d9905d29cf9ad8b0e76f463f9f475 (patch)
treef9795b47ffbb4bbc9ce8821e37a3fe1c1766234a /src/arctica-greeter.vala
parent0f7e41f9f567cbfb76085c4f5581a19d786a167b (diff)
downloadarctica-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
Diffstat (limited to 'src/arctica-greeter.vala')
-rw-r--r--src/arctica-greeter.vala16
1 files changed, 16 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)
{