mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-26 10:12:17 +02:00
Allow querying background opacity via XTGETTCAP
This commit is contained in:
@@ -202,6 +202,20 @@ class Background(Query):
|
|||||||
return (w.screen.color_profile.default_bg or get_options().background).as_sharp
|
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
|
@query
|
||||||
class ClipboardControl(Query):
|
class ClipboardControl(Query):
|
||||||
name: str = 'clipboard_control'
|
name: str = 'clipboard_control'
|
||||||
|
|||||||
Reference in New Issue
Block a user