mirror of
https://git.sr.ht/~leon_plickat/wayneko
synced 2025-09-19 16:03:22 +02:00
Make idle timeout configurable
This commit is contained in:
parent
10a094493e
commit
2c10d982e7
2 changed files with 22 additions and 2 deletions
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