Allow querying background opacity via XTGETTCAP
This commit is contained in:
parent
deff40df8a
commit
879effc6f5
1 changed files with 14 additions and 0 deletions
|
|
@ -202,6 +202,20 @@ def get_result(opts: Options, window_id: int, os_window_id: int) -> str:
|
|||
return (w.screen.color_profile.default_bg or get_options().background).as_sharp
|
||||
|
||||
|
||||
@query
|
||||
class BackgroundOpacity(Query):
|
||||
name: str = 'background_opacity'
|
||||
help_text: str = 'The current background opacity as a number between 0 and 1'
|
||||
|
||||
@staticmethod
|
||||
def get_result(opts: Options, window_id: int, os_window_id: int) -> str:
|
||||
from kitty.fast_data_types import background_opacity_of
|
||||
ans = background_opacity_of(os_window_id)
|
||||
if ans is None:
|
||||
ans = 1.0
|
||||
return f'{ans:g}'
|
||||
|
||||
|
||||
@query
|
||||
class ClipboardControl(Query):
|
||||
name: str = 'clipboard_control'
|
||||
|
|
|
|||
Loading…
Reference in a new issue