dotfiles/pkgs/helix/open_file_tree.bash
2024-05-22 15:57:44 +03:00

16 lines
528 B
Bash
Executable file

#!/usr/bin/env bash
desired_width=25
# Open window on the left
YAZI_CONFIG_HOME=~/.config/yazi/filetree_config yazi
# Use jq to filter the JSON output based on the specific window ID
current_width=$(kitty @ ls | jq --arg window_id "$KITTY_WINDOW_ID" '.[].tabs[].windows[] | select(.id == ($window_id | tonumber)) | .columns')
# Calculate the increment value
increment=$((desired_width - current_width))
# Resize the window with the calculated increment value
kitten @ resize-window --increment $increment --axis horizontal