From 2825c899617cefc872198296f83572ec3504db93 Mon Sep 17 00:00:00 2001
From: Přemysl Janouch
Date: Wed, 27 Jan 2016 20:22:49 +0100
Subject: Add gdm-switch-user, run by dwmstatus
---
dwmstatus.c | 15 +++++++++++++++
1 file changed, 15 insertions(+)
(limited to 'dwmstatus.c')
diff --git a/dwmstatus.c b/dwmstatus.c
index 11c78ef..241c435 100644
--- a/dwmstatus.c
+++ b/dwmstatus.c
@@ -2637,6 +2637,18 @@ on_volume_set (struct app_context *ctx, int arg)
ctx->sink_name, &volume, on_volume_finish, ctx));
}
+static void
+on_lock (struct app_context *ctx, int arg)
+{
+ (void) arg;
+
+ // One of these will work
+ char *argv_gdm[] = { "gdm-switch-user", NULL };
+ spawn (ctx, argv_gdm);
+ char *argv_ldm[] = { "dm-tool", "lock", NULL };
+ spawn (ctx, argv_ldm);
+}
+
static void
on_brightness (struct app_context *ctx, int arg)
{
@@ -2655,6 +2667,9 @@ struct
}
g_keys[] =
{
+ // This key should be labeled L on normal Qwert[yz] layouts
+ { Mod4Mask, XK_n, on_lock, 0 },
+
// MPD
{ Mod4Mask, XK_Up, on_mpd_play, 0 },
{ Mod4Mask, XK_Down, on_mpd_stop, 0 },
--
cgit v1.2.3-70-g09d2