New sleep action
useful in combine based mappings to make kitty sleep before executing the next action
This commit is contained in:
parent
51bba9110e
commit
c0d06adcb5
@ -53,6 +53,8 @@ Detailed list of changes
|
|||||||
|
|
||||||
- Bash integration: Fix ``clone-in-kitty`` not working on bash >= 5.2 if environment variable values contain newlines or other special characters (:iss:`5629`)
|
- Bash integration: Fix ``clone-in-kitty`` not working on bash >= 5.2 if environment variable values contain newlines or other special characters (:iss:`5629`)
|
||||||
|
|
||||||
|
- A new :ac:`sleep` action useful in combine based mappings to make kitty sleep before executing the next action
|
||||||
|
|
||||||
|
|
||||||
0.26.5 [2022-11-07]
|
0.26.5 [2022-11-07]
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|||||||
@ -10,7 +10,7 @@ import sys
|
|||||||
from contextlib import suppress
|
from contextlib import suppress
|
||||||
from functools import partial
|
from functools import partial
|
||||||
from gettext import gettext as _
|
from gettext import gettext as _
|
||||||
from time import monotonic
|
from time import monotonic, sleep
|
||||||
from typing import (
|
from typing import (
|
||||||
TYPE_CHECKING, Any, Callable, Container, Dict, Iterable, Iterator, List, Optional,
|
TYPE_CHECKING, Any, Callable, Container, Dict, Iterable, Iterator, List, Optional,
|
||||||
Set, Tuple, Union,
|
Set, Tuple, Union,
|
||||||
@ -1774,6 +1774,10 @@ class Boss:
|
|||||||
else:
|
else:
|
||||||
doit()
|
doit()
|
||||||
|
|
||||||
|
@ac('misc', 'Sleep for the specified time period')
|
||||||
|
def sleep(self, sleep_time: float) -> None:
|
||||||
|
sleep(sleep_time)
|
||||||
|
|
||||||
@ac('misc', 'Click a URL using the keyboard')
|
@ac('misc', 'Click a URL using the keyboard')
|
||||||
def open_url_with_hints(self) -> None:
|
def open_url_with_hints(self) -> None:
|
||||||
self.run_kitten_with_metadata('hints')
|
self.run_kitten_with_metadata('hints')
|
||||||
|
|||||||
@ -293,6 +293,15 @@ def single_integer_arg(func: str, rest: str) -> FuncArgsType:
|
|||||||
return func, [num]
|
return func, [num]
|
||||||
|
|
||||||
|
|
||||||
|
@func_with_args('sleep')
|
||||||
|
def sleep(func: str, sleep_time: str) -> FuncArgsType:
|
||||||
|
mult = 1
|
||||||
|
if sleep_time[-1] in 'shmd':
|
||||||
|
mult = {'s': 1, 'm': 60, 'h': 3600, 'd': 24 * 3600}[sleep_time[-1]]
|
||||||
|
sleep_time = sleep_time[:-1]
|
||||||
|
return func, [abs(float(sleep_time)) * mult]
|
||||||
|
|
||||||
|
|
||||||
@func_with_args('disable_ligatures_in')
|
@func_with_args('disable_ligatures_in')
|
||||||
def disable_ligatures_in(func: str, rest: str) -> FuncArgsType:
|
def disable_ligatures_in(func: str, rest: str) -> FuncArgsType:
|
||||||
parts = rest.split(maxsplit=1)
|
parts = rest.split(maxsplit=1)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user