Lock Screen & Sleep Shortcuts

- Add keybinding to lock screen with slock
- Add keybinding to lock screen and go to sleep with slock
This commit is contained in:
Sravan Balaji
2020-08-01 00:22:15 -04:00
parent 41958715d4
commit 485c40d5f9
2 changed files with 14 additions and 0 deletions

View File

@@ -68,6 +68,8 @@ static const char deaddscriptpath[] = "/home/sravan/.config/deadd/open-notificat
static const char *rofiruncmd[] = { "rofi", "-show", "drun", NULL };
static const char *roficlipcmd[] = { "rofi", "-show", "clipboard", NULL };
static const char *deaddcmd[] = { "/bin/bash", deaddscriptpath, NULL };
static const char *lockcmd[] = { "slock", NULL };
static const char *sleepcmd[] = { "slock", "systemctl", "suspend", NULL };
static const char *termcmd[] = { "alacritty", NULL };
static Key keys[] = {
@@ -75,6 +77,8 @@ static Key keys[] = {
{ MODKEY, XK_p, spawn, {.v = rofiruncmd } },
{ MODKEY, XK_c, spawn, {.v = roficlipcmd } },
{ MODKEY|ShiftMask, XK_n, spawn, {.v = deaddcmd } },
{ MODKEY|ShiftMask, XK_l, spawn, {.v = lockcmd } },
{ MODKEY|ShiftMask, XK_s, spawn, {.v = sleepcmd } },
{ MODKEY|ShiftMask, XK_Return, spawn, {.v = termcmd } },
{ MODKEY, XK_b, togglebar, {0} },
{ MODKEY, XK_j, focusstack, {.i = +1 } },

10
dwm.1
View File

@@ -82,6 +82,16 @@ for Greenclip clipboard manager
Spawn
.BR deadd notification center (1)
.TP
.B Mod1\-Shift\-l
Spawn
.BR slock(1)
to lock screen.
.TP
.B Mod1\-Shift\-s
Spawn
.BR slock(1)
to lock screen and go to sleep.
.TP
.B Mod1\-,
Focus previous screen, if any.
.TP