about summary refs log tree commit diff
diff options
context:
space:
mode:
authoraszlig <aszlig@redmoonstudios.org>2014-11-05 18:28:29 +0100
committeraszlig <aszlig@redmoonstudios.org>2014-11-05 20:02:50 +0100
commitc74b4cd93e8618ac01b099087396e3283806a35e (patch)
treea2b08b7c603d81a0c6a153a31f85bdc7dba8cc36
parent88a10f1a6e2ea172ff985f64bfcf82e26425530a (diff)
Integrate console lock screen into i3.
Now it's enough to just press super + shift + escape in order to trigger
the socket and thus the lock screen.

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
-rw-r--r--common-workstation.nix1
-rw-r--r--modules/i3/default.nix6
-rw-r--r--modules/i3/i3.conf3
3 files changed, 10 insertions, 0 deletions
diff --git a/common-workstation.nix b/common-workstation.nix
index 0884d00b..123c7c5f 100644
--- a/common-workstation.nix
+++ b/common-workstation.nix
@@ -48,6 +48,7 @@ in {
 
   vuizvui.i3.enable = true;
   vuizvui.slim.enable = true;
+  vuizvui.vlock.enable = true;
 
   services = {
     openssh = {
diff --git a/modules/i3/default.nix b/modules/i3/default.nix
index 5e2b9998..7e2795d9 100644
--- a/modules/i3/default.nix
+++ b/modules/i3/default.nix
@@ -106,6 +106,12 @@ in
       inherit (pkgs.xorg) xsetroot;
       inherit wsConfig barConfig;
 
+      lockall = pkgs.writeScript "lockvt.sh" ''
+        #!${pkgs.stdenv.shell}
+        "${pkgs.socat}/bin/socat" - UNIX-CONNECT:/run/console-lock.sock \
+          < /dev/null
+      '';
+
       postInstall = ''
         ${pkgs.i3}/bin/i3 -c "$target" -C
       '';
diff --git a/modules/i3/i3.conf b/modules/i3/i3.conf
index 7ef5fa03..cd14c425 100644
--- a/modules/i3/i3.conf
+++ b/modules/i3/i3.conf
@@ -21,6 +21,9 @@ bindsym $mod+Shift+C kill
 # start dmenu (a program launcher)
 bindsym $mod+p exec --no-startup-id @dmenu@/bin/dmenu_run
 
+# start lock screen
+bindsym $mod+Shift+Escape exec --no-startup-id @lockall@
+
 # set background
 exec @xsetroot@/bin/xsetroot -solid black