Additional dotfiles
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
from kitty.boss import Boss
|
||||
from kittens.tui.handler import result_handler
|
||||
import kitty.fast_data_types as f
|
||||
|
||||
focus_opacity = 0.5
|
||||
focus_margin = 200
|
||||
|
||||
|
||||
def main(args: list[str]) -> str:
|
||||
pass
|
||||
|
||||
@result_handler(no_ui=True)
|
||||
def handle_result(args, answer, target_window_id, boss):
|
||||
w = boss.window_id_map.get(target_window_id)
|
||||
current_opacity = f.background_opacity_of(target_window_id)
|
||||
|
||||
in_focus = True if current_opacity != 1 else False
|
||||
new_opacity = str(1 if in_focus else focus_opacity)
|
||||
new_margin = str(0 if in_focus else focus_margin)
|
||||
if w is not None:
|
||||
boss.call_remote_control(w, ('set-background-opacity', new_opacity))
|
||||
boss.call_remote_control(w, ('set-spacing', "margin-left="+new_margin))
|
||||
boss.call_remote_control(w, ('set-spacing', "margin-right="+new_margin))
|
||||
boss.toggle_fullscreen()
|
||||
@@ -5,6 +5,10 @@ font_size 16
|
||||
shell /usr/bin/fish
|
||||
cursor_trail 3
|
||||
cursor_trail_decay 0.1 0.25
|
||||
dynamic_background_opacity true
|
||||
map f11 kitten focus_mode.py
|
||||
|
||||
|
||||
|
||||
# BEGIN_KITTY_THEME
|
||||
# Everforest Light Hard
|
||||
|
||||
Reference in New Issue
Block a user