mirror of
https://github.com/swaywm/sway.git
synced 2026-05-05 06:46:49 -04:00
Add lock command for invoking swaylock_command
Add lock command to be able to bind a key to invoke the lock command specified by swaylock_command
This commit is contained in:
parent
61cc0c67fe
commit
146a22290e
5 changed files with 15 additions and 0 deletions
|
|
@ -117,6 +117,7 @@ sway_cmd cmd_input;
|
|||
sway_cmd cmd_seat;
|
||||
sway_cmd cmd_ipc;
|
||||
sway_cmd cmd_kill;
|
||||
sway_cmd cmd_lock;
|
||||
sway_cmd cmd_layout;
|
||||
sway_cmd cmd_log_colors;
|
||||
sway_cmd cmd_mark;
|
||||
|
|
|
|||
|
|
@ -4,4 +4,5 @@
|
|||
|
||||
void idle_setup_seat(struct sway_server *server, struct sway_seat *seat);
|
||||
bool idle_init(struct sway_server *server);
|
||||
void invoke_swaylock();
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -167,6 +167,7 @@ static struct cmd_handler command_handlers[] = {
|
|||
{ "focus", cmd_focus },
|
||||
{ "kill", cmd_kill },
|
||||
{ "layout", cmd_layout },
|
||||
{ "lock", cmd_lock },
|
||||
{ "move", cmd_move },
|
||||
{ "opacity", cmd_opacity },
|
||||
{ "reload", cmd_reload },
|
||||
|
|
|
|||
11
sway/commands/lock.c
Normal file
11
sway/commands/lock.c
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
#include <wlr/util/log.h>
|
||||
#include "log.h"
|
||||
#include "sway/commands.h"
|
||||
#include "sway/idle.h"
|
||||
|
||||
struct cmd_results *cmd_lock(int argc, char **argv) {
|
||||
|
||||
invoke_swaylock();
|
||||
|
||||
return cmd_results_new(CMD_SUCCESS, NULL, NULL);
|
||||
}
|
||||
|
|
@ -37,6 +37,7 @@ sway_sources = files(
|
|||
'commands/focus_follows_mouse.c',
|
||||
'commands/fullscreen.c',
|
||||
'commands/kill.c',
|
||||
'commands/lock.c',
|
||||
'commands/opacity.c',
|
||||
'commands/include.c',
|
||||
'commands/input.c',
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue