From 6866a4a4ea98dfced0d429e449374022b7717cce Mon Sep 17 00:00:00 2001 From: Jonathan Hodgson Date: Thu, 25 Feb 2021 14:57:02 +0000 Subject: [PATCH] Changes functionality of power button A single push will turn off the screen A double push or a push and hold will open the power menu, allowing you to turn off, restart, logout or suspend (CRUST) --- config.def.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/config.def.h b/config.def.h index 7d06a2c..9d7bebf 100644 --- a/config.def.h +++ b/config.def.h @@ -122,6 +122,7 @@ static const char *brightnessDown[] = { "brightness", "down", NULL }; static const char *setBackgroundRandom[] = { "rofi-background", "--earth", NULL }; static const char *backgroundDetails[] = { "background", "--only-notify", NULL }; +static const char *lockScreen[] = { "screenlock", "--suspend", NULL }; static const char *powerMenu[] = { "rofi-shutdown", NULL }; #include "movestack.c" @@ -195,7 +196,7 @@ static Key keys[] = { // On the pinephone, I want a single press of the power button to put the phone in sleep mode. // I want a double press to bring up the power menu // TODO: Make a command for screen lock - //{ 0, XF86XK_PowerOff, 1, spawn, {.v = } }, + { 0, XF86XK_PowerOff, 1, spawn, {.v = lockScreen } }, { 0, XF86XK_PowerOff, 2, spawn, {.v = powerMenu } }, { MODKEY|ShiftMask, XK_r, 0, quit, {0} },