mirror of
https://git.sr.ht/~leon_plickat/wayneko
synced 2025-09-19 07:53:21 +02:00
Make idle timeout configurable
This commit is contained in:
parent
10a094493e
commit
2c10d982e7
2 changed files with 22 additions and 2 deletions
10
wayneko.1
10
wayneko.1
|
@ -1,4 +1,4 @@
|
|||
.TH WAYNEKO 1 2023-08-14 "git.sr.ht/~leon_plickat/wayneko" "General Commands Manual"
|
||||
.TH WAYNEKO 1 2024-03-24 "git.sr.ht/~leon_plickat/wayneko" "General Commands Manual"
|
||||
.
|
||||
.SH NAME
|
||||
.P
|
||||
|
@ -16,6 +16,7 @@ wayneko \- Neko on Wayland
|
|||
.OP \-\-background\-colour 0xRRGGBB[AA]
|
||||
.OP \-\-outline\-colour 0xRRGGBB[AA]
|
||||
.OP \-\-type neko|inu|random
|
||||
.OP \-\-idle-sleep seconds
|
||||
.OP \-\-layer background|bottom|top|overlay
|
||||
.OP \-\-follow\-pointer true|false
|
||||
.OP \-\-survive\-close
|
||||
|
@ -60,6 +61,13 @@ This option lets you choose between neko and her friend inu.
|
|||
.RE
|
||||
.
|
||||
.P
|
||||
\fB\-\-idle-sleep\fR \fIseconds\fR
|
||||
.RS
|
||||
Set the time in seconds after which neko will go to sleep when the user is
|
||||
idle.
|
||||
.RE
|
||||
.
|
||||
.P
|
||||
\fB\-\-layer\fR \fBbackground\fR|\fBbottom\fR|\fBtop\fR|\fBoverlay\fR
|
||||
.RS
|
||||
Set the layer for the surface.
|
||||
|
|
14
wayneko.c
14
wayneko.c
|
@ -79,7 +79,7 @@ bool recreate_surface_on_close = false;
|
|||
enum zwlr_layer_shell_v1_layer layer = ZWLR_LAYER_SHELL_V1_LAYER_BOTTOM;
|
||||
|
||||
struct ext_idle_notifier_v1 *idle_notifier = NULL;
|
||||
const uint32_t neko_idle_timeout_ms = 180000; /* 3 minutes. */ // TODO make configurable
|
||||
uint32_t neko_idle_timeout_ms = 180000; /* 3 minutes. */
|
||||
|
||||
struct Seat
|
||||
{
|
||||
|
@ -1414,6 +1414,18 @@ int main (int argc, char *argv[])
|
|||
else if ( strcmp(a, "overlay") == 0 )
|
||||
layer = ZWLR_LAYER_SHELL_V1_LAYER_OVERLAY;
|
||||
}
|
||||
else if ( strcmp(argv[i], "--idle-sleep") == 0 )
|
||||
{
|
||||
const char *a = get_argument(argc, argv, &i);
|
||||
int timeout = atoi(a);
|
||||
if (timeout > 0)
|
||||
neko_idle_timeout_ms = (uint32_t) timeout * 1000;
|
||||
else
|
||||
{
|
||||
fprintf(stderr, "ERROR: Invalid argument '%s' for flag '--idle-sleep'.\n", a);
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
fprintf(stderr, "ERROR: Unknown option: %s\n", argv[i]);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue